LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-17-2015, 09:23 AM   #1
hosselausso
LQ Newbie
 
Registered: Feb 2015
Posts: 2

Rep: Reputation: Disabled
Vlan tagging through a bridge to a VM


Hi,

I want to create a guest VM with a single bridge (br0) and I want it to talk untagged traffic and tagged traffic using vlans 11 and 22. The subnets are:
· 192.168.0.0/24 untagged
· 192.168.11.0/24 tag 11
· 192.168.22.0/24 tag 22

From the Host where I create the VM, I use the following commands to create the bridge.
--------------------------------------------------
ip link add name eth1.11 link eth1 type vlan id 11
ip link set eth1.11 up
ip link add name eth1.22 link eth1 type vlan id 22
ip link set eth1.22 up

brctl addbr br0
brctl addif br0 eth1
brctl addif br0 eth1.11
brctl addif br0 eth1.22

ip addr add 192.168.0.100/24 broadcast 192.168.0.255 dev br0
ip addr add 192.168.11.100/24 broadcast 192.168.11.255 dev br0 label br0:11
ip addr add 192.168.22.100/24 broadcast 192.168.22.255 dev br0 label br0:22

--------------------------------------------------

So far, everything ok. I can ping other IPs in vlans 11 and 22 from that bridge (e.g. ping -I br0 192.168.11.3) and also untagged network (e.g. ping -I br0 192.168.0.5).

Then I use that br0 to create a VM. That VM has eth0 and I create eth0.11 and eth0.22 and assign IPs to the 3 interfaces. The VM can ping the untagged network but not the tagged ones.

What am I missing?

Last edited by hosselausso; 02-17-2015 at 09:29 AM.
 
Old 02-18-2015, 09:19 AM   #2
hosselausso
LQ Newbie
 
Registered: Feb 2015
Posts: 2

Original Poster
Rep: Reputation: Disabled
I will answer to my own question.

I fix it by creating the vlan interfaces at the bridge level, not at the physical interface level:

--------------------------------------------------
brctl add br0
brctl add eth1

ip link add name br0.11 link br0 type vlan id 11
ip link add name br0.22 link br0 type vlan id 22

ip addr add 192.168.0.100/24 broadcast 192.168.0.255 dev br0
ip addr add 192.168.11.100/24 broadcast 192.168.11.255 dev br0.11
ip addr add 192.168.22.100/24 broadcast 192.168.22.255 dev br0.22
--------------------------------------------------

And inside the VM also I create the vlan interfaces and then I do tagging from the VM which is what I wanted.
 
  


Reply


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
vlan tagging with bonding not reaching gateway pat_33 Linux - Networking 2 01-31-2011 09:25 AM
Lenny Debian VLAN tagging Q Allanon_TB Linux - Networking 1 05-30-2010 08:12 AM
802.1Q vlan tagging help td3201 Linux - Networking 1 09-23-2009 06:39 PM
Catalyst 2924, DMZ and VLAN Tagging metallica1973 Linux - Networking 28 02-22-2008 07:14 AM
VLAN Tagging and Cisco 2924XL EN questions metallica1973 Linux - Networking 4 01-29-2008 12:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:19 PM.

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