Wietse Venema wrote:
Florin Andrei:
Florin Andrei wrote:
Is there a way to bind the listener to an interface using the interface name (eth5:smtp) instead of the IP (1.2.3.4:smtp)?

No. The bind(2) system call specifies an address. Not an interface,
and not the route. Connections with source address of X are not
necessarily sent out via interface X. The interface is chosen
depending on the destination of the connection.

I understand. It makes perfect sense from the perspective of the programmer.

But switch the perspective and look at it from the p.o.v. of the sysadmin. In that case, it would be so nice to say "hey, bind to interface ethX and stay there".

It's not unheard of either. Right now, on my home server, I've at least three services running that are configured like that: samba, dhcpd and mediatomb (a UPnP multimedia server). So it's not just doable, but quite a widespread practice among open source projects.

This trick makes configuration so much easier on multihomed machines. /etc/samba/smb.conf is a great example of a flexible configuration syntax: you can mix and match addresses and interface names.

--
Florin Andrei

http://florin.myip.org/

Reply via email to