Juniper Olive on Qemu on FreeBSD host
Monday, October 15th, 2007Basically, most of this post is taken from http://juniper.cluepon.net/index.php/Olive with some modifications to install Qemu on FreeBSD host. As stated in website above, Olive is simply JunOS running on a PC which happens to not be installed inside a router. Olive is the natural state of a PC running JunOS when there is no PFE attached.
Why do I prefer to have Qemu on FreeBSD? There are several reasons:
- I have my own FreeBSD server connected with IP public all the time
- I don’t want to reduce my laptop performance because of running Qemu
- I am not always using my laptop which has Qemu installed
- I want to have dedicated PC for all simulation purposes
So, now we start. First of all, if you are using FreeBSD, I strongly recommend to use Ports, Don’t install Qemu manually if you don’t want to waste your time with some headache. There are two Qemu source in FreeBSD ports, Qemu and Qemu-devel. Choose Qemu-devel if you want to get fxp0 interface in your Olive. Fxp interface is only available in Qemu-devel right now, or if you want to make sure that your qemu version is alredy supporting fxp0 or not, you can check whether eepro100.c file is present in hw subdirectory inside the qemu source directory. If you have this file, you can sure that you will have fxp interface support in your qemu.
http://people.freebsd.org/~maho/qemu/qemu.html gives you very brief guide to install Qemu on FreeBSD. Don’t forget to install kqemu since it has significant impact on your performance.
If you finish with Qemu installation, you can continue your olive installation by referring to http://juniper.cluepon.net/index.php/Olive and http://www.smogey.net/tech/Juniper/Olive/index.htm. Smogey.net gives you very detail step by step FreeBSD and JunOS installation guide, don’t worry about the vmware, the procedure of installing FreeBSD and JunOS is the same between vmware and qemu. Just create your qemu virtual disk and start your qemu before installing the FreeBSD.
Or, if you already have Juniper Olive Vmware virtual disk (the vmdk file), you can use this vmdk on qemu. Just start qemu with this vmware vmdk.
One small tip from me, if you want to keep your image file as small as possible, convert your image format to qcow with compression format using qemu because i found that vmdk and normal qemu image format always gives you false size report, there are two size report, normal size and physical size. It is ok if you don’t have a plan to copy your image to somewhere else, because your operating system is referring to physical size, so you need not to worry if you see 10 G in your image size. BUT, if you copy this file to somewhere else, the destination folder/drive will allocate the normal size, so in this case, your destination drive will allocate 10G free space just for your empty image.
I created 5 fxp interfaces inside Qemu using the following command:
qemu -L . -m 256 -hda olive2.img -serial telnet::xxxx,server -localtime -net nic,vlan=0,macaddr=00:aa:00:00:01:02,model=i82559er -net nic,vlan=1,macaddr=00:a
a:00:00:01:03,model=i82559er -net nic,vlan=1,macaddr=00:aa:00:00:01:04,model=i82559er -net nic,vlan=2,macaddr=00:aa:00:00:01:05,model=i82559er -net nic,vlan=
2,macaddr=00:aa:00:00:01:06,model=i82559er -vnc :1 -usbdevice tablet -net tap,vlan=0,ifname=tap0
And, I got all my vlan interfaces and ospf up and running. This my screenshot of my Olive using JunOS 7.4.
btw, I have seen someone is testing Olive by handling around 45 Mbps traffic, running GRE tunnel, OSPF and having almost half internet full routes in the BGP prefix and it is stable enough.
rendo [dot] aw [at] gmail [dot] com
nb: I shut off my comment feature in this website due to spam. If you have any question, just drop my an email.

