Routing rules for eth1 eth0 are not respected [FRWY-LS1012A Board]

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Routing rules for eth1 eth0 are not respected [FRWY-LS1012A Board]

跳至解决方案
1,107 次查看
OzTheWizard
Contributor III

So I'm currently using 2x FRWY-LS1012A Board running LSDK 20.12 in set up as shown in figure below.

Multilink hop chart-Page-9.drawio.png

What I want to achieve is being able to ping device from left (Rpi3B) to right (Rpi4B). Routing tables are correctly configured and checked with mininet. I also appended routing rules of each of 4 devices in attachments. Green arrows mark ping actions that pass and red that don't, and they work exactly the same in opposite direction (right to left). 

Problem is I can't do what I want - ping from Rpi3B to Rpi4B (and vice versa). During "ping 192.168.10.150" from Rpi3B I used tcpdump to catch any icmp requests on Host A, and only got them on eth1 of Host A, but they didn't reach eth0 on Host A despite it should according to routing rules ("192.168.18.0/24 dev eth0 proto kernel scope link src 192.168.18.69").

Does anyone know why? Does it have sth to do with PFE? 

0 项奖励
回复
1 解答
1,101 次查看
OzTheWizard
Contributor III

I'll reply myself as I solved the problem. The problem does noting to do with device or LSDK, it is purely down to routing configuration and IP forwarding.

On Host A first add a routing rule for gateway via which 192.168.10.0 subnet can be reached:

 

sudo ip route add 192.168.10.0/24 via 192.168.18.70

 

On Host B first add a routing rule for gateway via which 192.168.11.0 subnet can be reached:

 

sudo ip route add 192.168.11.0/24 via 192.168.18.69

 

On host A and B enable ip forwarding and set forwarding rule between eth0 and eth1:

echo 1 > /proc/sys/net/ipv4/ip_forward
sudo iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
sudo iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT

 ..and that would be it.

在原帖中查看解决方案

标记 (1)
0 项奖励
回复
1 回复
1,102 次查看
OzTheWizard
Contributor III

I'll reply myself as I solved the problem. The problem does noting to do with device or LSDK, it is purely down to routing configuration and IP forwarding.

On Host A first add a routing rule for gateway via which 192.168.10.0 subnet can be reached:

 

sudo ip route add 192.168.10.0/24 via 192.168.18.70

 

On Host B first add a routing rule for gateway via which 192.168.11.0 subnet can be reached:

 

sudo ip route add 192.168.11.0/24 via 192.168.18.69

 

On host A and B enable ip forwarding and set forwarding rule between eth0 and eth1:

echo 1 > /proc/sys/net/ipv4/ip_forward
sudo iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
sudo iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT

 ..and that would be it.

标记 (1)
0 项奖励
回复