I've a Debian machine with this network scenario:
- eth0 - Internet Connection via local Router (172.20.1.x)
- ppp0 - Dial-up to a network without internet (10.x.x.x)
I've set pppd so it won't add any default routes to my routing table and my routing table looks like this after booting up the system:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 172.20.1.1 0.0.0.0 UG 0 0 0 eth0
10.64.64.64 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
172.20.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
With this configuration I'm able to ping google.com, however I can't get to any machine with IP's like 10.0.0.1 or 10.0.0.2 etc...
Trying to fix this (with my poor knowledge) I modified my /etc/network/interfaces
file to:
auto lo
iface lo inet loopback
iface eth0 inet dhcp
auto ppp0
iface ppp0 inet ppp
pre-up sleep 5
provider vfp
post-up /sbin/route add -net 10.0.0.0 netmask 255.0.0.0 gw 10.64.64.64
pre-down /sbin/route del -net 10.0.0.0 netmask 255.0.0.0 gw 10.64.64.64
But apparently the command post-up /sbin/route add -net 10.0.0.0 netmask 255.0.0.0 gw 10.64.64.64
that should add the route to make it work is not taking effect—nothing is changing on the routing table.
What am I missing? / How can I fix this? Thank you ;)
PS: If i run route add -net 10.0.0.0 netmask 255.0.0.0 gw 10.64.64.64
after the system boots up I'm able to ping both google.com and 10.0.0.1 from the system.