Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 07-28-2005, 10:52 AM   #1
LQ Newbie
Registered: Mar 2005
Location: Calgary Alberta Canada
Posts: 22

Rep: Reputation: 15
Linux VLAN Trunk?

Can somebody tell me if this would work? And how one would go about it? I'm leaning 90% towards using managed switches, but this is intriguing to me none the less.


Take 2 linux servers and put 3 NICs in each one.

Connect the two linux servers on Eth0 (there can be a switch in between).

Connect eth1 on each server to a subnet ( and eth2 to another subnet (

Tag traffic on eth1 with VLAN1 and inbound traffic on eth2 at VLAN2.

Create a VLAN trunk between the two servers on eth0?

Would this work? Has anybody seen a howto anywhere?

Old 07-28-2005, 11:50 AM   #2
Registered: Jan 2005
Location: Cork Ireland
Distribution: Debian
Posts: 384

Rep: Reputation: 32

configuring the trunk is no problem: as soon as you configure two virtual interfaces in differnet vlans on the same real interface it becomes a trunk:
ifconfig eth0 up
vconfig add eth0 10
vconfig add eth0 20
ifconfig eth0.10
ifconfig eth0.20

the last two lines are only needed if you want to configure ip addresses, which may not be the case if your only building up a switch...

so here's a trunk on eth0

then, you put eth1 in vlan 10
ifconfig eth1 up
vconfig eth1 10
ifconfig eth1.10 up

then you put eth0.10 and eth1.10 in a bridge:
brctl addbr br10
brctl addif br10 eth0.10
brctl addif br10 eth1.10
ifconfig br10 up

(you can do the same with br20 including eth0.20 and eth2.20)

note that if you do this, you should configure ip addresses on the br10 and br20 interfaces instead of on eth0.10 and eth0.20.

note also that you'll need to enable the use of vlans in the kernel (802.1q option) and install the brctl and vconfig that do not come with most distro...

i already tried all this and it worked quite well. the problem i had concerned vlan tagging, which i do not know how you set up ! I already wrote a post about it, but i had no answer and i had no time to investigate further on (i was playing with vconfig for fun, not for work). So if anybody knows how to tag incomming packets, please say so !!!!!
1 members found this post helpful.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
trunk port in switch czezz Linux - Hardware 1 07-21-2005 02:34 AM
how to connect a gateway linux with vlan ? ctis78 Linux - Networking 2 03-25-2005 07:28 AM
Error trying to compile drm-trunk chozas Linux - Laptop and Netbook 0 08-30-2004 04:43 AM
Linux for VLAN ? newbieA Linux - Networking 1 09-13-2003 11:34 AM
Linux VLAN Nework Card support glock19 Linux - General 1 06-04-2002 09:05 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:34 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration