From owner-freebsd-net@FreeBSD.ORG Mon Nov 15 17:54:47 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BF8F316A4CE; Mon, 15 Nov 2004 17:54:47 +0000 (GMT) Received: from vbook.fbsd.ru (asplinux.ru [195.133.213.194]) by mx1.FreeBSD.org (Postfix) with ESMTP id 32E4943D45; Mon, 15 Nov 2004 17:54:47 +0000 (GMT) (envelope-from vova@vbook.fbsd.ru) Received: from vova by vbook.fbsd.ru with local (Exim 4.43 (FreeBSD)) id 1CTl3s-000L9w-VH; Mon, 15 Nov 2004 20:54:45 +0300 From: Vladimir Grebenschikov To: =?iso-8859-2?Q?S=B3awek_=AFak?= In-Reply-To: <20041115172826.3E28911445@localhost> References: <20041115172826.3E28911445@localhost> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Organization: SWsoft Date: Mon, 15 Nov 2004 20:54:43 +0300 Message-Id: <1100541283.935.30.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.0.0FreeBSD GNOME Team Port Sender: Vladimir Grebenschikov cc: "current@freebsd.org" cc: freebsd-net Subject: Re: route add -host ... -iface issues X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: vova@fbsd.ru List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Nov 2004 17:54:47 -0000 =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_[_alias*] or /etc/start_if. > /S =20 --=20 Vladimir B. Grebenchikov vova@fbsd.ru