[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ppp- and dns-problem



On Sat, Apr 28, 2001 at 10:17:21PM +0200, Vincent Laisney wrote:
> Hi,
> I have a problem for the configuration of ppp (pppd) with a combi-card
> modem+ethernet. I use either ethenet or a ppp-connection with an ISP. 
> I have tried wvdialconfig for the configuration and i could not resolve
> the
> domaines names. I have also tried pppconfig (where it is possible to
> specify
> a static-dns-server. But it doesn't work. With 
> netstat -rn
> I get no default line.
> I have tried to set up directly a route with
> 
> route add default gw 62.104.196.134
> 
> and I get the following error
> 
> SIOCADDRT: Network is unreachable

 BTW,  SIOCADDRT == Socket IO Control: Add Route.  (io control = ioctl())
 This error happens if the gateway you are trying to add to the routing
table wasn't already reachable through some other entry in the routing
table.  i.e. on an ethernet, if you have eth0 with an IP address of
10.0.0.15, (netmask 255.0.0.0 (/24)), then your routing table before you add
the default route will be:
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.0.0.0        0.0.0.0         255.0.0.0       U     0      0        0 eth0

 If I ran  route add default gw 192.168.0.1, it won't work, because the
kernel doesn't know how to reach that host.  That makes it pretty hard to
start sending all our packets through it, doesn't it :)

After running  route add default gw 10.0.0.1, it will be:
10.0.0.0        0.0.0.0         255.0.0.0       U     0      0        0 eth0
0.0.0.0         10.0.0.1        0.0.0.0         UG    0      0        0 eth0

 If you're using ppp, you should just tell pppd to set a default route.  It
has an option to do this, called defaultroute.  Just add that to your
/etc/ppp/options, or /etc/ppp/peers/filename.

 If you want to manually add a default route with ppp, the gateway you
specify _must_ be the ppp peer, i.e. the IP that ifconfig ppp0 shows as the
Point-to-point IP.  (If you already added a non-default route with the
ppp peer as the gateway, you still have to use the ppp peer as the gateway.
There is no way to ask a host that you can't reach directly to forward a
packet for you, since there is no way to tell the first hop router who to
forward to, other than the final destination.  Think about it.  Or don't if
this isn't what you were trying to do, since it's not easy to understand
unless you know networking :)

 Also, why were you talking about DNS in the start of your message, then
switched to talking about routing.  The route command has nothing at all to
do with DNS.  It will use DNS if you give host names instead of IPs, but
that's all.  The routing configuration affects whether DNS will work or not,
because the servers you specify in /etc/resolv.conf must be reachable, but
that's all there is in terms of interaction between routing and DNS.

-- 
#define X(x,y) x##y
Peter Cordes ;  e-mail: X(peter@llama.nslug. , ns.ca)

"The gods confound the man who first found out how to distinguish the hours!
 Confound him, too, who in this place set up a sundial, to cut and hack
 my day so wretchedly into small pieces!" -- Plautus, 200 BCE


P.S. My last sentence is only true under the assumption that IP addresses
are unique.  More generally, you could route packets so they got to one
10.0.0.1 or a different 10.0.0.1.  However, if that's the case, it shouldn't
be, so you should change it :)



Reply to: