Thursday, June 30, 2011

How to assign NIC in vlan?

■ Requirement : Assign NIC in vlan
■ OS Environment : Linux[RHEL, Centos]
■ Application:vlan
■ Implementation Steps :

Why VLAN : create a virual lan(grouping some computers from actual LAN with out using any switch/routers etc. Only needs software. Can also be done using hardware)

$ yum install vconfig

1. copy /etc/sysconfig/network-scripts/ifcfg-eth0 to etc/sysconfig/network-scripts/ifcfg-eth0.2 and edit : VLAN=yes like :

DEVICE=eth0.2
VLAN=yes
TYPE=Ethernet
HWADDR=##:##:##:##:##:##
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.1.24
GATEWAY=192.168.1.254

Note : VLAN id is here 2 for eth0

2. Do for other nic and assign proper vlan ID. Contact network admin to get vlan details.
3. Restart network service. 

No comments:

Post a Comment