![]() |
HowTo.UseVLANsOnTheSlug HistoryHide minor edits - Show changes to markup July 16, 2005, at 01:17 AM
by -- minor spelling corrections
Changed lines 5-6 from:
VLANs is a way to let multiple logical (virtual) networks share the same physical network. It is not the same as WLAN - Wireless LAN - and has noting to do with it. to:
VLANs is a way to let multiple logical (virtual) networks share the same physical network. It is not the same as WLAN - Wireless LAN - and has nothing to do with it. Changed lines 86-88 from:
Thats is! to:
That's it! July 12, 2005, at 04:58 PM
by --
Added lines 1-101:
This page is supposed to give a quick overview of VLANs, and give a few examples of using them on OpenSlug. If you want more complete information look at External links at the bottom. What are VLANs?VLANs is a way to let multiple logical (virtual) networks share the same physical network. It is not the same as WLAN - Wireless LAN - and has noting to do with it. When using VLANs you can configure a switch, or multiple switches, to have tagged 'trunk' ports that carry multiple VLANs. With the correct software on Linux you can setup the VLANs as virtual interfaces. All this requires using 802.1q vlan capable switches, and those are unfortunately quite expensive. Why would you want VLANs?For example routing between several networks, with a single network cable and interface. If you want lots of Ethernet interfaces, and using lots of USB network adapters seems like a bad idea. VLANs are often used on larger networks to separate different parts of the network to increase security and simplify management. How?You have to have VLANs setup on your switch, and make the slug port trunked. How to setup that is out of scope for this page. A small tip is setting the native vlan on the port (sometimes called PVID) to a VLAN you can access the slug on. The required packages are available in the OpenSlug monotone repository. They are available in the unstable feed, and might reach stable sometime. You need a kernel module called 8021q, available in the package kernel-image-8021q. You also need the userspace program vconfig to set up vlans, available in the package vlan. So: When you have them installed you need to setup the VLANs you want to use. First modprobe the 8021q modules: modprobe 8021q Then use vconfig to setup your VLANs: vconfig add eth0 10 # Public VLAN Now you just have to set IP addresses on the created interfaces: ifconfig eth0.10 192.168.8.1 netmask 255.255.248.0 Making it permanentSo far all we have done goes away on reboot (and that is a good thing when testing), so when we have something working we have to make it permanent. This can of course be made in lots of ways, but this is what I recommend. Create a file in /etc/init.d with the commands you need: cat > /etc/init.d/vlan Make the file executable by running: chmod +x /etc/init.d/vlan Now, to make that run after eth0 is up add the line "up /etc/init.d/vlan" in /etc/network/interfaces like this: iface eth0 inet static Thats is! External linksLinux Journal - VLANs on Linux Wikipedia - VLAN Wikipedia - 802.1q 802.1Q VLAN implementation for Linux |