I'm trying to connect two LANs using a ppp link. I had a basic network topology diagram but it didn't come out well. This can be seen here.
Routing Problem ================ 172.20.0.0/16 192.168.2.0/24 eth1 +-----------------+ eth0 172.20.0.1 |======| Ubuntu |======| 192.168.2.231 | | | Router |======| 192.168.254.253 192.168.254.254 |=====> To: 172.30.0.0/16 +-----------------+ ppp0
All computers in the 172.20.0.0/16 subnet can access the internet via eth0. All devices on the 172.20.0.0/16 subnet use 172.20.0.1 as their gateway. When I ping any device on the 172.30.0.0/16 subnet from a device on the 172.20.0.0/16 subnet, I see that nothing is getting across from eth1 to ppp0. The way I tested this was by pinging from a device on the 172.20.0.0/16 subnet(
ping -s 10240 172.30.0.9 ) and checking all three interfaces on the router using tcpdump(
tcpdump -vv -x -X -s 1500 -i eth1 ). I'm not seeing any ICMP packets on any of these interfaces. I suspect the problem is with iptables.
Configurations on the Ubuntu Router looks like this:
ip route show default via 192.168.2.1 dev eth0 172.20.0.0/16 dev eth1 proto kernel scope link src 172.20.0.1 172.30.0.0/16 dev ppp0 scope link 172.30.0.0/16 via 192.168.250.254 dev ppp0 192.168.2.0/24 dev eth0 proto kernel scope link src 192.168.2.231 192.168.250.254 dev ppp0 proto kernel scope link src 192.168.250.253 cat /proc/sys/net/ipv4/ip_forward 1 cat /proc/sys/net/ipv4/conf/ppp0/forwarding 1 cat /proc/sys/net/ipv4/conf/eth0/forwarding 1 cat /proc/sys/net/ipv4/conf/eth1/forwarding 1 iptables --list-rules -P INPUT ACCEPT -P FORWARD ACCEPT -P OUTPUT ACCEPT -A FORWARD -i eth1 -o eth0 -j ACCEPT -A FORWARD -i eth0 -o eth1 -j ACCEPT -A FORWARD -i eth1 -o ppp0 -j ACCEPT -A FORWARD -i ppp0 -o eth1 -j ACCEPT iptables -t nat --list-rules -P PREROUTING ACCEPT -P INPUT ACCEPT -P OUTPUT ACCEPT -P POSTROUTING ACCEPT -A PREROUTING -d 192.168.250.254/32 -j DNAT --to-destination 172.30.0.1 -A POSTROUTING -o eth1 -j SNAT --to-source 172.20.0.1
I should add I've tried many different combinations of iptables rules, as well as trying different routing options.