How to configure VLAN in Linux?
Follow the steps below to configure VLAN in RedHat:
1. Open the Terminal
2. You need to copy file /etc/sysconfig/network-scripts/ifcfg-eth0 to /etc/sysconfig/network-scripts/ifcfg-eth0.X where X is the VLAN ID like 2, 3 or 4 and so on. Don't use 1 as VLAN ID.
Type this command while you are in terminal: cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0.3 (Note: i have chosen 3 as my VLAN ID)
3. Now, open the /etc/sysconfig/network-scripts/ifcfg-eth0.3 file and change following: (Note: Don't change anything /etc/sysconfig/network-scripts/ifcfg-eth0 file.)
Command: vi /etc/sysconfig/network-scripts/ifcfg-eth0.3
Change following -
- DEVICE=ifcfg-eth0 to ifcfg-eth0.3
- Append VLAN=Yes
- Enter the correct IP addresses
Note: Don't enter gateway entry in any of the network config file except /etc/sysconfig/network file.
4. Now, Restart the network by issuing this command from Terminal
# /etc/init.d/network restart
Alternatively, you can also use vconfig command to configure VLAN.
0 comments:
Post a Comment