Subject: Odd problem with ifconfig aliases
To: None <>
From: Lasse =?iso-8859-1?Q?Hiller=F8e?= Petersen <>
List: netbsd-users
Date: 02/21/2001 21:41:42
I have an ADSL connection with an ISP-configured router. This router
translates traffic to my IP-address into various private 192.168.1.x
addresses, depending on the protocol. SMTP goes to, and HTTP
goes to Changing this is rather expensive.

I have successfully had my server configured with the following
/etc/ifconfig.rtk0 file:
inet netmask 0xffffff00 media autoselect
inet netmask 0xffffff00 alias

This worked fine for HTTP and SMTP, from the outside, as well as from the

In order to have names locally, I have set up named on the server
(unreachable from the outside, of course), with two A records for my domain
name,, for and

This has also worked fine. The server always answers connections from my
client machine correctly, be it POP, SSH, FTP, HTTP, SMTP.

However, I have tried setting up OpenLDAP v2.0.7, and this seemed to be
problematic. Apparantly it will only listen on one address on one network,
so despite starting slapd with -h ldap:// ldap://
explicitly; every other ldap connection failed. (named by default returns
adresses in a round-robin fashion, it seems.)

If I set up slapd to only listen on the alias, the connection seems to come
up halfway or something, if I try an ldapsearch -h The
non-alias address, succeeds.

This also seems to be the case for other services, I found out.
If I from the server itself try to telnet to port 25, I get through fine if
I use, but if I use the aliased address, I never get a
connection, it just sits there indefinitely. I *can* get an SMTP connection
on from my client machine, however. (That's why I got surprised
when LDAP didn't work in that situation.)

So this is not an issue with LDAP, but an issue with IP-aliases. Probably
this is a known (except to me) issue with aliases on the same network, and
most likely there are good reasons why this is so. However I have not been
able to find any documentation of this. The manpage for ifconfig does not
mention any problems that would make an alias work different than the
"real" address, but perhaps this has never occured to anyone, given the
example in the manpage. However, I think my "abuse" of this feature is
valid, and although I can work around the problem, it would have been nice
if it were documented in the ifconfig manpage.

At least that's what I think. But before I file a PR or write a patch to
the manpage, I'd like to hear from other people. Perhaps it's just me being
stupid. If so, by all means let me know!