How to run JUNOS installed on Qemu on VirtualBox - Part2 UDP Tunnels and Multicast Testing

In a previous tutorial we have showed how to convert Olive Qemu image to VirtualBox image. Assuming that you have your Olive Vbox hard disk ready, we are going to test if  VirtualBox supports UDP tunnels and multicast traffic.

LAB Description and Purpose

 GNS3 lab with two VirtualBox Olives is created. Olives are occupied with e1000 type Ethernet card and connected each other with a gigabit link. If VirtualBox is patched for UDP tunnels, ping should be working between two Olive boxes.
The next test consists of checking whether multicast packets are transferred between Olives. In order to prove it, we will configure Olive routers for OSPF and monitor mutlicast traffic.

GNS3 version 0.8.3
Oracle VirtualBox 4.1.18 r78361
The host OS:  Linux Fedora 15, kernel 2.6.43.8-1
The guest OS:  Junos 12.1R1.9 installed on VirtualBox multiattach hard disk type - olive-base.vdi

1. Initial GNS3 Configuration - General VirtualBox settings

Start GNS3. Navigate to Edit-> Preferences-> VirtualBox-> General Settings. Set path to Vboxwrapper and others parameters according to your GNS3 instalation. Continue with Test Settings button. If your VirtualBox installation is ready to work with GNS3, a green message saying about "Vboxwrapper and VirtualBox API have successfully  started" should appear at the bottom of the window.

2. VirtualBox Configuration - Creating Olives Boxes

In this step we are going to create two Olive VirtualBox machines. VirtualBox Manager will be used to do it and started directly from GNS3.
Create a new blank GNS3 project - Ctrl+N.

Navigate to Control Menu located on the top panel of GNS3. Launch Show VirtualBox Manager option. Create a new virtual machine with Ctrl+N. Allocate 512MB RAM for Olive.

Once a new Vbox machine is created, use Ctrl+O to clone it. Your VirtualBox Manger should look as following:

3. GNS3 Configuration - Creating VirtualBox Guests

So far we have created two VirtualBox Olive machines. Now we have to configure GNS3 to use both Olives.

Navigate to Edit-> Preferences-> VirtualBox-> VirtualBox Guest. Click on Refresh VM List button. It instructs GNS3 to detect both VirtualBox machines we created in the step two. Notice, both Olives now can be selected for further configuration  in the VM List box. Choose the fist Vbox machine and configure parameters such as Identifier name, number of NICs and NIC model according to the picture below.

A parameter Start in headless mode tells GNS3 not to start  GUI   when VirtualBox machine machine is started. In this case, both options Enable console support and Enable console server must be also checked  to login to Olive.

The option DO not use fist NIC for connections with the host OS should be left unchecked when connection to the host OS is required. In this case, the first available ethernet interface - eth1 is considered as management interface. It means that the first usable interface for connection between Olive boxes is the interface eth2. To makes it even more confusing, eth2 interface is considered as em1 interface in Junos configuration.
The logic behind the interfaces is following for VirtualBox and GNS3 - each VirtualBox Ethernet interface is actually the Ethernet interface decreased in value 1 in the guest OS configuration.
For instance, imagine we have two VirtualBox boxes connected via their eth1 interfaces and the IP address configuration is required. Having in mind what we have said, we should configure this IP addresses on interfaces eth0.

Now back to the topic. As we do not want to reserve the interface eth1 for connection Olive to the host OS - Fedora Linux, we have to check the option DO not use fist NIC for connections with the host OS.  In this case, the  interface eth1 is the interface em0 in Junos configuration.

Once you have finished configuration of first VirtualBox machine, click on Save button. Select the second VirtualBox machine from VM List box and do the same configuration for this Olive.

4. UDP tunnels testing

Start both Olives Device-> Start and their particular consoles Device-> Console. You should see the whole boot process of Junos in the console window. Login with username root, password is not set. Switch from FreeBSD prompt to Junos prompt with cli command. Configure IP address for em0 interface as following.

root@% cli
root> configure
Entering configuration mode

[edit]

root# set interfaces em0 unit 0 family inet address 192.168.1.1/24

Setting password for root account is required to be able commit changes.

[edit]
root# set system root-authentication plain-text-password

Configure the hostname.

[edit]
root# set system host-name Olive1

Once you finished configuration, commit changes.

[edit]
root# commit

Do the similar configuration for the second Olive box. Once you are ready, issue the ping to see whether traffic is flowing between boxes.

root@Olive1> ping 192.168.1.2
PING 192.168.1.2 (192.168.1.2): 56 data bytes
64 bytes from 192.168.1.2: icmp_seq=0 ttl=64 time=1.718 ms
64 bytes from 192.168.1.2: icmp_seq=1 ttl=64 time=0.816 ms
64 bytes from 192.168.1.2: icmp_seq=2 ttl=64 time=0.879 ms
^C
--- 192.168.1.2 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.816/1.138/1.718/0.411 ms

It proves that UDP tunnels work for this version of  VirtualBox. The picture below shows a network connection detail for Ethernet1 interface of Olive1, captured from VirtualBox Manager. We can see the source and destination UDP port are opened on Fedora for UDP tunnel connection between VirtualBox machines.

The following output shows the same UDP ports from Fedora perspective.

$ sudo lsof -i
COMMAND    PID    USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
VBoxHeadl 3808    root   24u  IPv4  31229      0t0  UDP *:20903
VBoxHeadl 3905    root   24u  IPv4  32791      0t0  UDP *:20902

5. Multicast Testing

This lab tests whether multicast packets are transferred between VirtualBox machines. The easiest way to check it, is to configure routing protocol OSPF that uses multicast. If VirtualBox supports multicast traffic, a routing table is propagated between Olives.

Let's configure a new network on loopback lo0 interface for Olive1. Then configure OSPF protocol on both interfaces em0 and lo0.

root@Olive1# set interfaces lo0 unit 0 family inet address 10.10.10.1/32
root@Olive1# set protocols ospf area 0 interface em0
root@Olive1# set protocols ospf area 0 interface lo0
root@Olive1# commit

Do the similar configuration for the second box.

root@Olive2# set interfaces lo0 unit 0 family inet address 10.10.10.2/32
root@Olive1# set protocols ospf area 0 interface em0
root@Olive1# set protocols ospf area 0 interface lo0
root@Olive1# commit

If the multicast is working, the network 10.10.10.2/32 configured on the loopback interface lo0 of Olive2 should be presented in a routing table of Olive1.
As we can see in the picture, Olive1 has already put this single-host network to its routing table.

Another proof of working multicast can be presence of multicast traffic on interface em0.

End.

9 thoughts on “How to run JUNOS installed on Qemu on VirtualBox - Part2 UDP Tunnels and Multicast Testing

  1. > If VirtualBox is patched for UDP tunnels
    There is no "if". All VirtualBox v4.1 series have UDP Tunnel.

    -Technologov.

  2. Thanks for this detailed how to. I've just configured this on OSX Lion. The two olives are running fine and the UDP tunnel seems fine too. tcpdump shows outgoing and incoming OSPF + ARP traffic, but incoming traffic seems to be ignored when monitoring/tcpdump:

    02:42:18.205172 Out IP truncated-ip - 8 bytes missing! 192.168.2.1 > 224.0.0.5: OSPFv2, Hello, length 48
    02:42:23.486418 In IP truncated-ip - 8 bytes missing! 192.168.2.2 > 224.0.0.5: OSPFv2, Hello, length 48
    02:42:24.421333 In arp who-has 192.168.2.1 tell 192.168.2.2
    02:42:27.129628 Out arp who-has 192.168.2.2 tell 192.168.2.1
    02:42:27.471769 Out IP truncated-ip - 8 bytes missing! 192.168.2.1 > 224.0.0.5: OSPFv2, Hello, length 48
    02:42:31.158718 In IP truncated-ip - 8 bytes missing! 192.168.2.2 > 224.0.0.5: OSPFv2, Hello, length 48

    Any idea what might be going on?

  3. Would appreciate if you could have a similar article when using VMWARE olive instead of vbox. i can't get multicast pim neighborship up when using vmware olive. It works if using qemu olive. THANKS

  4. After the first time extract the jinstall-x-domestic-signed.tgz, why I need to modify the +INSTALL file, the process above did not package it back into the jinstall-x-domestic-olive.tgz, so what is the purpose to modify it?

  5. VMware fusion 5, doesnt like bridging TAP to VMNETS, it kernel panics. VMware fusion 6 pro DOES like it and does work - I have successfully tried it, and currently have a set up with 1 Juniper with 3 interfaces hooked up to 3 cisco boxes in GNS3. It makes my Macbook pro (a newer one with an i7 2.4 processor and 16GB ram), heat up substantially. but it works. Also got the junosv firefly working too.

Leave a comment

Your email address will not be published. Required fields are marked *