1
So i'm trying to set up access over a hotspot to internet via a ppp0 interface (similar to a 4g dongle).
I've setup the default route with highest priority (Metric 1) for ppp0.
Set all iptable policies to ALLOW and enabled ip forwarding (as below) but I still cannot ping
ping -I eth2 8.8.8.8
Note that ping -I ppp0 8.8.8.8 works and also the default one (ping 8.8.8.8) goes over ppp0
Here is my configuration
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.16.172.175 0.0.0.0 UG 1 0 0 ppp0
0.0.0.0 192.168.0.1 0.0.0.0 UG 10 0 0 eth0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.82.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
# cat /proc/sys/net/ipv4/ip_forward
1
iptables -F
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P POSTROUTING ACCEPT
1You need to NAT or masquerade outgoing packets, otherwise they won't have a valid IP address to return to. – davidgo – 2019-11-23T23:28:00.113
That is correct. However I still don't have the pings going through
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
andiptables -A FORWARD -i eth2 -o ppp0 -m state --state RELATED,ESTABLISHED -j ACCEPT
andiptables -A PREROUTING -i eth2 -j ACCEPT
– Sorin C – 2019-11-25T10:04:05.027