Olive reloaded or how to emulate Juniper routers

October 29th, 2009 by Jeremy Grossmann Leave a reply »

« »

This article explain you how to emulate Juniper JunOS on a PC using Qemu. This is an updated and enhanced version of excellent howtos from Juniper Clue and Internetwork Pro as well as Himawan Nugroho’s blog. I mainly focused on Qemu, so if you wish to install JunOS on a real PC or using VMware, please have a look at the Juniper Clue article for more information (and of course Google).

So what’s new you would say? First, I chose to use the latest version of Qemu: the 0.11.0 which supports the Intel e1000 network card emulation since version 0.10.0. and includes several fixes for it. I have modified and adapted the old patch for Qemu 0.11.0, it includes the UDP tunnel (connection to Dynamips/GNS3), PCAP and LCAP support. Also, the patch allows multicast traffic with the e1000, i82557b and i82559er Qemu emulated network cards. Moreover, this article show how to emulate JunOS on multiple operating systems: Mac OS X, Windows XP and Linux Ubuntu 9.04 without using an untrustworthy obscure binary downloaded from a forum you can’t even read the language ;)

Disclaimer

Please note that JunOS is not provided and will not be. So please don’t ask. Also, I do not take any responsibility on what happen on your PC, keep in mind this howto requires some patience and that is not for complete beginners. Moreover, this howto doesn’t necessarily present the best and/or easiest way to emulate JunOS. This is the cleanest and less intrusive for me but please feel free to give me constructive comments and tell what worked or didn’t worked for you.

What is a Olive?

This is very well summarized on the JuniperClue website:

Olive is also the codename name given to JUNOS software running on an PC rather than a Juniper router. A common misconception is that Olive is some sort of “special software”, but it is actually ordinary JUNOS software running on a PC of similar specifications to a Routing Engine, with no forwarding hardware (or PFE) attached. If you took a Routing Engine out of a Juniper router and booted it in a blade server chassis, it would effectively be an Olive.

Juniper originally developed Olive functionality as a software development platform, before its hardware product was fully implemented. It is not intended as a “router simulator”, and has never been a supported product, or intended for use by the general public in any way. At one point it was used by Juniper internally for lab work, but has largely been phased out of this role with the availability of low-end hardware based platforms such as the M5.

The most common use of the Olive platform is for creative and unix-competent hackers to learn the JUNOS CLI on a low-cost platform. It is capable of forwarding a small amount of traffic, but does not support many of the features found on real Juniper routers. Essentially the forwarding on an Olive is the same as routing traffic via your fxp0 or em0 management interface on a real Routing Engine.

Ok so why all the secrecy?

Again, JuniperClue explained all of this:

Juniper’s official position is that Olive does not exist. Considering that Olive is an unsupported and unsupportable platform using “free” (aka illegally licensed) software, this is not an unreasonable official position. Olive is essentially a hackers platform, with absolutely no support of any kind, and it is not suitable for any type of commercial use. If you are in any doubt, or if you are not able to figure it out, you should invest in a low-cost platform such as J-Series instead.

It is also important to remember that Olive exists because Juniper allows it to exist, and is a testament to the mutual respect between the extremely knowledgeable developer and user bases. If the Olive platform became widely abused, Juniper could easily add additional software checks to prevent it from working. Please do not abuse this feature by doing stupid things like contacting JTAC for support on an Olive, or selling illegal copies of the software as “router simulators”. This type of activity is likely to have serious legal consequences and/or provoke a justified response from Juniper, so just don’t do it.

133 comments

  1. HakimK says:

    I’ve followed all the instruction but after “qemu -m 256 -hda olive-base.img -boot c -localtime -nographic -serial stdio”, nothing happen. No qemu window appear and I only can see “stderr” and “stdout” files in the Qemu folder.

    stderr notepad shows:
    qemu: could not open serial device ‘mon:stdio’

    stdout notepad shows:
    Unable to open driver: stdio

    I’m trying to install olive in WinXP SP3 with qemu-0.11.0.patched.win32.

    did anyone have the same problem as me?

  2. Philip says:

    Hi,

    I always encounter this error (ELF Binary Type ’0′ Not Known). Do I missed something?

    Thanks

  3. Brad says:

    Everything went smoothly following the directions exactly a written, till I actually got to pkg_add.

    The VM complained about not enough space, saying I needed to change PKG_TMPDIR to a location that had at least 905682568 bytes. I cleaned out files I don’t need any more and made sure PKG_TMPDIR was pointing to /var/tmp. After clening out the files I had 1060060 K bytes free. So that should be enough. But kept getting same error.

  4. juber says:

    O tried to run scp [email protected]:~/Desktop/jinstall-8.5R1.14-domestic-signed.tgz /var/tmp command but request gets timed out.

    I put my PCs hostname instead of user, even i tried with the user i logged in with in my pc but still the request is getting timed out “ssh: connect to host 10.0.2.2 port 22: Operation time out”

    I wasted my 3 days to resolved this don’t know y its not working.

    I had put only “qemu -m 256 -hda olive-base.img -boot c -localtime ” command when booting olive image cause when i put “qemu -m 256 -hda olive-base.img -boot c -localtime \
    -net nic,macaddr=00:aa:00:60:01:01,model=e1000 -net user” the qemu does’n start….

    Please help guys

  5. arvind says:

    hi while trying to upload Junos iam getting following error.

    scp [email protected]:xxxxx\jinstall \var\tmp
    ssh: connect to host 10.0.2.2 port 22: Operation timed out.

    I thought my antivirus firewall might be blocking the udp and tcp packets so disabled that and tried .. then also i was unsuccessful pl help here.

  6. Carlos M says:

    FTR, the pcap check in the patch is wrong.
    Compiler barfs at not caster int return and also,
    the $TMPC should be abefore the $LIBPCAP for the test compile to work.

  7. Max says:

    Does anyone running this on a MAC OS X 10.6 know the replacement option for “-cdrom” in the QEMU command:

    qemu -m 256 -hda olive-base.img -cdrom 4.11-RELEASE-i386-miniinst.iso \ -boot d -localtime

    /Volumes doesn’t work. Using the mount point doesn’t work. I had this working on 10.5, but remember -cdrom didn’t work.

    Any help is appreciated!

    Thanks!

  8. Aamir Maqbool says:

    Hi, I’ve installed the olive by following the above procedure. However I’m facing currently two problems.
    1. I configure the Juniper Router in GNS3 and commit changes bye using commit command. But it does not take effect. until unless I reload all the routers.
    2. I’m unable to find serial interfaces, ATM interfaces & Sonet interfaces.

    Can Anyone provide me the help regarding this.

  9. Cristian Vnd says:

    Resolved JUNOS image upload problem :
    My settings
    - tap-interface with DHCP : ip taken 10.0.2.16
    - Core FTP (mini-sftp-server) to upload your junos image (username=user,password=user)
    then
    sfttp [email protected]:jinstall-8.5R1.14-domestic-signed.tgz /var/tmp
    from your freebsd VM

  10. Ryan says:

    I’m not able to proceed with the following command:

    qemu R1.img -m 96 -nographic -daemonize -serial telnet::2001,server,nowait \
    -localtime -net nic,macaddr=00:aa:00:60:01:01,model=e1000 -net user
    telnet localhost 2001

    It produces a stderr.txt file containing:

    qemu: invalid option — `-daemonize`

    If I remove this option, it produces another error:

    qemu: could not open monitor device `stdio`

    Anyone else having this same issue?

  11. neor says:

    Where do I put this command
    “qemu-img create -f qcow2 olive-base.img 4G”

  12. jomih says:

    Hi to all,
    I’ve tried to emulate JUNOS in GNS3 without success.
    When I use the command “qemu -m 256 -hda olive-base.img -boot c -localtime \ -net nic -net tap,ifname=tap0 -net nic,macaddr=00:aa:00:60:01:01,model=e1000 -net user” (in Ubuntu 10.04) and after creating the tap interface with tunctl, I get the following message:
    can’t add tap0 to bridge wlan0: operation not supported
    I’ve tried to do it using the eth0 interface instead of wlan0, but I got the same results.
    can anyone tell me what’s wrong??
    Thanks!!

  13. josem says:

    hi,

    once olive is loaded, I configure an ip address for the en0 interface and do a commit but the check-out fails with this message:

    vci/vpi/allow-any-vci is required

    how is this possible if my interface is en0?

Leave a Reply