Bering-uClibc 7.x - User Guide - IPv4 Networking - Configure 802.1Q VLANs

From bering-uClibc
Jump to: navigation, search
IPv4 Networking - Configure 802.1Q VLANs
Prev Bering-uClibc 7.x - User Guide


Objectives

IEEE 802.1Q defines a standard for VLAN tagging. If your network switch hardware supports VLANs but does not manage routing between VLANs a Bering-uClibc 7.x router can be used to do that.

One option is to install multiple physical network connections from separate Network Interface Cards to separate switch ports, with each connection carrying the traffic for an individual VLAN.

An alternative option is to configure one switch port for "tagged" traffic for several VLANs and to use a single physical connection to carry all of the traffic, subject to any bandwidth constraints imposed by using a single physical interface.

Modules

The 8021q.ko.gz kernel Module is required. This is included as standard in Bering-uClibc 7.x - listed in /etc/modules and hence loaded at boot time.

Configuration

Configuration is quite simple. In file /etc/network/interfaces the default entry for interface eth1 looks like this:

auto eth1
iface eth1 inet static
        address 192.168.1.254
        netmask 255.255.255.0
        broadcast 192.168.1.255

To use tagged VLANs instead, replace those lines with something like the following:

auto eth1.123
iface eth1.123 inet static
        address 192.168.1.254
        netmask 255.255.255.0
        broadcast 192.168.1.255
        vlan_raw_device eth1

Note in particular the following:

  • The interface is specified as eth1.123. The "123" is the VLAN ID.
  • The vlan_raw_device configuration entry specifies which physical or "raw" interface carries this traffic.

Additional similar configuration blocks can be added to define additional VLANs on the same physical interface.

If eth1 is also carrying "untagged" traffic, then the default entry for eth1 (no suffix) should be retained.


Prev Up