Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Nov 2004 20:54:43 +0300
From:      Vladimir Grebenschikov <vova@fbsd.ru>
To:        =?iso-8859-2?Q?S=B3awek_=AFak?= <zaks@prioris.mini.pw.edu.pl>
Cc:        freebsd-net <net@freebsd.org>
Subject:   Re: route add -host ... -iface issues
Message-ID:  <1100541283.935.30.camel@localhost>
In-Reply-To: <20041115172826.3E28911445@localhost>
References:  <20041115172826.3E28911445@localhost>

next in thread | previous in thread | raw e-mail | index | archive | help
=D0=92 =D0=BF=D0=BD, 15/11/2004 =D0=B2 18:28 +0100, S=C5=82awek =C5=BBak =
=D0=BF=D0=B8=D1=88=D0=B5=D1=82:
> Hi,
>=20
>     I'd like to ask why a static arp entry is added when direct route to =
host is
>     added like this?
>=20
>     route add -host target -iface interface
>=20
>     The route(8) manpage says, that such route entry is for hosts directl=
y
>     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 int=
erface,
>     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 F=
reeBSD
>     5.3. The default gateway is added *before* other static routes are
>     setup. Sometimes the default router is unreachable before other stati=
c
>     routes are set configured. Is there any reason to not change the line=
:
>=20
>                 static_routes=3D"default ${static_routes}"
>=20
>     to:
>=20
>                 static_routes=3D"${static_routes} default"
>     ?

Probably.=20

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

> /S   =20

--=20
Vladimir B. Grebenchikov
vova@fbsd.ru



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1100541283.935.30.camel>