[nzlug] ADSL modem for pppoe bridge (half bridge)

Nick 'Zaf' Clifford zaf at nrc.co.nz
Sun Jun 15 19:59:13 NZST 2008


Peter wrote:
> /sbin/route add -host 202.27.211.183 dev eth1 /sbin/route add default
> gw 202.27.211.183 dev eth1
> gives me:
> long pause then "host: Host name lookup failure"
> and
> SIOCADDRT: File exists respectively
>
Yes, I can.. "host: Host name lookup failure". The function call to
print the error is:
printf("%s: Host name lookup failure",hostname);
(or similar)
Eg for some reason the route command is assume -host is the hostname

Can you confirm that the absence of a new line between the first and
second /sbin/route commands is a typo?
eg the commands should be:
/sbin/route add -host 202.27.211.183 dev eth1
/sbin/route add default gw 202.27.211.183 dev eth1

If that is the case, then try it using the ip command, eg
/bin/ip route add 202.27.211.183 dev eth1
/bin/ip route add default via 202.27.211.183 dev eth1
(The second dev eth1 isn't really required, but harmless)


As for more info on the static route hack, its only needed when the DHCP
lease from the DSL router has its "default gateway" address it issues as
an address that is NOT inside the ip/subnet that it issues.
eg if it issues:
IP: 123.45.67.8 Subnet: 255.255.255.0
Then if the default route it issues is anywhere in that range
(123.45.67.0-123.45.67.255) then no hack is needed, as the linux box
already knows a route to the default route (the subnet mask reveals that
its connected physically to the ethernet segment).

If the DSL router issues:
IP: 123.45.67.8 Subnet: 255.255.255.0
Default Route: 123.45.60.1
But the default route it issues is outside the subnet mask (60 instead
of 67). The linux routing tables say, ok, you want me to setup a default
route to an address of which I have no idea how to get to?
So the manual host route hack is needed, which effectivily says: This ip
(123.45.60.1) is connected to the ethernet segment, so no "routing" is
required, just bang the packets on the wire (its a little more tricky
due to ARP and ethernet addresses, but lets ignore that for now).

It would be nice if the routing tables in the kernel would say "if dev
<device> is specified, then assume its a host route"
And in fact with windows thats exactly what it does.

Maybe I'll write a patch for the kernel that does this (assuming the
issue is the kernel, and not /sbin/route, which it doesn't appear to be).

Nick







More information about the NZLUG mailing list