Pages

Sunday, January 5, 2014

VirtualBox in GNS3 under Linux part2

Continuing the previous post  VirtualBox in GNS3 under Linux part1, I will show below the steps on how to make GNS3 work with Virtualbox using emulated VirtualBox host-only adapters. 

STEP 1 : Install VirtualBox and VMs
Install VirtualBox (current version is 4.3.6) and your favorite Virtual Machines.

STEP 2 : Create and configure host-only Network Adapters in VirtualBox
Open VirtualBox and goto Files ->Preferences->Networks->Host-only adapters
Click on the plus sign to add a Host-only Network. vboxnet0 is created
Select vboxnet0 and edit (screwdriver icon).
Change the IPv4 address to: 10.10.10.1 and IPv4 Network mask to 255.255.255.0.
(modify the IP addresses to match your example)

STEP 3 : Add more Host-only VirtualBox Adapters
Create another host only network vboxnet1.
For the IPv4 Address: 10.10.20.1 and IPv4 Network mask: 255.255.255.0.

You should now have two host-only networks adapters in different IP networks.
vboxnet0(10.10.10.0/24) and vboxnet1(10.10.20.0/24).





On Linux host machine I see the following an additional two interfaces created:
 ip addr  

vboxnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
    link/ether 0a:00:27:00:00:00 brd ff:ff:ff:ff:ff:ff
    inet 10.10.10.1/24 brd 10.10.10.255 scope global vboxnet0
    inet6 fe80::800:27ff:fe00:0/64 scope link 
       valid_lft forever preferred_lft forever
vboxnet1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
    link/ether 0a:00:27:00:00:01 brd ff:ff:ff:ff:ff:ff
    inet 10.10.20.1/24 brd 10.10.20.255 scope global vboxnet1
    inet6 fe80::800:27ff:fe00:1/64 scope link 
       valid_lft forever preferred_lft forever



You can also view the adapters that have been created by typing the VirtualBox command:
 VBoxManage list hostonlyifs  

STEP 4 : Install VMs and configure network adapter
Install your favorite Virtual Machines  in VirtualBox. I use one Windows and one Linux VM.
Windows VM-> Settings -> Network -> Adapter1->Host Only ->vboxnet0 
Linux VM -> Settings -> Network -> Adapter1->Host Only ->vboxnet1 

STEP 5 : Draw topology and Configure R1

The example I use is based on the GNS3 network diagram shown below.



For the cloud note configuration, just goto NIO Ethernet  and under Linux Ethernet NIO select the vboxnet0 adapter for the Window VM (WinXP_01) and vboxnet1 adapter for the Linux VM (Linux_01).
See below some screenshots.



You can change cloud symbol to a computer icon for easy understanding of the topology. 
You can also use the add on graphics (text , shapes and colors)  to label your topology accordingly. So you end up something like this.



STEP 6 : Start network devices in GNS3 Start all devices on GNS3 and configure router R1 like below.

interface FastEthernet1/0

 description -- LAN 10.10.10.0 --
 ip address 10.10.10.254 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet1/1
 description -- LAN 10.10.20.0 --
 ip address 10.10.20.254 255.255.255.0
 duplex auto
 speed auto

STEP 7 : Start Virtual Machines and check network connectivity
From VirtualBox , start the two Virtual machines (WinXP_01, Linux_01)
Configure the network interfaces with correct static IP address.

WinXP_01 : 10.10.10.200/24




Linux_01 : 10.10.20.200/24



Check network connectivity by pinging from/ to R1-WinXP_01 and R1-Linux_01

If you cannot ping from R1 to WinXP_01 make sure that firewall on Windows machine is down.

R1#ping 10.10.10.200            
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.200, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/17/32 ms


R1#ping 10.10.20.200

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.20.200, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/13/24 ms






No comments: