opensuse 11.1 - reporting multiple loopback interface

We develop software is used for systems management. We are using standard techniques to obtain from the kernel the network interface information. Our software has been running on many different versions of Linux since 2006 as well as opensuse without this particular problem. As of opensuse 11.1 the kernel seems to report multiple (2) loopback interfaces and four (4) 127.0.0.1 addresses (no problem for other interfaces or addresses). This only happens on opensuse 11.1 and not any other Linux distribution (we also support also xBSD, OSX, Solaris and Windows). Using “ifconfig” reports only a single loopback interface and address.

We are sort of stuck on this issue and wonder whether anyone else has come across or may assist us.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

How are you trying to get these addresses and interfaces? You mention
that ‘ifconfig’ reports things properly, so apparently you are not using
that option. Also tye ‘ip’ command is made to replace ifconfig I believe:

ip addr show

Good luck.

Versiera wrote:
> We develop software is used for systems management. We are using
> standard techniques to obtain from the kernel the network interface
> information. Our software has been running on many different versions of
> Linux since 2006 as well as opensuse without this particular problem. As
> of opensuse 11.1 the kernel seems to report multiple (2) loopback
> interfaces and four (4) 127.0.0.1 addresses (no problem for other
> interfaces or addresses). This only happens on opensuse 11.1 and not any
> other Linux distribution (we also support also xBSD, OSX, Solaris and
> Windows). Using “ifconfig” reports only a single loopback interface and
> address.
>
> We are sort of stuck on this issue and wonder whether anyone else has
> come across or may assist us.
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQIcBAEBAgAGBQJKHrAlAAoJEF+XTK08PnB5NKcQAJbWBVEuPmOqQ154xFSDDem5
S6BxQR1TFCglM9b43iAXqMNFc+pe+0lOPScZlNNQVW9btC/gGHSLSBW7bVVNoCkz
xvkeC/6o8pnzGoXZdzDZFWmvOp2EzjJc1XjHYdSzGD6iXsZH8fpLJKXzIgz+0PWQ
Smu+DXVRF1+0q+YNuKJf/uSnTjRCLifLhVx8uuda9Bu3MHA9FwOf11VIlqI1PK0c
KFNQ9pv4GqDEIlREQiXY4RnlQa/XjEftnvHqjmRWtlhaS1tVj0/paKABoSg7P2V8
o8ii+cYnRjA4nZjv9IXYcz5GHBCvFlbNz/FrubU7QnmkELcBoeZ6C8BpsXe3Hhj9
G5d+gsTK216mJSFNhJect/QUb7svLIMYhIR4UGhgfz6pG4tYwz1z1dyjzQppwvKZ
ZHwc0o1cPzTQ7BxiRjSVUHWJuhpdoPQOnFcx9PmLFMwULDnWSmMuw9x8uhMvwvLz
2YmTzp0/71uatfUJbiAJv7ZN4dQeaxXGd+pKWCrqnefBRONSHyLtxl6KeqxSItt3
hcPxrt94jlNctPx/4726Q2guoJpoPQ89IQThbgOSPRwWVngH2ofmTf0kpvUBuok4
gBe2d/xLGZNdEcXi8ud8Z0kz928wfY7o5OZ/ii6/z6nYQGXUqNyxWmSKDTJmfzsx
TZkizFjd2tZGO21slIkd
=WxSZ
-----END PGP SIGNATURE-----

The difficulty I’m having is why the kernel returns (2) lo interfaces and (4) 127.0.0.1/8 addresses. Here is my setup, I have two test host systems:

A - PC - two Intel interfaces on separate cards, one interface connected/active

B - Vmware host - one interface assigned/active

Result from A:


openSUSE-11rc1:~ # ifconfig
eth0      Link encap:Ethernet  HWaddr 00:02:A5:AF:7A:31
          inet addr:172.20.2.199  Bcast:172.20.2.255  Mask:255.255.255.0
          inet6 addr: fe80::202:a5ff:feaf:7a31/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3130465 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3888997 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:456417913 (435.2 Mb)  TX bytes:796901460 (759.9 Mb)

eth1      Link encap:Ethernet  HWaddr 00:90:27:64:FD:0A
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:41 errors:0 dropped:0 overruns:0 frame:0
          TX packets:41 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:3204 (3.1 Kb)  TX bytes:3204 (3.1 Kb)

openSUSE-11rc1:~ # ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 brd 127.255.255.255 scope host lo
    inet 127.0.0.2/8 brd 127.255.255.255 scope host secondary lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:02:a5:af:7a:31 brd ff:ff:ff:ff:ff:ff
    inet 172.20.2.199/24 brd 172.20.2.255 scope global eth0
    inet6 fe80::202:a5ff:feaf:7a31/64 scope link
       valid_lft forever preferred_lft forever
3: eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:90:27:64:fd:0a brd ff:ff:ff:ff:ff:ff
openSUSE-11rc1:~ #

Result from B:


opensuse-11:~ # ifconfig -a
eth1      Link encap:Ethernet  HWaddr 00:0C:29:6E:4F:98
          inet addr:172.20.2.134  Bcast:172.20.2.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe6e:4f98/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:863844 errors:0 dropped:0 overruns:0 frame:0
          TX packets:607997 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:118842772 (113.3 Mb)  TX bytes:89596173 (85.4 Mb)
          Interrupt:18 Base address:0x10a4

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:100 (100.0 b)  TX bytes:100 (100.0 b)

opensuse-11:~ # ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 brd 127.255.255.255 scope host lo
    inet 127.0.0.2/8 brd 127.255.255.255 scope host secondary lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:0c:29:6e:4f:98 brd ff:ff:ff:ff:ff:ff
    inet 172.20.2.134/24 brd 172.20.2.255 scope global eth1
    inet6 fe80::20c:29ff:fe6e:4f98/64 scope link
       valid_lft forever preferred_lft forever

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Right, but how are you getting those data? 127...* should resolve to
your box no matter what per TCP/IP standards so you can use any IP address
you want in that range and be fine to connect locally (NTP uses
127.127.1.0 all the time out of the box, even).

Good luck.

Versiera wrote:
> The difficulty I’m having is why the kernel returns (2) lo interfaces
> and (4) 127.0.0.1/8 addresses. Here is my setup, I have two test host
> systems:
>
> A - PC - two Intel interfaces on separate cards, one interface
> connected/active
>
> B - Vmware host - one interface assigned/active
>
> Result from A:
>
>
> Code:
> --------------------
>
> openSUSE-11rc1:~ # ifconfig
> eth0 Link encap:Ethernet HWaddr 00:02:A5:AF:7A:31
> inet addr:172.20.2.199 Bcast:172.20.2.255 Mask:255.255.255.0
> inet6 addr: fe80::202:a5ff:feaf:7a31/64 Scope:Link
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> RX packets:3130465 errors:0 dropped:0 overruns:0 frame:0
> TX packets:3888997 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:1000
> RX bytes:456417913 (435.2 Mb) TX bytes:796901460 (759.9 Mb)
>
> eth1 Link encap:Ethernet HWaddr 00:90:27:64:FD:0A
> UP BROADCAST MULTICAST MTU:1500 Metric:1
> RX packets:0 errors:0 dropped:0 overruns:0 frame:0
> TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:1000
> RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
>
> lo Link encap:Local Loopback
> inet addr:127.0.0.1 Mask:255.0.0.0
> inet6 addr: ::1/128 Scope:Host
> UP LOOPBACK RUNNING MTU:16436 Metric:1
> RX packets:41 errors:0 dropped:0 overruns:0 frame:0
> TX packets:41 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:0
> RX bytes:3204 (3.1 Kb) TX bytes:3204 (3.1 Kb)
>
> openSUSE-11rc1:~ # ip addr show
> 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
> link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
> inet 127.0.0.1/8 brd 127.255.255.255 scope host lo
> inet 127.0.0.2/8 brd 127.255.255.255 scope host secondary lo
> inet6 ::1/128 scope host
> valid_lft forever preferred_lft forever
> 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
> link/ether 00:02:a5:af:7a:31 brd ff:ff:ff:ff:ff:ff
> inet 172.20.2.199/24 brd 172.20.2.255 scope global eth0
> inet6 fe80::202:a5ff:feaf:7a31/64 scope link
> valid_lft forever preferred_lft forever
> 3: eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
> link/ether 00:90:27:64:fd:0a brd ff:ff:ff:ff:ff:ff
> openSUSE-11rc1:~ #
>
> --------------------
>
>
>
> Result from B:
>
>
> Code:
> --------------------
>
> opensuse-11:~ # ifconfig -a
> eth1 Link encap:Ethernet HWaddr 00:0C:29:6E:4F:98
> inet addr:172.20.2.134 Bcast:172.20.2.255 Mask:255.255.255.0
> inet6 addr: fe80::20c:29ff:fe6e:4f98/64 Scope:Link
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> RX packets:863844 errors:0 dropped:0 overruns:0 frame:0
> TX packets:607997 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:1000
> RX bytes:118842772 (113.3 Mb) TX bytes:89596173 (85.4 Mb)
> Interrupt:18 Base address:0x10a4
>
> lo Link encap:Local Loopback
> inet addr:127.0.0.1 Mask:255.0.0.0
> inet6 addr: ::1/128 Scope:Host
> UP LOOPBACK RUNNING MTU:16436 Metric:1
> RX packets:2 errors:0 dropped:0 overruns:0 frame:0
> TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:0
> RX bytes:100 (100.0 b) TX bytes:100 (100.0 b)
>
> opensuse-11:~ # ip addr show
> 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
> link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
> inet 127.0.0.1/8 brd 127.255.255.255 scope host lo
> inet 127.0.0.2/8 brd 127.255.255.255 scope host secondary lo
> inet6 ::1/128 scope host
> valid_lft forever preferred_lft forever
> 2: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
> link/ether 00:0c:29:6e:4f:98 brd ff:ff:ff:ff:ff:ff
> inet 172.20.2.134/24 brd 172.20.2.255 scope global eth1
> inet6 fe80::20c:29ff:fe6e:4f98/64 scope link
> valid_lft forever preferred_lft forever
>
> --------------------
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQIcBAEBAgAGBQJKHrekAAoJEF+XTK08PnB5exYP/RcByzUyQ9syF1e/k1AbsNx1
XVjYPxLmJVmbpbvFUWLZ9f4rmxD1meGtQvBoO1GbPR3vScwwEu0fE9p6hKN7N8Bk
jP4i8zna8ykWv7mJqrRFj3lCuGEJSinReHnLQF9kIjFVRP7KRlae1OAnTJwwTbtw
Rn5Y7aoqDGf6XF95V826jjJtbZDvWB7zbFTwT+U/K7jd1SSsWcuqN7FmhOQYyUbK
o7UXGUHOjPEStI2dWCsq8sgxt+ImciPULm+wizurs9gG9oL++6f3GHTJw2nguDV+
UUsTCmZsGtxH/gpYTvgOAbcDZxa4mSKpzHtZKAdZ0XWfm86yvcd4hrS7yENGPwV2
RXp3dYXqzIGp3k7YM+z01sF/L5LzJ30XIFdYNqqSHkLOLgYu5naTEZYJBZ10eHrj
cBjeBQISeOCD7eNGbqAoW224Nu7b6yt5d9dAmdjeKQX8IyN8mA9yz7H+/qjYsB8q
sVd/UjOE8Znq6Q50s832ndPocFfleD9c4oLLbTjDeMMokdv0AB0LU8MJzCxDYwF2
CKk1IwvT/GtUNxlSt69KRDPm/eKUmYICXyM97HNaTQtv1hsBa3u2LxSVh5S81x4+
CK9w6DaaslW9sfqi5NU8yknJCTJ9SbaXgoAfw+tZL7sMn0ADtYFn9rSzeqSHN7Cx
ckuxMO4i7NnvFQz1XuT8
=2vFE
-----END PGP SIGNATURE-----

We are using:

SIOCGIFCONF
SIOCGIFADDR
SIOCGIFNETMASK
SIOCGIFINDEX
SIOCGIFHWADDR

Looking at the output of “ip addr show” from other Linux distributions, they only return the 127.0.0.1 address.

inet 127.0.0.1/8 brd 127.255.255.255 scope host lo
    inet 127.0.0.2/8 brd 127.255.255.255 scope host secondary lo

So I need to start my investigation here. Why does opensuse return two loopback addresses?

It’s perfectly legal to have multiple loopback addresses. You can have up to 2^24-2 loopback addresses. 127.0.0.1 is the usual one, but openSUSE binds 127.0.0.2 to the domain name you have given the machine as well.

The question is why is it a problem for your software?

This is the first time I’ve encountered where a host configuration that has multiple loopback (lo) interfaces each with a different loopback addresses.

I would appreciate an explanation to help me understand why this is useful or necessary for the opensuse distribution to include such a configuration binding one for the host and one for the domain. Are there particular applications that use this? Also where is this configured in opensuse - would like to have a look.

With respect to our code, it does report correctly two (lo) loopback interfaces, but does not report the two different loopback addresses (127.0.0.1/127.0.0.2) rather it reports (4) 127.0.0.1 - this I’ll need to figure out.