Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Faulty Routing Table with PPPoE

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
Guest

Faulty Routing Table with PPPoE

#1 Post by Guest »

Hi all,

I am trying to connect a Hard-Disk-installed Knoppix (which is said to be a true Debian unstable/testing) via PPPoE / DSL. The system acts as a router for a private local network. DSL is connected via eth1 / ppp0, LAN via eth0. I keep the connection up all the time but get disconnected by my provider once a day (dynamic IP address).

Symptom: After successfully establishing the DSL connection the routing table looks like this:

access1-dsl-m.n * 255.255.255.255 UH 0 0 0 ppp0
127.0.0.1 * 255.255.255.255 UH 0 0 0 lo
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0

The first entry is automatically added by (I guess) pppd when bringing the DSL connection up. "access1-dsl-m.n" is the provider's accesss point.
Problem:
The first entry should rather look as follows for my system to work:
default * 0.0.0.0 U 0 0 0 ppp0

When entering this route thru the console, everything works fine. Unfortunately I don't know how to integrate this into my start scripts in an intelligent way. During boot, the init script calls ifup, which in turn reads /etc/network/interfaces. So the first idea was to modify this file, e.g. as follows:
...
auto eth1
iface eth1 inet ppp
up pppd call dsl-provider
up route add default dev ppp0
down route del default dev ppp0
down ifconfig ppp0 down
...

This didn't work:
- pppd call dsl-provider is called by another start script in the boot process, so it would have been called twice during boot.
- The dsl-provider conf-file contains a "defaultroute" directive, so there should be no need to add a default route at all
- Further, I am not really sure, wether ifup / ifdown is called in case of a connection breakdown / reconnect.

Second idea was to modify the ppp start script directly, e.g. adding the default route statement directly after pppd call dsl-provider. For reasons unknown to me, this didn't work, too.

Why doesn't the "defaultroute" directive in /etc/ppp/peers/dsl-provider work as expected ?
What is the recommended way to set up a default route to a ppp target which may go down temporarily?

Thank you for your help in advance

Thomas

Guest

#2 Post by Guest »

finally found the solution myself:

pppd can execute scripts after connecting and disconnecting. They have to be placed in the directories /etc/ppp/ip-up.d and /etc/ppp/ip-down.d. Any name can be used, as long as the script files are marked executable. The run-parts command is used to execute all scripts within the directory in alphabetical order.

On my system, there were two scripts called 00-ipppd (in ip-up.d) and 99-ipppd (in ip-down.d). These add and remove default routes for ISDN connections. I simply adapted the scripts replacing interface ippp0 with ppp0 and now it works.

Post Reply