On Tue, Jul 24, 2012 at 06:15:02PM +0200, frantisek holop wrote:
> hmm, on Mon, Jul 23, 2012 at 08:10:49PM -0400, Dan Harnett said that
> > On Tue, Jul 24, 2012 at 01:13:29AM +0200, frantisek holop wrote:
> > > what i do: insert the usb wifi (/etc/hostname.urtwn0
> > > contains the correct network data), i disconnect the
> > > ethernet cable, route -n flush, ifconfig re0 down,
> > > sh /etc/netstart.
> > 
> > I would recommend 'ifconfig re0 down delete', and do that before
> > flushing the routing table.  I would also make sure the dhclient
> > process for that interface was dead.
> 
> could you explain the reason behind the order?
> the routing table would contain a default route
> on a non-existing nic, no?

The order is to make sure re0 is no longer associated with anything in
your routing table.  The interface would be down, which makes the
default gateway unreachable anyway.  Considering that you're tearing
down the interface manually, and changing the default route, it hardly
matters that it is temporarily unreachable.

> let's say if trunk did not exist, what would be the correct
> way to do this?

The way you're approaching it is alright.  There are just some oddities
with your setup.

It would be more convenient to just have trunk handle it, though.  Any
connections will not be disrupted and you don't have to mess around with
any part of the network.  You can have hotplugd(8) handle it for you.

/etc/hostname.re0:
up

/etc/hostname.trunk0:
trunkproto failover trunkport re0
dhcp NONE NONE NONE

Then have hotplugd setup urtwn0 on attach.

  ifconfig urtwn0 nwid BLAH wpa wpakey blahblah up
  ifconfig trunk0 trunkport urtwn0

When you want to switch back to the wired interface, just plug the cable
in, wait a few seconds for any autonegotiation, and you can safely
unplug the urtwn0.

Reply via email to