I have put together a slightly updated set of scripts to assist folk who wish to create a Junos router to use with GNS3
These scripts are based on the set of scripts called "junos-auto-unprotect-v0.2" and were availbale via this post
- Cross platfrom *nix script - works on both OS X and Linux (Tested on OS X 10.8.4 and Linux Mint 15.0 - not sure about other versions)
- Creates a .iso image ready to be used with freebsd-4.11.img image. (Available from http://www.gns3.net/appliances)
Download the Windows script here
File comment: junos-auto-checkpic script for windows
junos-auto-fix-checkpic.win.zip [301.78 KiB]
Downloaded 9486 times
Download the Linux/OS X script here
File comment: junos-auto-fix-checkpic script for Linux/OS X
junos-auto-fix-checkpic.sh.zip [2.35 KiB]
Downloaded 4498 times
How to create a Junos image for GNS3 Part 1: Qemu Preparation
Part 2 Preparing a Junos olive image
Part 3: Configure Qemu/JunOS Preferences. Part 1 Qemu Preparation
Start by opening GNS3 Preferences, Qemu
settings [General Settings]
Click the Test Settings
button to ensure that your OS has paths to qemuwrapper, qemu and qemu-img. If not, check your GNS3 install directory and make sure these files are present. If necessary, specify the exact path to each by clicking on the ellipsis (…) next to the field where these paths are defined and find the appropriate directories.
Windows users should use
Path to Qemuwrapper: qemuwrapper.exe
Path to qemu: qemu.exe
Path to qemu-img: qemu-img.exe
Linux users should use:
Path to Qemuwrapper: /usr/share/gns3/qemuwrapper.py
Path to qemu: qemu
Path to qemu-img: qemu-img
OS X users should use:
Path to Qemuwrapper: /Applications/GNS3.app/Contents/Resources/qemuwrapper.py
Path to qemu: /Applications/GNS3.app/Contents/Resources/Qemu-0.11.0/bin/qemu
Path to qemu-img: /Applications/GNS3.app/Contents/Resources/Qemu-0.11.0/bin/qemu-imgPart 2 Preparing a Junos olive imageStep 1: Gather the required files.
Create a new directory called Junos
off your Images
directory (either ~/GNS3/Images/Junos
) and place the following files there. I will refer to this directory as you Junos
directory from now on
- available from the http://www.gns3.net/appliances
page - or just click here
2. Your copy of the JunOS operating system. It will be a file with a name something like jinstall-9.6R1.13-domestic-signed.tgz
3. This junos-auto-fix-checkpic
script for OS X/Linux
Unzip the junos-auto-fix-checkpic
file in your Junos
directory. If you are using windows, you should also get a direcory called bin
created off your Junos
In this example I will use jinstall-9.6R1.13-domestic-signed.tgz
as the example Junos image file.
I suggest copying your base image freebsd-4.11.img
to a name that will reflect the version of JunOS you plan to install. I will use the name olive-9.6R1.13.img
. The copy will be the base file for the future operations.
Linux and OS Xcp freebsd-4.11.img olive-9.6R1.13.img
Windowscopy freebsd-4.11.img olive-9.6R1.13.imgStep 2: Patch JunOS source image. IMPORTANT
: Run the script (and all following commands) at a command prompt from your Junos directory.
Linux and OS Xsudo ./junos-auto-fix-checkpic.sh jinstall-9.6R1.13-domestic-signed.tgz
Windowsjunos-auto-fix-checkpic.bat jinstall-9.6R1.13-domestic-signed.tgzStep 3: Install JunOS. Task 1: Install JunOS files.
Start by launching your FreeBSD virtual machine with 1G RAM
Linuxqemu -m 1G -hda olive-9.6R1.13.img -cdrom jinstall-9.6R1.13-domestic-olive.iso
OS X/Applications/GNS3.app/Contents/Resources/Qemu-0.11.0/bin/qemu –m 1G -hda olive-9.6R1.13.img -cdrom jinstall-9.6R1.13-domestic-olive.iso
Windows"%PROGRAMFILEs%\GNS3\qemu.exe" -m 1G -hda olive-9.6R1.13.img -cdrom jinstall-9.6R1.13-domestic-olive.iso
1. When the image boots, login with the username of root
2. Install the JunOS software using the following commands:# mount /cdrom
#Note: press <Enter> one more time once the mount is done# pkg_add -f /cdrom/jinstall-9.6R1.13-domestic-olive.tgzNote
: Be patient. Very patient. There will be no visible output, but you can keep checking that olive-9.6R1.13.img
is growing. Eventually you should see a message saying that:
A REBOOT IS REQUIRED TO LOAD THIS SOFTWARE CORRECTLY
4. Start by shutting down FreeBSD using the halt command:# halt
6. When you see the message saying that
The operating system has halted.
Please press any key to reboot.
quit Qemu by pressing <Ctrl>+<Alt>+2
and entering the quit command(qemu) quit
Tip: In Qemu, you can return to the guest OS screen by pressing <Ctrl>+<Alt>+1Task 2: Boot your image with console access.
1. Use the following command to boot your router with console access via TCP port 3001. The server option in the command line tells Qemu to wait for a telnet session to be established before booting:
Linuxqemu -m 1G -hda olive-9.6R1.13.img -serial telnet:0.0.0.0:3001,server
OS X/Applications/GNS3.app/Contents/Resources/Qemu-0.11.0/bin/qemu -m 1G -hda olive-9.6R1.13.img -serial telnet:0.0.0.0:3001,server
Windows"%PROGRAMFILEs%\GNS3\qemu.exe" -m 1G -hda olive-9.6R1.13.img -serial telnet:0.0.0.0:3001,server
2. This command will only initiate the boot – for the boot process to continue, you must start a telnet session to 127.0.0.1 on port 3001. For example:
telnet 127.0.0.1 3001
[Note: Windows users my have to enable telnet first, or use PuTTY or some other terminal app]
The output from the boot process will continue in your telnet session, and the install process will complete, and again, extreme patience is required (10-20 min). If you insist on watching, you will see your router reboot about half way through the process, and finally you will get to the login prompt. Note that your Qemu session will also open, but not all of the output will be seen there.
3. In the QEMU window, login with the username root – no password is required:login: root
--- JUNOS 9.6R1.13 built 2009-08-01 09:02:46 UTC
4. Shutdown the router with the halt command:root@% halt
5. Once your router has shutdown, exit Qemu in the usual way (Press <Ctrl>+<Alt>+2, then type quit). (qemu) quit
Your JunOS image JunOS9.6R1.13
is now ready for use in GNS3. Part 3 Configure Qemu/JunOS Preferences
In GNS3, open GNS3 Preferences, Qemu
settings at the [JunOS]
Give your image a name in the Identifier name: field, such as JunOS9.6R1.13
In the Binary image: field, click on the ellipsis (…) and locate the olive-9.6R1.13.img
file in your Junos
Change the RAM: value to 512 MiB
Make sure the Nic Model is E1000IMPORTANT
: Make sure you click Save
before you click OK
, and you can see your saved image in the list of JunOS Images at the bottom of the dialogue.
Now when you add routers to your topology, the Junos router symbol will be available.