Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
03-06-2013, 03:50 PM
|
#1
|
LQ Newbie
Registered: Mar 2013
Posts: 3
Rep: 
|
Changing Linux Layer2 forwarding decision?
Are there tools to define in Linux something similar to Policy-based Routing, but on Layer2 level? Usual Linux bridge uses destination MAC to decide, which interface to send frame to. Can this behavior be altered?
Let's say we have a machine with several interfaces - physical, virtual, VLAN-tagged subinterfaces, etc. A frame arrives at one of them. Can we decide, which outgoing interface the frame will be delivered to, according to parameters such as VLAN tag in the frame, source MAC address, source interface, 802.1p priority, etc.?
|
|
|
03-07-2013, 09:36 AM
|
#2
|
Member
Registered: Feb 2008
Distribution: Fedora,RHEL,Ubuntu
Posts: 661
Rep:
|
Hello ,
You can use ebtables .
Thanks
|
|
|
03-08-2013, 06:05 PM
|
#3
|
LQ Newbie
Registered: Mar 2013
Posts: 3
Original Poster
Rep: 
|
Thanks, vishesh, I read about ebtables, but I haven't found a way how to set them to modify forwarding decision of a bridge or make Linux to push frames to specific interface. All I've found is how to _filter_ the traffic.
Do you have an idea, how ebtables may be used in this fashion?
|
|
|
03-08-2013, 06:16 PM
|
#4
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
Linux does support VLANs (IEEE 802.11Q). You need to have the the needed kernel modules loaded and configure the bridge devices.
Here is a good article about it from Linux Journal a couple years back:
http://m.linuxjournal.com/article/10821
It includes a contrived example of a firewall with just one interface.
Last edited by jschiwal; 03-08-2013 at 06:20 PM.
|
|
|
03-08-2013, 07:12 PM
|
#5
|
LQ Newbie
Registered: Mar 2013
Posts: 3
Original Poster
Rep: 
|
The link appears to be broken.
Anyway, I know about 802.1q and actually use it in my config. But how does it help me in this case?
My setup looks like this:
* There are several KVM guests with virtual interfaces vnet1, vnet2, etc. These VMs send traffic, which is already VLAN-tagged.
* There are several VLAN-tagged sub-interfaces on the hypervisor: eth1.X, eth1.Y, etc.
* Bridges are used to switch frames between vnets and tagged sub-interfaces - for example, bridge1 unites vnet1, vnet2 and eth1.X.
* So when a guest VM sends frame on its vnet with VLAN tag N, then it's transmitted over physical interface eth1 with two tags: external (X) and internal (N).
* My aim is this: to make external tag be chosen according to the range of internal tags. For example, if N is in [501:600], then frame would be pushed to eth1.X, and the frame will be double-tagged by X:N. Otherwise - by Y:N.
Is there a way to achieve that?
|
|
|
03-13-2013, 07:29 AM
|
#6
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
QinQ is used for trunking, to wrap your traffic through a trunk which has its own vlan.
A vlan is associated with a particular virtual device so you can use the device e.g. -i eth0.15 in an iptables rule. (I did see an -vlan argument in a thread once, but don't know if it's valid. ).
I don't see why you don't match vlan id's on the hypervisor with the ones on the VMs. From your description, it seems as if you have 10 times the vlans as VMs.
There is also arptables and ebtables. Which might be useful.
Try this link again:
http://www.linuxjournal.com/article/10821
It worked when I checked.
Last edited by jschiwal; 03-13-2013 at 07:40 AM.
|
|
|
All times are GMT -5. The time now is 06:42 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|