Networking

Howard Coles Jr. dhcolesj at gmail.com
Thu Apr 5 21:28:13 UTC 2007


On Thursday 05 April 2007 12:50:17 pm Andy Harrison wrote:
> On 4/5/07, OOzy Pal <oozypal at gmail.com> wrote:
> > I need to setup my wireless router (ADSL). My Kubuntu can find two cards
> >
> > eth0 (Ethernet) and eth1 (Wireless)
> >
> > I need to disable eth0 and keep eth1 up and running for wireless. How
> > can I do this? Do I actually need to disable eth0 to work with eth1?
> >
> > BTW, no mater what I do in /etc/network/interfaces when I go to K
> > Menu>>System Settings >> Network Settings I see different parameters
> > and IP addresses. If I disable eth0 from there and restart the
> > computer, the eth0 is enabled again.
>
> Under Network Settings, I created two different profiles, one for work
> and one for the office.  I do disable one nic or the other in either
> profile.  However, even after I load the home profile, I do have to
> run the following little script that I wrote...
>
> There's probably a better way, but I haven't bothered to research it
> very thoroughly...
>
> #!/bin/sh
>
> if [ -x "`which sudo`" ] ; then
>     SUDO="`which sudo`"
> fi
>
> ${SUDO} iwconfig eth1 essid "MySSID"            &&
> ${SUDO} iwconfig eth1 mode Managed                  &&
> ${SUDO} iwconfig eth1 ap any                        &&
> ${SUDO} iwconfig eth1 key restricted 1 FFFFFFFFFF   &&
> ${SUDO} dhclient eth1

IF your network/interfaces file is setup correctly all you have to do is ifup 
and ifdown the right interfaces.  I'm assuming here you are using two 
different nics for home and office?

if eth0 is office, and eth1 is home:
at home:
ifdown eth0
ifdown eth1
ifup eth1

at office:
ifdown eth0
ifdown eth1
ifup eth0

both ifdowns are potentially necessary if the wrong interface grabbed the 
default route first.  If this happens when you ifdown it you'll lose your 
ability to communicate to the rest of the world (assuming anything is plugged 
into it at all).

Now, if you are using the same nic to connect to different locations there are 
better ways, and if anyone has those figured out I'd like to know as well.  
Because network manager just doesn't work.  


-- 
See Ya'
Howard Coles Jr.
John 3:16!




More information about the kubuntu-users mailing list