Re: suggestion for static ip



On Monday 27 March 2006 10:19, Dan Williams wrote:
> how would this work with, say, 20 static IP
> configs?

ARP the default router.   You can send ARPs for all the possible default 
routers, at the same time.   Unless someone is spoofing you, you should only 
get one reply, and you use the IP address associated with the router that 
replied.   Extra credit if you can figure out a way to use IPsec to secure 
this... :')

Ideally you use this whenever you think that you've made a link state 
transition, so that if you detect that you have (e.g., you can no longer ARP 
what you think is the default router), you can go to DHCP to get a new 
address immediately, rather than waiting for a renewal to detect that you're 
on a new link.   It's probably best to first ARP the router that you are 
currently configured to use as the default router (if any), and only send the 
20 ARPs if you don't get a quick response.

Of course, you do need your own ARPing, because the one in Linux for some 
reason checks to see if the IP address for which you are ARPing matches the 
subnet(s) configured on the interface, which prevents you from ARPing for 
your default router without configuring the interface with the whole 
configuration for that default router first.   This shouldn't be necessary, 
since ARP is a layer two protocol.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]