pppd and routing table

Starting and stopping pppd changes my routing table, I wonder if this is
correct behavior. I am running tiny TCP.
In the /etc/ppp/options file, I had set “defaultroute”, so when the pppd
is up and running, the default route is set to ppp’s. However, when I
stopped the pppd, it took the default route away without restoring my
original default route. Is this the correct behavior or it’s a bug of
pppd.

It got worse if after pppd is started, I added a specific route

ppp0 : addr 192.168.2.39 netmask 255.255.255.0 up
en0 : addr 192.168.2.45 netmask 255.255.255.0 up
lo0 : addr 127.0.0.1 netmask 255.0.0.0 up

DST: 192.168.2.27 NETMASK: 255.255.255.255 GATEWAY: 192.168.2.1
DST: 192.168.2.38 NETMASK: 255.255.255.255 GATEWAY: ppp0
DST: 127.0.0.0 NETMASK: 255.0.0.0 GATEWAY: lo0
DST: 0.0.0.0 NETMASK: 0.0.0.0 GATEWAY: 192.168.2.38

When I stopped the pppd, it took default gateway away, and also the
specific route I added. In this scenario, only left with loopback in the
routing table.

Is there something that I need to do to get around this?

Thanks,
-Beth

Well, pppd don’t remember and reset your orignal default route.
It sort of take “defaultroute” means you don’t have a default route
right now. You have the option to NOT use “defaultroute” option
though.

If you really want to “switch default route”, you will have to play
with the scripts pppd execute. To save/restore the default route
yourself. (And since you use tiny stack, no, you can’t use route
utility; you have to write your own program to do that).

I am not sure why your specific route also took away though…

-xtang

Beth <id@address.com> wrote in message news:3EA6106A.4CCAE1EB@address.com

Starting and stopping pppd changes my routing table, I wonder if this is
correct behavior. I am running tiny TCP.
In the /etc/ppp/options file, I had set “defaultroute”, so when the pppd
is up and running, the default route is set to ppp’s. However, when I
stopped the pppd, it took the default route away without restoring my
original default route. Is this the correct behavior or it’s a bug of
pppd.

It got worse if after pppd is started, I added a specific route

ppp0 : addr 192.168.2.39 netmask 255.255.255.0 up
en0 : addr 192.168.2.45 netmask 255.255.255.0 up
lo0 : addr 127.0.0.1 netmask 255.0.0.0 up

DST: 192.168.2.27 NETMASK: 255.255.255.255 GATEWAY: 192.168.2.1
DST: 192.168.2.38 NETMASK: 255.255.255.255 GATEWAY: ppp0
DST: 127.0.0.0 NETMASK: 255.0.0.0 GATEWAY: lo0
DST: 0.0.0.0 NETMASK: 0.0.0.0 GATEWAY: 192.168.2.38

When I stopped the pppd, it took default gateway away, and also the
specific route I added. In this scenario, only left with loopback in the
routing table.

Is there something that I need to do to get around this?

Thanks,
-Beth