VLAN

From Alpine Linux
Revision as of 14:40, 10 May 2012 by Ncopa (talk | contribs) (Created page with "This article shows how to configure a network interface as an IEEE 802.1q VLAN trunk. {{Note| Alpine Linux v2.4 or later is required}} ==Installation== First, install the ''vlan...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This article shows how to configure a network interface as an IEEE 802.1q VLAN trunk.

Note: Alpine Linux v2.4 or later is required

Installation

First, install the vlan package. This will give you support for vlans in the /etc/network/interfaces file.

apk add vlan

Configuration

Edit the /etc/network/interfaces file:

auto eth0.8
iface eth0.8 inet static
	address 192.168.0.2
	netmask 255.255.255.0
	gateway 192.168.0.1

With the vlan package installed ifup will find the trailing .8 in eth0.8 and will create a vlan interface with vid 8 over eth0.

Alternative with vlan8 over eth0:

auto vlan8
iface vlan8 inet static
	address 192.168.0.2
	netmask 255.255.255.0
	gateway 192.168.0.1
	vlan-raw-device eth0

In those examples a static ip address was used but it works with dhcp as well.