802.1q VLAN HOWTO
Doing 802.1q
trunking to an Ethernet switch is really easy. I describe two methods - a
text only one for servers, and a GUI one for desktops.
The VLAN number that an interface uses always gets appended to the physical interface after a dot, so for instance an interface eth0 using VLAN number 99 would be called eth0.99. The instructions below all assume you want to connect to vlan 99 - change the number as required.
Server console method
Install the vlan package:
Load the 8021q kernel module:
Ensure that this module gets loaded after a reboot by adding to /etc/modules:
Configure the interface by editing /etc/network/interfaces:
and adding a stanza like this:
Then bring the interface up:
Desktop GUI method
Install the vlan package using Synaptic: System->Administration->Synaptic Package Manager
and search for and install the package 8021q.
The next bit has to be done from the command line.
Load the 8021q kernel module:
Ensure that this module gets loaded after a reboot by adding to /etc/modules:
Now we have to create a low-level interface that the network manager can see:
Now we can find eth0.99 in the GUI System->Administration0>Network and configure it how we want.
The VLAN number that an interface uses always gets appended to the physical interface after a dot, so for instance an interface eth0 using VLAN number 99 would be called eth0.99. The instructions below all assume you want to connect to vlan 99 - change the number as required.
Server console method
Install the vlan package:
Code:
sudo apt-get install vlan
Code:
sudo modprobe 8021q
Code:
sudo sh -c 'grep -q 8021q /etc/modules || echo 8021q >> /etc/modules'
Code:
sudo nano /etc/network/interfaces
Code:
auto eth0.99 iface eth0.99 inet static address 192.168.99.1 netmask 255.255.255.0
Code:
sudo ifup eth0.99
Install the vlan package using Synaptic: System->Administration->Synaptic Package Manager
and search for and install the package 8021q.
The next bit has to be done from the command line.
Load the 8021q kernel module:
Code:
sudo modprobe 8021q
Code:
sudo sh -c 'grep -q 8021q /etc/modules || echo 8021q >> /etc/modules'
Code:
vconfig add eth0 99
sumber : http://ubuntuforums.org/showthread.php?t=703387