Ubuntu VLAN How-to
Filed under: Rants — Harvey @ 7:57 pm
After installing Ubuntu Linux on your computer, you probably want to download a bunch of packages from the Internet. The problem is that you are connected to a VLAN and Ubuntu doesn’t know how to talk to it right off of the installation CD. Fortunately, it’s pretty easy to set up. The only problem is that you need to install a utility that you can only get from the Internet. Here’s what you need to do.
Installing Kernel Support for Vlans
First you need to install the kernel module that supports IEEE 802.1q VLANS. The module for this is already present in the Ubuntu distribution so all you need to do is load it:
$ sudo modprobe 8021q
The VLAN Utility
Now you need the vlan utility to set up your network interface for VLAN operation. This utility is not on the Ubuntu distribution CD so you have to download it.
First, using an existing system such as your Windows desktop, go to the Debian vlan download page:
Debian -- Package Download Selection -- vlan_1.9-3_i386.deb
Select a mirror and download the .deb file. Then copy the .deb file to a thumb drive or a CD.
Now, put the CD or the thumb drive on the Ubuntu box. When the file browser window opens on the desktop, double click on the .deb file. The Ubuntu package manager will install it.
Edit the interfaces file
The file /etc/network/interfaces contains commands that are used to initialize the network interfaces. Commands from the vlan utility are used in this file to create the VLAN interfaces. Then the normal interface commands are used to initialize the vlan interface. Here is an example using a static IP address on eth2 with a VLAN number of 13:iface eth2 inet static
post-up vconfig add eth2 13
pre-down vconfig rem eth2.13
iface eth2.13 inet static
address 172.17.3.46
netmask 255.255.255.0
gateway 172.17.3.1
auto eth2.13
auto eth2
For more information about commands for the interfaces file type:
$ man 5 interfaces
After modifying the interfaces file, reboot the computer to initialize the vlan interface and set it’s IP address.
Add a route for the local subnet
In order to talk to computers that are on the same subnet you need to add a route that bypasses the vlan. Using the same interface, eth2, from the above example type the following to add the route:
$ sudo route add -net 172.17.3.0 netmask 255.255.255.0 dev eth2
Using DHCP Over a VLAN
If you don’t need a static IP address i.e. you just need to check your email or browse the Web, you simply configure the VLAN port for DHCP as follows: post-up vconfig add eth0.13
pre-down vconfig rem eth0.13
iface eth0.13 inet dhcp
iface eth0 inet static
address 0.0.0.0 netmask 255.255.255.255
auto eth0.13
auto eth0
credit :
nerd1951.com ป Ubuntu VLAN How-to
WARNING
| คำเตือน: นี่คือกระทู้เก่าแล้ว การสนทนานี้เป็นที่เก่ากว่า 90 วัน ข้อมูลที่ปรากฏอยู่ในนั้นอาจไม่เป็นปัจจุบัน | |
กระทู้อื่นๆล่าสุดในฟอรั่มเดียวกันนี้: