Subject: Re: changing default network interfaces
To: Felix Zaslavskiy <felix@students.poly.edu>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: netbsd-users
Date: 03/10/2003 21:32:35
On Mon, Mar 10, 2003 at 12:16:39PM -0500, Felix Zaslavskiy wrote:
> I was just wondering .
> I recently stuck a cardbus NIC someone game me and it was configured as 
> xi0 in addition to the other NIC i already had.
> 
> What i wanted to do was to switch the default interface from my othen 
> NIC to the one i just inserted.
> So the nic i wanted to switch from is ex0 and i wanted to switch to 
> using xi0
> i already had ex0 configutred on the network , This is what i did
> ifconfig ex0 down
> route flush
> ifconfig xi0 up
> dhclient xi0
> 
> I thought this would do the trick but after doing netstat -r i had 
> something like this
> 192.168.0.0  default     Iface ex0
> 
> After rebooting the xi0 was used correctly.
> What did i miss ? How can i do it without rebooting ? man pages for 
> route dont seem to say anything about intefaces

You probably want to kill dhclient on ex0 first.
Also check if the ex0 address was inconfigured. If not, do:
ifconfig ex0 inet delete

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 24 ans d'experience feront toujours la difference
--