VLAN Interfaces on Redhat

This step by step guide is for configuring VLAN interfaces on Redhat based operating systems.

For the following guide we will use the following data:

TypeValue
VLAN Tag1000
IP Address192.0.2.1
Netmask255.255.255.0
Deviceem1

Step-by-step guide

How to do it:

  1. Determine whether the 802.1q VLAN module is loaded:
lsmod | grep 8021q
  1. If it is loaded, go straight to step 3, otherwise:
modprobe 8021q
  1. With the 802.1q module loaded into the kernel we need to determine what the interfaces are called:
ls /sys/class/net/
  1. Create a VLAN interface based on the primary interface (usually the lowest numbered ethernet interface – eth0, em1, eno0, bce0 etc.) by opening a new file in your favourite editor

Info: This guide is intended for single interface configurations only, VLAN interfaces on bonded interfaces follow a similar configuration, however the primary interface at this point will be called something like “bond0” as referenced in the bonding guide.

nano /etc/sysconfig/network-scripts/ifcfg-em1.1000
  1. In this new file, we create the configuration for the VLAN – please replace the data here with the correct interface name, VLAN tag and your preferred IP addressing schema (This should be RFC1918 private address space to avoid issues).
DEVICE=em1.1000 
BOOTPROTO=none 
ONBOOT=yes 
VLAN=yes 
IPADDR=192.0.2.1 
NETMASK=255.255.255.0 
NM_CONTROLLED=no
  1. Bring up the VLAN interface by either restarting the networking stack or issuing the up command manually
RHEL/CentOS 5: "service network restart" OR "ifconfig up em1.1000" 
RHEL/CentOS 6: "service network restart" OR "ip link set em1.1000 up" 
RHEL/CentOS 7: "systemctl restart network" OR "ip link set em1.1000 up" 
  1. The device should now be up and visible under the “ifconfig” or “ip address show” commands. You may test it by issuing a ping command to another machine that is already configured

Get in touch

If you need advice on VLAN Interfaces for Redhat, we’re here to help.

Call us on 0333 247 0222: Monday – Friday, 9am – 5.30pm.

Chat with us on LiveChat: Monday – Friday, 9am – 5.30pm.

Write to us: Send us a support ticket from your Simply portal and we’ll get back to you as soon as we can.

If you don’t have an account with Simply Hosting yet, you can also send our Sales team an enquiry and we’ll get back to you between 9am and 5.30pm, Monday to Friday.


Was this article helpful?

Related guides