It is currently Sun Feb 23, 2020 9:11 am

All times are UTC

Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: HOWTO: Fully virtualized lab using Hyper-V 3.0 and GNS3
PostPosted: Mon Dec 10, 2012 7:09 pm 

Joined: Mon Dec 10, 2012 6:01 pm
Posts: 4
Virtual switch on Hyper-V 3.0 (which is part of Windows Server 2012) supports pass through trunk ports to virtual machines.
That makes possible create virtual machine which run GNS3 and router over it routes traffic between VLANs.

Virtual machine's network card driver must also support VLANs. Currently Windows 8 or Windows Server 2012 VM's network card drivers not support VLANs but Linux drivers supports so I use Ubuntu 12.04 in this howto.

Logical connection on Hyper-V looks like this.
hyperv-gns3-trunk1.png [ 8.88 KiB | Viewed 11027 times ]

Test connections in GNS3 looks like this.
hyperv-gns3-trunk2.png [ 8.55 KiB | Viewed 11027 times ]

GNS3 VM installation
* Install Ubuntu 12.04 LTS using default settings
* Enable root account and allow it login to X
* Shutdown VM
* Add additional network card to VM and set it to trunk mode using PowerShell commands
Add-VMNetworkAdapter -VMNetworkAdapterName "eth1" -VMName "GNS3"
Set-VMNetworkAdapterVlan -VMName "GNS3" -Trunk -NativeVlanId 1 -AllowedVlanIdList 1-4094 -VMNetworkAdapterName "eth1"
* In VM properties
** Select Virtual Switch (it is good idea create additional virtual switch before that using type "Private Network")
** In Network card "Advanced Features" select option "Enable MAC address spoofing" (this is needed because routers in GNS3 uses different MAC address than VM)
* Start VM again
* Install required packages
apt-get install vlan bridge-utils uml-utilities
* Edit file /etc/modules using your favorite editor and put these lines into it:
* Edit /etc/sysctl.conf and put these lines into it:
net.bridge.bridge-nf-call-ip6tables = 0             
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0
net.bridge.bridge-nf-filter-pppoe-tagged = 0
net.bridge.bridge-nf-filter-vlan-tagged = 0
* Edit /etc/network/interfaces to looks like this:
# The loopback network interface
auto lo
iface lo inet loopback

# eth0 for management connections
auto eth0
iface eth0 inet dhcp

# eth1 used by br0 so we put it in manual mode
# and add "up/down" commands to enable it
auto eth1
iface eth1 inet manual
        up /sbin/ifconfig eth1 up
        down /sbin/ifconfig eth1 down

# Generate tap0 adapter for GNS3 use
auto tap0
iface tap0 inet manual
        pre-up /usr/sbin/tunctl -t tap0
        up /sbin/ifconfig tap0 up
        down /sbin/ifconfig tap0 down

# Create br0 and put eth1 and tap0 into it
auto br0
iface br0 inet manual
        bridge_ports eth1 tap0
        bridge_stp off
        up /sbin/ifconfig br0 up
        down /sbin/ifconfig br0 down
* Reboot computer and check that you can see eth1, tap0 and br0 interfaces.
* Install GNS3 example using this guide
* Create test topology into GNS3, enable VLAN routing into router and put some test VM into that VLAN.

I hope this howto is useful :)

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 6 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group