FreeBSD routing

Bob Hepple bhepple at freeshell.org
Wed Oct 19 04:29:16 PDT 2005


On Wed, 19 Oct 2005 12:52:22 +1000
Richard Burakowski <richard.burakowski at mrburak.net> wrote:

> Bob Hepple wrote:
> 
> >Well, it has to be taught ... eg with a FreeBSD 2.214 I can do this:
> >route delete default
> >route add -net 192.168.254.0 -interface xl0 # !!!
> >route add default 192.168.254.245
> >cp /etc/resolv.conf.home /etc/resolv.conf
> >  
> >
> well, my turn ...
> 
> from the man page:
>     If the destination is directly reachable via an interface requiring no
>     intermediary system to act as a gateway, the -interface modifier should
>     be specified; the gateway given is the address of this host on the 
> common
>     network, indicating the interface to be used for transmission.
> 
> what i've now come to understand hinges on the phrase "address of this 
> host on the common network, indicating the interface to be used for 
> transmission.".  note this is not *the* interface.  for ethernet, it's 
> the local interface and the destination's mac address.  the format of 
> this address is partly described in link_addr(3).
> 
> route add 192.168.2.214/32 -link -interface rl0:x:x:x:x:x:x
> 
> if you want the kernel to use arp to find the mac address, you 
> specifically have to tell it to:
> 
> route add 192.168.2.214/32 -interface rl0 -cloning
> 
> a giveaway should have been the duplicate mac addresses in your routing 
> tables which we all missed.
> 

Richard,

Hmmm - that works! Thanks very much ...

... but given that solution, I would have thought that

	route add -host 192.168.2.214 -interface rl0 -cloning

would also work, but it doesn't. Back to the man pages for me!!

Interesting how seemingly similar but subtly different FreeBSD can be, at
least in this example. I wonder which behaviour of "route", FreeBSD or
Linux, is more strictly correct, if there such a thing as a correct
behaviour - without starting a trawl, of course!

Thanks again!



Bob

-- 
Bob Hepple
mailto:bhepple at freeshell.org http://bhepple.freeshell.org
Public Key: http://bhepple.freeshell.org/public_keys.txt


More information about the freebsd-questions mailing list