Product SiteDocumentation Site

7.2. Configure 802.1Q VLAN Tagging Using the Command Line

In Fedora, the 8021q module is loaded by default. If necessary, you can make sure that the module is loaded by issuing the following command as root:
~]# modprobe --first-time 8021q
modprobe: ERROR: could not insert '8021q': Module already in kernel
To display information about the module, issue the following command:
~]$ modinfo 8021q
See the modprobe(8) man page for more command options.

7.2.1. Setting Up 802.1Q VLAN Tagging Using ifcfg Files

  1. Configure your physical interface in /etc/sysconfig/network-scripts/ifcfg-ethX, where X is a unique number corresponding to a specific interface, as follows:
    DEVICE=ethX
    TYPE=Ethernet
    BOOTPROTO=none
    ONBOOT=yes
  2. Configure the VLAN interface configuration in the /etc/sysconfig/network-scripts/ directory. The configuration file name should be the physical interface plus a . character plus the VLAN ID number. For example, if the VLAN ID is 192, and the physical interface is eth0, then the configuration file name should be ifcfg-eth0.192:
    DEVICE=ethX.192
    BOOTPROTO=none
    ONBOOT=yes
    IPADDR=192.168.1.1
    NETMASK=255.255.255.0
    NETWORK=192.168.1.0
    VLAN=yes
    If there is a need to configure a second VLAN, with for example, VLAN ID 193, on the same interface, eth0, add a new file with the name eth0.193 with the VLAN configuration details.
  3. Restart the networking service in order for the changes to take effect. As root issue the following command:
    ~]# systemctl restart network