Re: Solaris and lack of loopback routes

From: Crist J. Clark (crist.clark@attbi.com)
Date: 08/09/02


Date: Thu, 8 Aug 2002 16:13:21 -0700
From: "Crist J. Clark" <crist.clark@attbi.com>
To: "Chris A. Mattingly" <chris.mattingly@interpath.net>

On Tue, Aug 06, 2002 at 12:28:39PM -0400, Chris A. Mattingly wrote:
> Jon wrote:
> >
> > (reposted)
> >
> > On Tue, Jul 30, 2002 at 05:12:45PM -0400, Chris Mattingly wrote:
> > > On FreeBSD, there is no route for the 127/8 network, but the stack
> > > actually pays attention to the fact that lo0 has a netmask for the
> > > entire /8 network, and traffic to any 127 address stays within the lo0
> > > interface (never shows up on any of the other three physical
> > > interfaces).
> >
> > Just to satisfy my curiousity, I dropped the loopback network route and
> > changed the netmask of my loopback device to be 255.255.255.0 on my linux
> > box (I don't have a Solaris box available at the moment). Still, all
> > traffic bound for the loopback network was sent over the loopback device.
> > This may be a linux specific feature that I'm not familiar with. Does a
> > similar test on a Solaris box yield different results?
>
> On Solaris, here's the breakdown:
>
> o With a netmask of 255.0.0.0 and no routes for the 127/8 network,
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Solaris sends 127/8 traffic (except 127.0.0.1 for which there
> is a host route) out the "default" interface. It should not do
> this if it paid attention to the netmask on lo0.

The whole issue is that,

  # ifconfig lo0 inet 127.0.0.1

Says,

  lo0: flags=849<UP,LOOPBACK,RUNNING,MULTICAST> mtu 8232
          inet 127.0.0.1 netmask ff000000
                                 ^^^^^^^^
Even though it doesn't actually add a route corresponding to that
network. Doing an ifconfig(1M) on other types of interfaces does put
the entry in the routing table.

> So what it's boiling down to is that Solaris doesn't care what
> the netmask is of the lo0 interface. Only when there is a
> specific route in place will traffic stay on lo0 when it is
> supposed to stay on lo0.

Huh. Strange. I thought this type of behavior was only a BSDism. I'd
be curious to find what other Unix variants have this "feature."

-- 
Crist J. Clark                     |     cjclark@alum.mit.edu
                                   |     cjclark@jhu.edu
http://people.freebsd.org/~cjc/    |     cjc@freebsd.org



Relevant Pages

  • Re: Solaris and lack of loopback routes
    ... > On FreeBSD, there is no route for the 127/8 network, but the stack ... changed the netmask of my loopback device to be 255.255.255.0 on my linux ... traffic bound for the loopback network was sent over the loopback device. ...
    (Focus-SUN)
  • Interface configuration - inet6 issues
    ... Having some issues getting my interfaces configured properly. ... post-up ip route add table 100 to default via 10.0.4.1 dev eth1 ...
    (Debian-User)
  • Re: load balancing with a failover
    ... The tunnel interfaces have addresses ... from other network though ... Enter configuration commands, one per line. ... 1w0d: RT: delete subnet route to 192.168.128.20/30 ...
    (comp.dcom.sys.cisco)
  • Re: network unrachable problem [SOLVED]
    ... route show shows both interfaces, so that's very likely the cause. ... The Linux kernel changed the display order for routes. ... ifplugd calls ifup/ifdown to do its actual work. ...
    (Debian-User)
  • Re: Linking wireless and ethernet network adapters
    ... You can give both interfaces the same ... > address, on the same subnet, and tell the kernel to route packets ... > ip link set dev eth0 up name preferred ip link set dev wlan0 up name ...
    (uk.comp.os.linux)