On 21/08/11 14:36, Brian Burch wrote:
I've just inspected several machines, running various versions of
ubuntu. Some of them have NO programs listening on the IPv4 0.0.0.0
wildcard address. Others have a mixture of explicit loopbacks from some
programs, and the wildcard from others.
"man 7 ip" says:
When INADDR_ANY is specified in the bind call, the socket will be
bound to all local interfaces.

I've been working through my various systems carefully and have tentatively come to the conclusion that this bug can be closed.

I think the "problem" has been around for several years in different guises, but no longer exists in the current stable release. Any system exhibiting these symptoms is probably suffering from residual configuration problems. I have eliminated my own problems using this checklist:

1. Make sure the /etc/hosts file is minimal:
  # minimal hosts file from clean install
  #
  127.0.0.1       localhost
  127.0.1.1       myHostName
  # The following lines are desirable for IPv6 capable hosts
  ::1     ip6-localhost ip6-loopback
  fe00::0 ip6-localnet
  ff00::0 ip6-mcastprefix
  ff02::1 ip6-allnodes
  ff02::2 ip6-allrouters

2. Make sure /etc/networking/interfaces is minimal:
  # The loopback network interface is all that Network Manager needs
  auto lo
  iface lo inet loopback

3. Inspect which sockets your server applications are listening on:
  sudo netstat -p -n --listen --tcp --udp

a) any listening on 0.0.0.0:xx will be using INADDR_ANY and will therefore receive datagrams sent by local clients to their own hostname, which will be resolved to 127.0.1.1. (Those listening on :::xx will be using in6addr_any and so will compatibly handle datagrams addressed to any IPv4 or IPv6 interface).

b) any listening on explicit addresses will ONLY receive datagrams addressed to one of those addresses. Therefore, if the application is not explicitly listening on 127.0.1.1, it will never receive incoming datagrams.


Programs in category b) can then be sub-categorised:
b.1) Programs such as sshd, postfix, etc, will usually default to "all interfaces", but can be configured to listen on explicit addresses and ports. You should change the configuration file if it isn't doing what you want. b.2) Some programs might have been coded to enumerate all known interfaces and then explicitly listen on all or some of them. They need reconfiguring or recoding if they are required to handle datagrams send to the hostname ip address.

The ubuntu team have recently recategorised my original bug to apply to bind9 rather than ifupdown, because bind does not listen on all interfaces and seems to ignore configuration to explicitly listen on 127.0.1.1. (https://bugs.launchpad.net/bugs/604283)

Quite possible, that migration to iproute changed something, but I
can't find anything important changed.

Thanks for looking into it, Andrew.

The experimental ifupdown consistently uses the ip command to set interface addresses and routes, which is a good thing. However, I now believe the current stable version (using ifconfig and route commands) is behaving the same way. The change in the new version is desirable, but I do not think it is necessary for resolving this class of problems.



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to