0

I would like to use ebtables to perform the following 2 things without using bridge-utils

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.

SCENARIO II:

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.

I tried the following for scenario I

Still the packets are not getting forwarded from eth0 to eth1 and viceversa ebtables -A FORWARD -i eth1 -o eth0 -j ACCEPT ebtables -A FORWARD -i eth0 -o eth1 -j ACCEPT

2
  • yes i did the following, still the packets are not getting forwarded from eth0 to eth1 and viceversa ebtables -A FORWARD -i eth1 -o eth0 -j ACCEPT ebtables -A FORWARD -i eth0 -o eth1 -j ACCEPT
    – Syed Aslam
    Apr 1, 2015 at 14:27
  • Add this information to your question, please.
    – dawud
    Apr 1, 2015 at 14:59

0

You must log in to answer this question.

Browse other questions tagged .