Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Jan 2005 18:40:18 +0300
From:      Vladimir Grebenschikov <vova@fbsd.ru>
To:        John Barbieri <tenpin784@metrocast.net>
Cc:        freebsd-net <net@freebsd.org>
Subject:   Re: Invalid 'route change' functioning
Message-ID:  <1105976418.1229.14.camel@localhost>
In-Reply-To: <41EBD846.7040808@metrocast.net>
References:  <1105974518.1229.9.camel@localhost> <41EBD846.7040808@metrocast.net>

next in thread | previous in thread | raw e-mail | index | archive | help
=F7 =D0=CE, 17/01/2005 =D7 10:22 -0500, John Barbieri =D0=C9=DB=C5=D4:
> Vladimir Grebenschikov wrote:
>=20
> >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=3D8843<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 Expi=
re
> >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=20
> >fxp0: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
> >        options=3D8<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=20
> >change net 192.168.0: gateway fxp0
> >#
> >
> >looks like ok, but:
> >
> ># netstat -rn
> >Routing tables
> >
> >Internet:
> >Destination        Gateway            Flags    Refs      Use  Netif Expi=
re
> >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 -cloni=
ng
> >delete net 192.168.0
> >add net 192.168.0: gateway fxp0
> ># netstat -rn
> >Routing tables
> >
> >Internet:
> >Destination        Gateway            Flags    Refs      Use  Netif Expi=
re
> >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' ?=20
> >
> > =20
> >
>=20
> why not do route delete default, down the wireless, then route add=20
> default 192.168.1.1 (and maybe even throw in an interface tag at the=20
> same time to make sure)
>=20
> ive never really had luck with the change command, if i was on the same=20
> lan as the box, i always just delete the default and re-add it.

Yes, of course, simple case works, but, let's imagine - you have active
connection and you do now want to loose it, if there are no route while
packet sent (between del and add route) - program gets ENETUNREACH and
connection will be closed.

> just my 2 cents worth

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



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