0

This is more or less a revival of: Forwarding traffic from one ethernet interface to another

Suppose the following setup.

.              15.15.1.11    15.15.1.12
.   A:eth0 --- eth0:B:xxx0 --- xxx0:C
. 15.15.0.10   15.15.0.11

Where A, B, and C are separate nodes, and xxx0 is some non-ethernet networking interface.

The following addresses and routings are assigned at each node:

A
ip addr add 15.15.0.10 dev eth0
ip route add 15.15.0.0/16 dev eth0

B
ip addr add 15.15.0.11 dev eth0
ip route add 15.15.0.0/24 dev eth0
ip addr add 15.15.1.11 dev xxx0
ip route add 15.15.1.0/24 dev xxx0

C
ip addr add 15.15.1.12 dev xxx0
ip route add 15.15.1.0/16 dev xxx0

At this point, from A or C, I am capable of pinging B via

ping 15.15.1.11
ping 15.15.0.11

From B, I can ping A or C.

ping 15.15.0.10
ping 15.15.1.12

However, I am unable to ping C from A or vice versa.

I've tried the following with no success:

echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -A FORWARD -i eth0 -o xxx0 -j ACCEPT
iptables -A FORWARD -i xxx0 -o eth0 -j ACCEPT
etryagain
  • 3
  • 1

1 Answers1

0

The problem is that you have told C that A is in a directly connected network. So when you try to ping A, C is attempting to use ARP to get the MAC address for A, and A never responds. Same is true for A.

May I recommend the following configurations instead:

A ip addr add 15.15.0.10/24 dev eth0 ip route add 15.15.1.0/24 via 15.15.0.11

B ip addr add 15.15.0.11/24 dev eth0 ip addr add 15.15.1.11/24 dev xxx0

C ip addr add 15.15.1.12/24 dev xxx0 ip route add 15.15.0.0/24 via 15.15.1.11

Note that all of the directly connected routes should be added automatically. Then you only need to tell A and C how to get to each other's networks via B.

Jeremy Dover
  • 318
  • 1
  • 6