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 postImprovements are:
- 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
Attachment:
File comment: junos-auto-checkpic script for windows
junos-auto-fix-checkpic.win.zip [301.78 KiB]
Downloaded 9953 times
Download the Linux/OS X script here
Attachment:
File comment: junos-auto-fix-checkpic script for Linux/OS X
junos-auto-fix-checkpic.sh.zip [2.35 KiB]
Downloaded 4812 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 PreparationStart by opening GNS3
Preferences, Qemu settings
[General Settings] tab.
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.exePath to qemu:
qemu.exePath to qemu-img:
qemu-img.exeLinux users should use:
Path to Qemuwrapper:
/usr/share/gns3/qemuwrapper.pyPath to qemu:
qemuPath to qemu-img:
qemu-imgOS X users should use:
Path to Qemuwrapper:
/Applications/GNS3.app/Contents/Resources/qemuwrapper.pyPath to qemu:
/Applications/GNS3.app/Contents/Resources/Qemu-0.11.0/bin/qemuPath 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 or
%HOMEPATH%\GNS3\Images\Junos) and place the following files there. I will refer to this directory as you
Junos directory from now on
1.
freebsd-4.11.img - available from the
http://www.gns3.net/appliances page - or just click
here2. 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 or
WindowsUnzip 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 directory
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 X
cp freebsd-4.11.img olive-9.6R1.13.imgWindows
copy 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 X
sudo ./junos-auto-fix-checkpic.sh jinstall-9.6R1.13-domestic-signed.tgzWindows
junos-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
Linux
qemu -m 1G -hda olive-9.6R1.13.img -cdrom jinstall-9.6R1.13-domestic-olive.isoOS 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.isoWindows
"%PROGRAMFILEs%\GNS3\qemu.exe" -m 1G -hda olive-9.6R1.13.img -cdrom jinstall-9.6R1.13-domestic-olive.iso1. When the image boots, login with the username of
root –password
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:
# halt6. When you see the message saying that
Quote:
The operating system has halted.
Please press any key to reboot.
quit Qemu by pressing
<Ctrl>+<Alt>+2 and entering the quit command
(qemu) quitTip: 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:
Linux
qemu -m 1G -hda olive-9.6R1.13.img -serial telnet:0.0.0.0:3001,serverOS 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,serverWindows
"%PROGRAMFILEs%\GNS3\qemu.exe" -m 1G -hda olive-9.6R1.13.img -serial telnet:0.0.0.0:3001,server2. 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
[email protected]%
4. Shutdown the router with the halt command:
[email protected]% halt5. Once your router has shutdown, exit Qemu in the usual way (Press <Ctrl>+<Alt>+2, then type quit).
(qemu) quitYour JunOS image
JunOS9.6R1.13 is now ready for use in GNS3.
Part 3 Configure Qemu/JunOS PreferencesIn GNS3, open GNS3
Preferences, Qemu settings at the
[JunOS] tab.
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 directory.
Change the RAM: value to
512 MiBMake 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.