[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 127.0.0.1
> ifconfig eth0 soos netmask 255.255.255.0 
> # End of network


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


ifconfig lo 127.0.0.1
route add 127.0.0.1

IPADDR="192.168.14.1"        # Your IP address
NETMASK="255.255.255.0"      # Your netmask
NETWORK="192.168.14.0"       # Your network address
BROADCAST="192.168.14.255"   # 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 (192.168.0.0).  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 (192.168.0.0) already provides a route to
'soos'.

> 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
> 192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        3 eth0
> bash# pppd
> bash# netstat -nr
> Kernel routing table
> Destination     Gateway         Genmask         Flags Metric Ref Use    Iface
> 199.0.65.156    0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
> 192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        4 eth0
> 0.0.0.0         199.0.65.156    0.0.0.0         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 0.0.0.0   199.0.65.156).
 
> 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


-- 
 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: