VLAN

From Sidvind
Jump to: navigation, search

Prerequisites[edit]

Gentoo[edit]

 modprobe 8021q
 emerge -av net-misc/vconfig

Debian/Ubuntu[edit]

 modprobe 8021q
 apt-get install vlan

Configuration[edit]

Manual[edit]

 vconfig add eth0 2
 ifconfig eth0.2 10.0.2.1/24

where 2 is the VID.

Gentoo[edit]

Code: /etc/conf.d/net (view, download)

  1. vlans_eth0="1 2"
  2. config_vlan1="10.0.1.1 netmask 255.255.255.0"
  3. config_vlan2="10.0.2.1 netmask 255.255.255.0"

Debian/Ubuntu[edit]

Code: /etc/network/interfaces (view, download)

  1. auto eth0.1
  2. iface eth0.1 inet static
  3.         address 10.0.1.1
  4.         netmask 255.255.255.0
  5.         vlan-raw-device eth0
  6.  
  7. auto eth0.2
  8. iface eth0.2 inet static
  9.         address 10.0.2.1
  10.         netmask 255.255.255.0
  11.         vlan-raw-device eth0