Re: route add -host ... -iface issues

From: Vladimir Grebenschikov <vova_at_fbsd.ru>
Date: Mon, 15 Nov 2004 20:54:43 +0300
В пн, 15/11/2004 в 18:28 +0100, Sławek Żak пишет:
> Hi,
> 
>     I'd like to ask why a static arp entry is added when direct route to host is
>     added like this?
> 
>     route add -host target -iface interface
> 
>     The route(8) manpage says, that such route entry is for hosts directly
>     reachable over interface. But when packets go out on this interface, the MAC
>     address of target host in each packet is set to local MAC for the interface,
>     which effectively stops the target host from receiving the packet.

Actually you should instruct routing engine to do ARP lookup if you want
to reach some IP address via ethrenet interface directly, like:

route add a.b.c.0/24 -iface fxp0 -cloning

or, for single host:

route add a.b.c.d/32 -iface fxp0 -cloning

/32 is important, it actually this enforces network route with netmask
255.255.255.255 to be added into routing table, from my practice, only
network routes can be ARP-resolved.

>     Another thing is the order of adding routes in /etc/rc.d/routing of FreeBSD
>     5.3. The default gateway is added *before* other static routes are
>     setup. Sometimes the default router is unreachable before other static
>     routes are set configured. Is there any reason to not change the line:
> 
>                 static_routes="default ${static_routes}"
> 
>     to:
> 
>                 static_routes="${static_routes} default"
>     ?

Probably. 

But looks like you want to install interface-specific routes, 
I guess it is better to put anything interface-specific in
ifconfig_<ifname>[_alias*] or /etc/start_if.<ifname>

> /S    

-- 
Vladimir B. Grebenchikov
vova_at_fbsd.ru
Received on Mon Nov 15 2004 - 16:54:47 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:22 UTC