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 04-06-2014, 11:03 AM   #1
pcCoder
LQ Newbie
 
Registered: Apr 2014
Posts: 24

Rep: Reputation: Disabled
Untagged vlan sub-interface


Is it possible to create a direct sub-interface for untagged traffic? I've got several reasons I'd like to be able to do this. I found that it is possible using kernel 3.13 and the latest iproute "bridge" command to achieve the same affect but with a lot of work:

Create a bridge on the interface (eth0 - br0)
Code:
ip link add dev br0 type bridge
ip link set dev eth0 master br0
Enable vlan filtering for the bridge
Code:
echo 1 > /sys/class/net/br0/bridge/vlan_filtering
Assign the desired interfaces to each, specifying which are untagged on eth0
Code:
bridge vlan add dev eth0 vid 1 pvid untagged
bridge vlan add dev eth0 vid 99
bridge vlan add dev br0 vid 1 self
bridge vlan add dev br0 vid 99 self
Create VLAN subinterface on the bridge device for both the tagged and untagged VLANs
Code:
ip link add link br0 name br0.1 type vlan id 1
ip link add link br0 name br0.99 type vlan id 99
I'm wondering if there is any way to do this without all that. Is there a way I can simply tell eth0 to treat all incoming untagged traffic as a certain VLAN, and for any outgoing traffic on a certain VLAN to be untagged, and create the subinterface directly on it (eth0.1 for untagged VLAN 1, eth0.99 for tagged VLAN 99)
 
Old 04-09-2014, 03:30 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
if traffic is untagged then there IS no vlan relevant to it, and given that eth0.x interface will relate to awareness of vlan x it makes no sense to refer to an untagged vlan id.It only comes in at the bridging stage as that's where you can join tagged and untagged zones together, like a conventional switch does. If incoming untagged traffic doesn't go anywhere else inside the box, then the concept of it being associated to a vlan holds no water.

for the eth0 interface I'd just connect that to a suitable bridge that corresponds to the appropriate vlan number, e.g. br1 and then, for example, make a vlan aware port on eth1, eth1.1 and put that in the same bridge. there untagged traffic on eth0 would be bridged to eth1.1 with 802.1q tags
 
Old 04-09-2014, 12:06 PM   #3
pcCoder
LQ Newbie
 
Registered: Apr 2014
Posts: 24

Original Poster
Rep: Reputation: Disabled
Thanks for the response. I'm mainly just playing around with some ideas.

1. The ability to put down the untagged interface without affecting the other interfaces. In the bridged example above, I can put down br0.1 without affecting br0.99, but with the VLAN interfaces directly on eth0, If I put down eth0, then I think it would affect eth0.99 as well.

2. I was experimenting around with the idea of VLAN mapping/translation using two NICs and connecting different VLAN interfaces together (ie eth0.2 <-> eth1.12, eth0.3 <-> eth1.19, etc). Using the bridging example, I can also connect untagged interfaces as well. If the VLAN interfaces are directly on eth0/eth1, then I can't do any mapping of the untagged traffic.

Code:
                                          /- br0.1 <-br16-> br1.6 -\ 
eth0 (1 untagged, 2, 3) <-> br0 (1, 2, 3) -- br0.2 <-br29-> br1.9 -- br1 (4, 6, 9) <-> eth1 (4 untagged, 6, 9)
                                          \- br0.3 <-br34-> br1.4 -/
Such a situation in theory would translate:
  • eth0 untagged to eth1 VLAN 6
  • eth0 VLAN 2 to eth1 VLAN 9
  • eth0 VLAN 3 to eth1 untagged

Again I'm just playing around with some crazy ideas. I can't really imagine any need for the second idea there. The first idea is more likely, putting down the "untagged" interface without affecting other interfaces, and can still be achieved by using the method I did in the first post.
 
  


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
[SOLVED] Creating a VLAN interface on top of another VLAN interface jbbroccard2 Linux - Networking 1 05-22-2013 02:25 AM
mix tagged(vlan) and untagged traffic. Steviepower Linux - Networking 5 04-27-2012 10:17 AM
Route non-vlan packet to a vlan interface mic.sed Linux - Networking 2 04-23-2010 03:39 AM
Help in Vlan-Interface Paris Heng Linux - Networking 1 03-02-2009 06:20 PM
Using tcpdump on a sub-interface vlan mikeotieno Linux - Networking 3 09-24-2008 02:32 PM

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

All times are GMT -5. The time now is 07:15 AM.

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