• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

CentOS / RHEL 6 : How to configure 802.1q VLAN On NIC

By admin

The configuration of the switch to support VLAN tagging is not covered in this post. You do not need to do anything for configuring native VLAN on Linux, since it only depends on switch configuration.

1. Check that the module is loaded by running the command:

# lsmod | grep 8021q

2. If the module is not loaded, proceed to run the following command to load it:

# modprobe 8021q

3. Proceed to configure your physical interface in /etc/sysconfig/network-scripts/ifcfg-eth#. For example,

DEVICE=eth0
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes

4. Configure the VLAN interface script in /etc/sysconfig/network-scripts. The configuration filename must be the physical interface plus a “.” character plus the VLAN id number. For example, if the VLAN id is 10, and the physical network interface is eth0, then the configuration filename should be ifcfg-eth0.10, as the example below:

DEVICE=eth0.10
BOOTPROTO=none
ONBOOT=yes
IPADDR=14.1.1.31
NETMASK=255.255.255.0
USERCTL=no
NETWORK=14.1.1.0
VLAN=yes

For more VLANs required on the same interface, add a new file with the name as in the example above and the VLAN configuration details, for example eth0.20

5. Restart the networking service, in order for the changes to take effect

# service network restart

Filed Under: Linux

Some more articles you might also be interested in …

  1. How to use sudo to allow a non-root user run a particular command
  2. How to add additional language support in CentOS/RHEL
  3. How to Restrict su Access to a User Only by PAM in Linux
  4. How to Use the ssh-keygen Command to configure passwordless ssh
  5. Unable to set a GRUB password on a Raspberry Pi 3 system
  6. How to Mount Guest Qcow2 Virtual disk Image containing LVM on KVM Host Machine
  7. How to Use Udev Rules to Create oracleasm Disks in CentOS/RHEL 8
  8. How to automate sftp file transfers using expect utility
  9. Understanding the rc Scripts in Linux
  10. CentOS / RHEL 7 : How to enable or disable automatic updates (via packagekit)

You May Also Like

Primary Sidebar

Recent Posts

  • CentOS/RHEL 8: “ACPI MEMORY OR I/O RESET_REG” Server Hung after reboot
  • How to Create a Physical Standby Database by Using SQL and RMAN Commands
  • Basics of client connectivity in Oracle Data Guard configuration
  • ORA-354 ORA-353 and ORA-312: Possible corruption in Online Redo Log File Members in a Redo Log Group
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary