Lately, I have been working to configure a centos65 server to enable VLAN tagging, this server is going to act as VM Host (kvm). On the network-switch level, the ports were configured to enable tagging, with following setup

vlan_a -> native
vlan_b -> tagged 

The server has a single interface -> eth0. (configured in trunk mode)

So while experimenting with VLAN tagging on this server, I had the following setup

eth0 - pointing to native vlan  (
eth0.43 -pointing to tagged vlan ( 

I would restart network services to enable this configuration. The problem I faced with this setup was, the tagged interface would be pingable and reachable, but the interface pointing to native vlan, was not reachable. Upon further inspection of routing table, I noticed the following

Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface   U         0 0        0 eth0.43   U         0 0          0 eth0     U         0 0          0 eth0     U         0 0        0 eth0.43         UG        0 0        0 eth0.43

So here is my question

In a tagged VLAN setup (for a single interface) for Linux systems, is it default that only the tagged interface comes up with default gateway? What is the best way to ensure that untagged interface is accessible as well?

To further elaborate, I did add the default gateway for untagged interface (eth0) and there on it was pingable and accessible. But is that ok as a practice to add default gateways for multiple interfaces in this kind of setup?

I have read about alternatives like openvswitch and network namespaces.

What are the specific advantages I have in using alternatives like openvswitch and network namespaces vs traditionally configuring linux system to handle this


First off, your host shouldn't have to worry about vlans, but since we're here...

You can set the default gateway in /etc/sysconfig/network

A script you used to set the vlan interface probably replaced it from the standard GW for eth0.

A host has only one default GW.

I use Vyatta for my routing needs.

| improve this answer | |
  • Not quite sure, if this answers my query. If I am setting up a tagged interface in linux, I would include the corresponding IP, its subnet mask and gateway. I shall update the question with my ifcfg-scripts to be clearer – tw1stud Jan 8 '16 at 23:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.