Configuring VLAN interfaces in Linux |
In this post, we will see how to configure VLAN tagged interfaces on a Linux machine. This will allow you to connect your machine to different VLANs in your network using a single interface. In this example, am going to configure the VLAN tagging on the network card interface directly. If you want reduntancy in the network level, it is recommended to configure bonding and then configure VLAN taggging on that bonded interface. Based on the bonding parameter configured, you can make the bond work in active-standby mode / link aggregation / active-active or so… In this example, am having an interface eth0 configured with IP 192.168.0.1. Now, i need to configure 2 VLAN tagged interfaces for VLAN 10 & 20. The VLAN 10 interface should be assigned an IP 192.168.10.1 & VLAN 20 with IP 192.168.20.1. The interface configuration file is as follows:
Creating VLAN 10 tagged interface: To configure a VLAN tagged interface with VLAN_ID 10, copy the ifcfg-eth0 file and make ifcfg-eth0.10 first.
Now edit the contents as follows. Dont forget to add the entry VLAN=yes in the VLAN tagged interface configuration file.
Creating VLAN 20 Tagged interface: Copy the VLAN 10 interface configuration file to VLAN 20 interface configuration file.
Edit the
Restart the network service now
Switch Level Configuration: For the VLAN interfaces to communicate through the switch, the switch port to which we connect the server interface should be configured as a trunk port. This is to be done in the network switch level. The interface fastethernet 0/2 here represents the interface in the swithc to which the server is connected. You may have to replace the interface type and numbers according to your physical connectivity.
Configuring VLAN tagged interfaces using vconfig commandWe can configure VLAN interfaces using vconfig command also. This configuration is a temporary one and will be lost after a reboot. To add a VLAN 10 tagged interface, use the following command:
Use ifconfig to assign IP address to vlan interface :
Get detailed information about VLAN interface:
Get the VLAN interface information on the server
If you wish to delete VLAN interface delete command
|
Posted - Mon, May 21, 2018 8:47 PM. This article has been viewed 4894 times. |
Online URL: http://kb.ictbanking.net/article.php?id=24 |
Powered by PHPKB (Knowledge Base Software)