How to route between interfaces
Clash Royale CLAN TAG #URR8PPP up vote 0 down vote favorite I have the following setup: (192.168.4.1) Device A <-------> device B <-------> Device C (192.168.5.84) (192.168.5.1) (192.168.4.5) Device B actually has an wifi interface ( wlan0 = 192.168.4.1 ) on which an dhcp server is running. Then there is an cables interface ( eth0 = 192.168.5.1 ). What I want to reach is that devices A and C can talk to each other. I have been reading how to get to this result and I have found that I should use routing to accomplish this. I have tried some things and I do not understand why it is not working. Device A has an static ip (subnet 255.255.255.0 and gateway 192.168.5.1 ). Device C received an ip from the DHCP server (subnet 255.255.255.0 and gateway 192.168.4.1 ). What I have done: On device B I have set enabled the ipforward in /etc/sysctl Added routing: iptables -A FORWARD -i eth0 -o wlan0 -s 192.168.5.0/24 -d 192.168.4.0/24 -j ACCEPT iptables -A FORWARD -i ...