Forum OpenACS Q&A: Two interfaces and one service to bind them all?

I have a laptop that has a built-in ethernet port as well as a 802.11 wireless card.  At times, this laptop connects to the lan through ethernet and at times through wifi.

The lan has a 8port 10/100bt hub as well as a wap.  And it has a dsl router (sonicwall soho).

Using so-called static dhcp addressess associated with an interface's mac address, the dsl router can give each interface its own ip address that will never be given to any other interface.  But it will not give two interfaces the same ip address.

I am not running anything like a dynamic dns registration service.

Regardless of which interface connects the laptop to the lan, I would like the other machines on the lan to be able to utilize services on the laptop (ssh, smb, http, ...), and I would prefer they access those services by name and not by my entering the current ip address each time.

What can I do?

Thanks,

Collapse
Posted by David Walker on
Essentially you're trying to do the part of the same type of thing that a high availability service would do with failover capabilities.

1. You could build something using ns_update to tell DNS you've changed IP addresses. Subject to the timeout of the DNS record.

2. You could assign a static IP address to the laptop and use send_arp to tell the network which interface that IP address goes with. This change will be pretty quick. In fact you could probably open an ssh connection, switch interfaces, send_arp, and continue using the open connection.

send_arp comes from "fake" and is part of the package you can download at http://www.vergenet.net/linux/fake/

ethx="whichever interface is live at the moment"
ip_address="whatever static IP assigned to be always up"
macaddr=`ifconfig ${ethx} |awk '/HWaddr/ { print $5 }'|sed -e 's/://g'`
send_arp ${ethx} ${ip_address} ${macaddr} ${ip_address} ffffffffffff
Collapse
Posted by Petru Paler on
Are you running Linux on that laptop? If yes, then the problem might be solved by the fact that it will answer (by default) for ARP queries for all IPs on all interfaces. For example, if you have IP1 on interface 1 and IP2 on interface 2, the machine will respond to an ARP query for IP1 arriving on interface 2 (and will answer with interface 2's MAC address).

You'll still have a problem with keeping the interfaces up, I guess. Are you taking the ethernet interface down when you disconnect the cable?

Collapse
Posted by hafeez bana on
You can do two things.

1) Start the services with the ip 0.0.0.0 which would force them to accept incoming connections on all interfaces. This does not always work on windows machines. For example with AOLserver on windoze I had to prebind it to multiple IP addresses on each machine using command line options.

2) Alternatively you could forget about assigning two static dhcp adresses and bridge the interfaces. Brigding would bind the two interfaces into one logical interface with one ip address. Start your services on this ip and both wifi and ether can connect to them. Bridging is available on linux and on Windows XP pro. I don't know about the others. see bridge.sourceforge.net for a linux explanation.

I would use the second option. It has much more expandability, and easier to setup then 1 (if you are running linux - 3 commands).

Regards,
hafeez