From owner-freebsd-net@FreeBSD.ORG Mon Jan 17 16:05:57 2005 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 E549C16A4CE for ; Mon, 17 Jan 2005 16:05:56 +0000 (GMT) Received: from tigra.ip.net.ua (tigra.ip.net.ua [82.193.96.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 39AFD43D49 for ; Mon, 17 Jan 2005 16:05:55 +0000 (GMT) (envelope-from ru@ip.net.ua) Received: from localhost (rocky.ip.net.ua [82.193.96.2]) by tigra.ip.net.ua (8.12.11/8.12.11) with ESMTP id j0HG5j8P084806; Mon, 17 Jan 2005 18:05:46 +0200 (EET) (envelope-from ru@ip.net.ua) Received: from tigra.ip.net.ua ([82.193.96.10]) by localhost (rocky.ipnet [82.193.96.2]) (amavisd-new, port 10024) with LMTP id 54447-09; Mon, 17 Jan 2005 18:05:43 +0200 (EET) Received: from heffalump.ip.net.ua (heffalump.ip.net.ua [82.193.96.213]) by tigra.ip.net.ua (8.12.11/8.12.11) with ESMTP id j0HG5h6B084800 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 17 Jan 2005 18:05:43 +0200 (EET) (envelope-from ru@ip.net.ua) Received: (from ru@localhost) by heffalump.ip.net.ua (8.13.1/8.13.1) id j0HG5XXP077626; Mon, 17 Jan 2005 18:05:33 +0200 (EET) (envelope-from ru) Date: Mon, 17 Jan 2005 18:05:23 +0200 From: Ruslan Ermilov To: Vladimir Grebenschikov Message-ID: <20050117160523.GA77421@ip.net.ua> References: <1105974518.1229.9.camel@localhost> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="y0ulUmNC+osPPQO6" Content-Disposition: inline In-Reply-To: <1105974518.1229.9.camel@localhost> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at ip.net.ua cc: net@FreeBSD.org Subject: Re: Invalid 'route change' functioning X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2005 16:05:57 -0000 --y0ulUmNC+osPPQO6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 17, 2005 at 06:08:38PM +0300, Vladimir Grebenschikov wrote: > Hi >=20 > I am try to do following thing - configure another interface with same > address on same broadcast segment (but wired) and then change route > entry from one interface to another: >=20 >=20 > # ifconfig iwi0 > iwi0: flags=3D8843 mtu 1500 > inet 192.168.1.111 netmask 0xfffffe00 broadcast 192.168.1.255 > ether 00:0e:35:03:82:74 > media: IEEE 802.11 Wireless Ethernet autoselect (OFDM/54Mbps) > status: associated > ... > # netstat -rn > Routing tables >=20 > Internet: > Destination Gateway Flags Refs Use Netif Expire > default 192.168.1.1 UGS 0 511183 iwi0 > 127.0.0.1 127.0.0.1 UH 1 626 lo0 > 192.168.0/23 link#3 UC 0 0 iwi0 > 192.168.1.111 127.0.0.1 UGHS 0 0 lo0 > 192.168.1.255 ff:ff:ff:ff:ff:ff UHLWb 0 1 iwi0 > # >=20 > All is ok so far, then configure same address on another interface (not w= ireless): >=20 > # ifconfig fxp0 192.168.1.111/23 > # ifconfig fxp0=20 > fxp0: flags=3D8843 mtu 1500 > options=3D8 > inet 192.168.1.111 netmask 0xfffffe00 broadcast 192.168.1.255 > ether 08:00:46:c8:45:b3 > media: Ethernet autoselect (100baseTX ) > status: active >=20 > Ok, routing not changed, now I whant to change route entry 192.168.0/23 -= > iwi0, to 192.168.0/23 -> fxp0 >=20 > # route change 192.168.0/23 -iface fxp0 -cloning=20 > change net 192.168.0: gateway fxp0 > # >=20 > looks like ok, but: >=20 > # netstat -rn > Routing tables >=20 > Internet: > Destination Gateway Flags Refs Use Netif Expire > default 192.168.1.1 UGS 0 511317 iwi0 > 127.0.0.1 127.0.0.1 UH 1 661 lo0 > 192.168.0/23 link#3 UC 0 0 iwi0 > 192.168.1.111 127.0.0.1 UGHS 0 0 lo0 > # >=20 > nothing changed, delete + add works as expected: >=20 > # route delete 192.168.0/23 && route add 192.168.0/23 -iface fxp0 -cloning > delete net 192.168.0 > add net 192.168.0: gateway fxp0 > # netstat -rn > Routing tables >=20 > Internet: > Destination Gateway Flags Refs Use Netif Expire > default 192.168.1.1 UGS 0 511336 iwi0 > 127.0.0.1 127.0.0.1 UH 1 663 lo0 > 192.168.0/23 link#1 UCS 0 0 fxp0 > 192.168.1.111 127.0.0.1 UGHS 0 0 lo0 > # >=20 > (default still goes through wireless, as expected) >=20 > Any ideas what wrong with 'route change' ?=20 >=20 The route(8) manpage says: : In a change or add command where the destination and gateway are not suf- : ficient to specify the route (as in the ISO case where several interfaces : may have the same address), the -ifp or -ifa modifiers may be used to : determine the interface or interface address. So try this instead: route change 192.168.0/23 -ifp fxp0 Cheers, --=20 Ruslan Ermilov ru@FreeBSD.org FreeBSD committer --y0ulUmNC+osPPQO6 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQFB6+JCqRfpzJluFF4RAss0AJ9jG/0NDYCxezzLJC/7Xnz4kNCXaQCePa77 z0Fj8dOhc0QaScl5nWdekBc= =JOob -----END PGP SIGNATURE----- --y0ulUmNC+osPPQO6--