Invalid 'route change' functioning
Ruslan Ermilov
ru at FreeBSD.org
Mon Jan 17 08:05:57 PST 2005
On Mon, Jan 17, 2005 at 06:08:38PM +0300, Vladimir Grebenschikov wrote:
> Hi
>
> 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:
>
>
> # ifconfig iwi0
> iwi0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> 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
>
> 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
> #
>
> All is ok so far, then configure same address on another interface (not wireless):
>
> # ifconfig fxp0 192.168.1.111/23
> # ifconfig fxp0
> fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
> options=8<VLAN_MTU>
> inet 192.168.1.111 netmask 0xfffffe00 broadcast 192.168.1.255
> ether 08:00:46:c8:45:b3
> media: Ethernet autoselect (100baseTX <full-duplex>)
> status: active
>
> Ok, routing not changed, now I whant to change route entry 192.168.0/23 -> iwi0, to 192.168.0/23 -> fxp0
>
> # route change 192.168.0/23 -iface fxp0 -cloning
> change net 192.168.0: gateway fxp0
> #
>
> looks like ok, but:
>
> # netstat -rn
> Routing tables
>
> 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
> #
>
> nothing changed, delete + add works as expected:
>
> # 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
>
> 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
> #
>
> (default still goes through wireless, as expected)
>
> Any ideas what wrong with 'route change' ?
>
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,
--
Ruslan Ermilov
ru at FreeBSD.org
FreeBSD committer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-net/attachments/20050117/48d0a207/attachment.bin
More information about the freebsd-net
mailing list