LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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-06-2018, 01:15 AM   #1
raheel35
LQ Newbie
 
Registered: Nov 2017
Posts: 5

Rep: Reputation: Disabled
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?
 
Old 02-06-2018, 11:17 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,685

Rep: Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972
Quote:
Originally Posted by raheel35 View Post
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.
 
Old 02-13-2018, 05:57 AM   #3
raheel35
LQ Newbie
 
Registered: Nov 2017
Posts: 5

Original Poster
Rep: Reputation: Disabled
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
 
Old 02-13-2018, 07:02 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,685

Rep: Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972
Quote:
Originally Posted by raheel35 View Post
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.
 
  


Reply

Tags
kernel, network bridge, vlan tagging



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] read function call returning more amount of data than wiritten using write function chakka.lokesh Programming 1 09-11-2014 03:14 AM
ip forwarding with iptables - double forwarding with openVPN?? sousacanfly Linux - Networking 8 01-20-2014 08:49 AM
[SOLVED] Threaded function cannot call a function with extern "C" but nonthreaded function can morty346 Programming 16 01-12-2010 05:00 PM
how to print function names & parmaters each time control enters the function? tanniru Linux - Networking 1 09-11-2008 01:21 AM
Simple Port Forwarding Firewall - not forwarding MadTurki Linux - Security 14 04-09-2006 12:08 PM

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

All times are GMT -5. The time now is 07:22 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