0

I have setup raspberrypi zero w running raspbian as wifi router. I have PPPoE broadband connection. After setting up pppoeconf , hostapd & dnsmasq. I get this routing table ::

route -n

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         0.0.0.0         0.0.0.0         U     0      0        0 eth0
0.0.0.0         0.0.0.0         0.0.0.0         U     0      0        0 ppp0
10.1.0.1        0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0
192.168.43.0    0.0.0.0         255.255.255.0   U     0      0        0 wlan0

After executing :: sudo route add default gw 10.1.0.1 ppp0. Internet starts working. Routing table now becomes ::

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.1.0.1        0.0.0.0         UG    0      0        0 ppp0
0.0.0.0         0.0.0.0         0.0.0.0         U     0      0        0 eth0
0.0.0.0         0.0.0.0         0.0.0.0         U     0      0        0 ppp0
10.1.0.1        0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0
192.168.43.0    0.0.0.0         255.255.255.0   U     0      0        0 wlan0

So, I tried to set route add default gw 10.1.0.1 ppp0 command to run on boot. I added this to /etc/rc.local. Didn't work ; Then to /etc/network/interfaces. Didn't work ; To /etc/ppp/ip-up.d/0clampmss. Didn't work ; To sudo crontab -e . @reboot. Didn't work.

I did all this with /bin/ip route change default via 10.1.0.1 dev ppp0. But still it didn't work.

How do I set default gateway 10.1.0.1 ppp0 on boot so that I don't need to run it manually everytime ?

  • Do you get internet access if instead of adding a new default route you remove the already present eth0 default route? If yes, you'd better work towards getting rid of that in the first place. – Ferenc Wágner May 24 '18 at 10:57
  • 1
    You can only add the default route after the PPPoE connection is established. pppd has the option defaultroute for this (see man pppd), but I don't know how pppoeconf allows to set this option. So find whereever it stores the pppd options, and modify accordingly. – dirkt May 24 '18 at 11:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.