top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration
Print Preview

How to configure VLAN in CentOS7?

+1 vote

I encountered a problem when creating a VLAN interface according to the Red_Hat_Enterprise_Linux-7-Networking_Guide. I configured the parent interface ifcfg-eno1 as follows:


And I created a new file named ifcfg-eno1.5, the content is:


Then I restarted the network:

 systemctl restart network 

After that I found that I couldn't connect to the Internet, even couldn't ping the gateway. I thought it might be I didn't set the GATEWAY in ifcfg-eno1.5, so I added the GATEWAY= local area network gateway), it didn't work.

Could anybody teach me how to create a VLAN interface in CentOS7, or tell me what' s wrong with my configuration, more detailed more better.

posted Apr 18, 2016 by Amit Parthsarthi

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button
How is your switch configured?

The CentOS configuration you described would only work when you set  GATEWAY, and when the port it's connected to has no VLANs configured for untagged access (or no VLANs that you need to access), and when the VLAN you DO need to access is tagged.

Are you providing access to one VLAN using tagged packets?

1 Answer

0 votes

Well, in CentOS 7 the default is to use NetworkManager (but you can go back to "classic" network style if you prefer though) and so nmcli can help you with that (assuming that you want to tag vlan 5 on eno1 :

nmcli con add con-name eno1.5 type vlan dev eno1 id 5 ip4 ""
nmcli con up eno1.5

(please note that the network name eno1.5 can be changed to what you want , and will be used as internal name in "nmcli con show")

More information in the nm doc :

answer Apr 18, 2016 by Deepankar Dubey
Similar Questions
+1 vote

After installation of Centos 7 I am not able to use /etc/rc/local file

Usually I used to add my script to /etc/rc.local

$ echo /usr/bin/bash /opt/ >> /etc/rc.local*

and it used to work but not with centos anymore.

0 votes

I m using centos 7 in laptop and kvm as virtualization to run windows guest VM. Currently I m using NAT as default setting for guest VM, my internet is fine but can't resolve some domains and sites.

So want to come on bridge.

As per my understanding bridge can not work while device is managed by NetworkManager.

Is there any utility or tool to use to scan wireless device in network and connect them as I want to stop to use Networkmanager to use laptop wireless interface as bridge for my guest VM.

Useful Links with Similar Problem
Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.