LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   L2 Forwarding function (https://www.linuxquestions.org/questions/linux-networking-3/l2-forwarding-function-4175623166/)

raheel35 02-06-2018 01:15 AM

L2 Forwarding function
 
Hi, how can I develop L2 Forwarding function in linux? I have to add and remove VLAN Tags for traffic of user coming to and from untagged vlan. Is there a way to do this?

TB0ne 02-06-2018 11:17 AM

Quote:

Originally Posted by raheel35 (Post 5816291)
Hi, how can I develop L2 Forwarding function in linux? I have to add and remove VLAN Tags for traffic of user coming to and from untagged vlan. Is there a way to do this?

Yes, there are many. Read the "Question Guidelines" link in my posting signature; doing basic research (i.e. searching) should be done before posting. Just putting "l2 forwarding linux" into Google pulls up MANY hits, several from this very site:
https://goyalankit.com/blog/linux-bridge
https://wiki.debian.org/BridgeNetwor...ctionsProxyArp

You can 'develop' something by writing a program. But you say nothing about the language you want to use, network environment, goals, etc. Without details all you can hope for is a generic answer.

raheel35 02-13-2018 05:57 AM

Thank you for reply. I am using embedded Linux system so bash scripting or C language is preferable. What i want to do is that Packets coming from Client1 bridged to lets say eth0 having bridged interface br-wan. I have one VLAN eth0.2 having bridged interface br-vlan_2. What i want dynamically is that whenever any packet from Client1 coming to br-wan should go to br-vlan_2 and out by tagged 2. In reply that packet will come to br-vlan_2 so it will passed it to br-wan so that it can again reach it to the client1 via br-wan. I have read your links but not able to achieve this. Though i got idea from ebtables but didnt able to achieve it. Any suggestions in this regard?

Thanks

TB0ne 02-13-2018 07:02 AM

Quote:

Originally Posted by raheel35 (Post 5819248)
Thank you for reply. I am using embedded Linux system so bash scripting or C language is preferable. What i want to do is that Packets coming from Client1 bridged to lets say eth0 having bridged interface br-wan. I have one VLAN eth0.2 having bridged interface br-vlan_2. What i want dynamically is that whenever any packet from Client1 coming to br-wan should go to br-vlan_2 and out by tagged 2. In reply that packet will come to br-vlan_2 so it will passed it to br-wan so that it can again reach it to the client1 via br-wan. I have read your links but not able to achieve this. Though i got idea from ebtables but didnt able to achieve it. Any suggestions in this regard?

Yes; write your code to perform whatever task you want. Not sure what 'suggestions' anyone can give you past that, since YOU are the software developer.

JJJCR 02-14-2018 03:31 AM

check out links below, it might give you some ideas.

https://www.kernel.org/doc/Documenta...orking/vrf.txt

https://github.com/torvalds/linux/bl...orking/vrf.txt

https://www.netfilter.org/documentat...king-HOWTO.txt

http://www.citi.umich.edu/u/provos/p...cnet-spoof.txt


All times are GMT -5. The time now is 08:45 AM.