Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 03-31-2015, 05:55 AM   #1
LQ Newbie
Registered: Mar 2015
Posts: 3

Rep: Reputation: Disabled
ebtables to setup Forwarding and ethernet level NAT!

I would like to use ebtables to perform the following 2 things:

SCENARIO I: I would like to forward all the packets received from eth0 interface onto the eth1 interface. Similarly would like to forward all the reverse packets received from eth1 interface onto the eth0 interface without changing anything.


I would like to setup a NAT where eth0 is the external interface and eth1 is the internal interface where all the packets received on eth1 is forwarded to the external eth0 interface with the eth0 mac address replacing the internal network mac address and vice versa.

At IP level i can do the same like shown below:

/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

/sbin/iptables -A FORWARD -i eth0 -o eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT

/sbin/iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT

I would like to achieve this same scenario at ethernet level?

Kindly help me out for both the above scenarios.
Old 03-31-2015, 02:23 PM   #2
Senior Member
Registered: Apr 2009
Posts: 1,861

Rep: Reputation: 162Reputation: 162
ebtables -A FORWARD -i eth0 -o eth1 -j ACCEPT, for SCENARIO I.
Old 03-31-2015, 02:28 PM   #3
LQ Newbie
Registered: Mar 2015
Posts: 3

Original Poster
Rep: Reputation: Disabled
Yes I did exactly the same to forward all the traffic from eth0 to Eth1
Still when I check in wire shark when paxkets come on eth0 it does not get copied onto eth1

Can u come if you can forward the paxkets using ebtables without using bridge-utils at all?
Old 04-01-2015, 02:34 PM   #4
Senior Member
Registered: Apr 2009
Posts: 1,861

Rep: Reputation: 162Reputation: 162
The ebtables program is a filtering tool for a Linux-based bridging firewall. It enables transparent filtering of network traffic passing through a Linux bridge.
You has to use bridge mode to make ebtables work.


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] Fedora ebtables not forwarding traffic Lantzvillian Linux - Networking 0 10-23-2012 07:06 PM
NAT/ip forwarding issues Poedersuiker Linux - Networking 8 12-19-2010 10:14 AM
Ethernet bridging & iptables. Is ebtables needed also? utahnix Linux - Networking 4 04-21-2008 10:38 AM
X11 forwarding + NAT technopasta Linux - Networking 9 05-28-2007 06:49 AM
NAT forwarding kermitthefrog91 Linux - Networking 4 08-04-2005 03:26 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:57 AM.

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