I had a little bit of a think about (and a look at the routes produced by) the
new code which does the auto creation of routes on at ifconfig time.
Firstly it seems that if I ifconfig an ethernet interface with a netmask of
255.255.255.248, I will get a route with a target of the interface address, a
gateway of 0.0.0.0, a netmask of 255.255.255.255 and the appropriate interface.
I cannot see any circumstance under which this route can be used (I even tried
downing my loopback interface and pinging myself, and got net unreachable).
Secondly, if I have multiple interfaces with the same address (eg ppp
interfaces using proxy arp - which works great, and means 1) I don't have to
allocate extra ip addresses to the servers no matter how many ppp peers are
attached to them and 2) I don't have to mess about with routing tables on other
machines to get the packets going to the right server - particularly as I use a
fixed ip address but come in on different servers from time to time) the route
generated to the interface address is always assigned to the last interface to
come up. (I haven't checked what happens when it comes down - this message is
coming to you via the ppp link I have just described ;-))
Does this route have any sane meaning? I could understand it if it produced a
net route to (iface_addr & iface_netmask) gw iface_addr netmask iface_netmask
dev iface, which is probably the primary route most people would like to appear
on the average interface, but it doesn't. I guess for point-to-point interfaces
it should simply produce a host route to the remote address via the local one -
does a netmask make sense on a ppp link? I notice that ifconfig returns one for
ppp0, but I'm not sure what it really means.
If it comes to that, does the netmask on an interface serve any purpose other
than providing a default for auto-generating routes? It doesn't seem to
restrict the packets I can route out of it - at work I have three disjoint
networks on the one wire and I can see them all with a netmask for the most
commonly used one, which does not cover the other two.
I also had a look at the two systems I use which are nearest BSD. Sunos4
doesn't produce these useless routes as far as I can tell. NetBSD/sun3 produces
strange output for netstat -r (looks like the arp cache has been merged with
the routing table - very odd). There is a route with a target of the ethernet
interface present, with a gateway of the ethernet hardware address (I said the
output was strange) and an interface of lo0, which kind of makes sense in a
twisted way. Our routing tables don't show the fact that packets for an
interface address get diverted to loopback.
Just my AUS$0.05 (damn the exchange rate)
David