0

Earlier, I was trying to get traffic from one ethernet interface to another without using a bridge. Here is a link to the solution : https://stackoverflow.com/questions/26908439/c-program-to-receive-and-send-the-same-packets-out-over-another-interface . It is a simple application that reads from one interface and writes it blindly to the other interface.

(Laptop 1)<---------->[[{eth0} (LINUX PC) {eth1}]]<------------->(Laptop 2)

This is the basic diagram but we only need to keep the Linux PC with two interfaces in mind for now. Consider that I am trying to get traffic from eth0 to eth1. This application only works one way. If I try to run another instance of the application with the input and output interfaces reversed in the code, simultaneously, the packets go in a continuous loop. Hence, I cannot use this application for two way communication which is essential for ICMP Ping and TCP.

My guess is that I need to use IPTables and Netfilter nfqueue to help me simply get the traffic from one interface to another. I do not need any routing decisions and I cannot use the wonderful ethernet bridge (it's a secret why I can't). Consider simple UDP traffic and all systems on the same network (example : 192.168.1.xxx) if it makes it easier to explain.

I have already tried

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

and ipv4 forwarding is enabled in my file system. Let me know if you need any additional information.

6
  • Is it full duplex ? Half duplex ? Actually the loop your are describing is a livelock docs.oracle.com/javase/tutorial/essential/concurrency/… Nov 18, 2014 at 14:00
  • Communication has to be full duplex. In my question I asked if there is any way to forward traffic between interfaces without using my application or using a bridge . The application also introduces a huge bottleneck and the bandwidth reduces to a staggering 1/10th the original. I suspect the answer lies in using iptables / ebtables and not using the application.
    – anon_16
    Nov 19, 2014 at 4:50
  • Check this out serverfault.com/questions/453254/… Nov 19, 2014 at 9:30
  • That was interesting. I tried it out but it doesn't forward the packets.
    – anon_16
    Nov 19, 2014 at 10:38
  • how do you check ? ping ? Also when you say "it doesn't work" do you mean both ways ? Any other entry in iptables ? Nov 19, 2014 at 12:12

0

You must log in to answer this question.

Browse other questions tagged .