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

Re: ifconfig and routing tables

Susan G. Kleinmann wrote:
> Package:  netbase
> Version:  1.20-1
> I believe this message is headed for the debian-bugs list, but since I'm 
> treading on very thin ice here, I decided to submit it to debian-users 
> first, in case I'm just doing something, or expecting something, wrong.
> The problem is that ifconfig doesn't seem to be feeding netstat very
> much (or the right) information.

IMHO it has nothing to do with ifconfig, netstat or route. The
/etc/init.d/network script should set up your local loopback device
and your ethernet device. It should also add a route to the local
loopback device (either a host route or a network route) and a network
route to the ethernet device. If you also have a gateway it should
add a default route to it (of course not for dial-up connections).

> My /etc/init.d/network file is pretty simple:
> # Start of network
> ifconfig lo
> ifconfig eth0 soos netmask 
> # End of network

My current /etc/init.d/network file looks like this:

ifconfig lo
route add

IPADDR=""        # Your IP address
NETMASK=""      # Your netmask
NETWORK=""       # Your network address
BROADCAST=""   # Your broadcast address (blank if none)

ifconfig eth0 ${IPADDR} netmask ${NETMASK} broadcast ${BROADCAST}
route add -net ${NETWORK} eth0

> When I look at netstat before invoking pppd, I see only one line, and
> that line goes to the local network (  I see nothing for
> 'localhost', and nothing for 'soos'.

There should be a localhost (or localnet) entry. A 'soos' entry is not
necessary, the network route ( already provides a route to

> The script below shows the details:
> Script started on Wed Oct 25 21:35:27 1995
> bash# netstat -nr
> Kernel routing table
> Destination     Gateway         Genmask         Flags Metric Ref Use    Iface
>   U     0      0        3 eth0
> bash# pppd
> bash# netstat -nr
> Kernel routing table
> Destination     Gateway         Genmask         Flags Metric Ref Use    Iface
> UH    0      0        0 ppp0
>   U     0      0        4 eth0
>         UG    0      0        1 ppp0
> Script done on Wed Oct 25 21:36:43 1995
> I expected that 'localhost' would have had an entry,

Yes, it should have an entry.

> that the Gateway fields would have been filled in,

If pppd is not running you don't need a gateway entry. If pppd is running
you have a gateway entry (the line starting with
> and that 'soos' would have had an entry.

There's already a network route which covers the 'soos' entry.

> Is this an incorrect expectation, or is ifconfig/routed/netstat misbehaving?

I think it has nothing to do with ifconfig/routed/netstat. It seems
that the network setup menue from the basedisks forgot to add the
"route add localhost" line.


 Peter Tobias                                EMail:
 Fachhochschule Ostfriesland                 tobias@et-inf.fho-emden.de
 Fachbereich Elektrotechnik und Informatik   tobias@perseus.fho-emden.de
 Constantiaplatz 4, 26723 Emden, Germany

Reply to: