Difference between revisions of "VLAN"

From ArchWiki
Jump to: navigation, search
m (Getting Started)
m (fixed howtos category misspelling)
Line 1: Line 1:
 
{{i18n|VLAN}}
 
{{i18n|VLAN}}
[[Category:HowTo]]
+
[[Category:HOWTOs]]
 
[[Category:Networking (English)]]
 
[[Category:Networking (English)]]
  
Line 10: Line 10:
  
 
==Introduction==
 
==Introduction==
Virtual LANs give you the ability to sub-divide a LAN. Linux can accept VLAN tagged traffic and presents each VID as a different network interface (eth0.100 for VID 100)
+
Virtual LANs give you the ability to sub-divide a LAN. Linux can accept VLAN tagged traffic and presents each VID as a different network interface (eg: eth0.100 for VID 100)
 
==Getting Started==
 
==Getting Started==
Previously Arch Linux used vconfig to setup VLANs. This had been superseded by the ip command. Make sure you have iproute2 installed<br>
+
Previously Arch Linux used '''vconfig''' to setup VLANs. This had been superseded by the ip command. Make sure you have '''iproute2''' installed<br>
 
  # pacman -Ss iproute2
 
  # pacman -Ss iproute2
 
Alternatively you can install [https://aur.archlinux.org/packages.php?ID=20495 vconfig] from [[AUR]]
 
Alternatively you can install [https://aur.archlinux.org/packages.php?ID=20495 vconfig] from [[AUR]]
Line 22: Line 22:
 
Example:
 
Example:
 
  ip link add link eth0 name eth0.100 type vlan id 100
 
  ip link add link eth0 name eth0.100 type vlan id 100
Run ifconfig -a to confirm that it has been created. This interface behaves like a normal interface. All traffic routed to it will go through the master interface (in this example, eth0) but with a VLAN tag. Only VLAN aware devices can accept them if configured correctly else the traffic is dropped.<br>
+
Run '''ifconfig -a''' to confirm that it has been created. This interface behaves like a normal interface. All traffic routed to it will go through the master interface (in this example, eth0) but with a VLAN tag. Only VLAN aware devices can accept them if configured correctly else the traffic is dropped.<br>
 
Using a name like eth0.100 is just convention and not enforced. You can alternatively use eth0_100 or something descriptive like IPTV
 
Using a name like eth0.100 is just convention and not enforced. You can alternatively use eth0_100 or something descriptive like IPTV
 
===Removing a VLAN===
 
===Removing a VLAN===

Revision as of 09:04, 27 May 2011

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

Summary help replacing me
VLAN
Related
Network

Introduction

Virtual LANs give you the ability to sub-divide a LAN. Linux can accept VLAN tagged traffic and presents each VID as a different network interface (eg: eth0.100 for VID 100)

Getting Started

Previously Arch Linux used vconfig to setup VLANs. This had been superseded by the ip command. Make sure you have iproute2 installed

# pacman -Ss iproute2

Alternatively you can install vconfig from AUR

Configuring VLANs

Adding a VLAN

To add a VLAN use a command with this needlessly long syntax:

ip link add link INTERFACE name INTERFACE.VID type vlan id VID

Example:

ip link add link eth0 name eth0.100 type vlan id 100

Run ifconfig -a to confirm that it has been created. This interface behaves like a normal interface. All traffic routed to it will go through the master interface (in this example, eth0) but with a VLAN tag. Only VLAN aware devices can accept them if configured correctly else the traffic is dropped.
Using a name like eth0.100 is just convention and not enforced. You can alternatively use eth0_100 or something descriptive like IPTV

Removing a VLAN

Removing a VLAN interface is significantly less convoluted

ip link delete INTERFACE.VID

VLANs at boot

n/t