Sometimes is rewuired on CentOS servers to make use of VLANs. currently, almost any managed ethernet switch is capable of using tagged VLANs encapsulated in the industrial 'de facto' format: 802.1q.
To make use of 802.1q VLAN on CentOS there is no additional package needed, all the required tools are available even in the minimal installation.
First required step is to enable the physical interface, preferably without any ip address. Since the system-config-network-tui tool is not able at this time to configure an interface without enabling DHCP, it is preferable to edit the configuration file manually.
In this example, I will use the interface eth0, which will transport packets for two vlans: vlan 10 and vlan 11.
Three configuration files must be edited:
The most important settings for eth0 are:
ONBOOT=yes : the interface will be brought up automatically
BOOTPROTO=none : the interface will have the ip address set manually, and no address is specified. This means that the interface will be brought up without an IPv4 address
IPV6INIT=no : the IPv6 stack will not be bounded to this interface
IPV6AUTOCONF=no : IPv6 autoconfiguration is disabled for this interface
Now it's time to start the interfaces. This can be done manually, using /sbin/ifup:
Or by using /sbin/service: