Apr 22, 2012

VLAN With Hypervisor - KVM

IDEA.


Some times we need a VLAN inside the Linux machine to communicate with outside network. Specifically when we are dealing with Blade Servers. KVM Hypervisor only allows outside traffic through this VLAN only OR Management IP. We are not considering management NIC here.

The traffic from BladeS erver is allowed to main switch only through this VLAN. When a packet come from the Blade , the particular port of the switch will ask challenge to the packet for VLAN information. So we need to create a separate VLAN inside the Linux machine.

HowTO

cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0.300

vi /etc/sysconfig/network-scripts/ifcfg-eth0.300

Find the Word DEVICE and change its name to eth0.300 (Normally that should be eth0)

Add the Line       VLAN=yes

Restart the Network    /etc/init.d/network restart.

Adding a new VLAN

vconfig add eth0 5

Assigning an IPAddress to the VLAN

ifconfig eth0.5 192.168.1.100 netmask 255.255.255.0 broadcast 192.168.1.255 up

For Shutting down a VLAN

ifdown eth0.300

For Remove a VLAN

vconfig rem eth0.300

No comments: