LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 10-29-2006, 11:47 PM   #1
earthmeLon
LQ Newbie
 
Registered: Oct 2006
Distribution: SUSE 10.1(x32)
Posts: 10

Rep: Reputation: 0
Trouble with multiple ethernet connections


Hello friends at LinuxQuestions, I have a question for you.

I have set up my wireless connection to my router perfectly. (Thanks to the forums here) But:


Whenever I am connected to the router wirelessly and then I put a cable in my ethernet port, it is as if my wireless connection dissapears. My internet access gets terminated. The cable is connected to a switch on a separate (soon-to-be)network with nothing else connected to it

Any suggestions?
 
Old 10-30-2006, 10:04 AM   #2
Quigi
Member
 
Registered: Mar 2003
Location: Cambridge, MA, USA
Distribution: Ubuntu (Dapper and Heron)
Posts: 377

Rep: Reputation: 31
I have the same situation: Wireless to the router to the outside world. Ethernet cable just to my printer. Same happens here: When I plug in the cable, that network (192.168.3.0/24) takes over, and "supersedes" the wireless 192.168.2.0/24. (In my case it's the collaboration of CNC (Constant Network Connection, the primary agent) with wpa_supplicant and dhclient that achieves this.)

In particular, when I plug in the cable, the wireless connection is still fine (as, e.g., ifconfig and iwconfig confirm), but DNS and default routing get redirected to the 192.168.3.0.

The fix: I manually set things back.
Code:
echo nameserver 192.168.2.1 > /etc/resolv.conf
route del default
route add default gw 192.168.2.1
Only root can route and overwrite /etc/resolv.conf.
I assume there must be a more elegant way. (Like bringing the wired interface up manually with ifconfig? Running as DHCP and DNS server on that interface instead of client?)
 
Old 11-01-2006, 12:15 AM   #3
earthmeLon
LQ Newbie
 
Registered: Oct 2006
Distribution: SUSE 10.1(x32)
Posts: 10

Original Poster
Rep: Reputation: 0
Wow. Thanks. I really appreciate the fix. It was getting really annoying.

Does anybody know an automated version?
 
Old 11-01-2006, 12:38 AM   #4
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Quigi, is there a config file where you can tell CNC (or maybe one of the other programs) to keep its hands off certain subnets?
 
Old 11-01-2006, 08:28 AM   #5
Quigi
Member
 
Registered: Mar 2003
Location: Cambridge, MA, USA
Distribution: Ubuntu (Dapper and Heron)
Posts: 377

Rep: Reputation: 31
blackhole54, I don't know about any such configuration file. My box comes from EmperorLinux, so I use EmpTool->Wireless Scan. I talked to EmperorLinux support, and they said by having more than one interface, I'm more sophisticated than most normal users, and the tool doesn't support it.

First I click "start networking" to establish the wireless connection wlan0.
Then I click "stop networking" so CNC leave it alone.
Finally I bring up the cable connection eth0 (which takes over), and fix it as above.

I suspect ifup messes with resolv (DNS) and route. Probably I could use ifconfig instead, maybe together with dhclient. Also, as I hinted above, it might be better to be the DHCP server instead of client on the wired interface, and make this machine the gateway for everything on the 192.168.3.0/24 network. But I don't have this all figured out.
 
Old 11-01-2006, 01:59 PM   #6
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Re: Config files

Quigi, I had a few more thoughts after my last post (middle of the night sort of thing ) ...

It's possible I have no idea what I am talking about, so make sure you make backup copies of any existing config files before you change any.

dhclient's config file seems to be able to support different options for different interfaces, or even disabling DHCP on arbitrary interfaces entirely. The following sample file is from the config file's man page:

Code:
timeout 60;
retry 60;
reboot 10;
select-timeout 5;
initial-interval 2;
reject 192.33.137.209;

interface "ep0" {
    send host-name "andare.fugue.com";
    send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
    send dhcp-lease-time 3600;
    supersede domain-name "fugue.com rc.vix.com home.vix.com";
    prepend domain-name-servers 127.0.0.1;
    request subnet-mask, broadcast-address, time-offset, routers,
            domain-name, domain-name-servers, host-name;
    require subnet-mask, domain-name-servers;
    script "/sbin/dhclient-script";
    media "media 10baseT/UTP", "media 10base2/BNC";
}

alias {
  interface "ep0";
  fixed-address 192.5.5.213;
  option subnet-mask 255.255.255.255;
}
I am looking in particular at the request and require lines. I am thinking perhaps if you remove domain-name-servers and routers from these lines for ethernet (but not wireless) your problems would go away. I have only just perused the man pages and I don't know what your existing config file (assuming one even exists) looks like, so you need to do your own due diligence.

I hope this helps you and earthmeLon.
 
Old 11-02-2006, 11:48 AM   #7
Quigi
Member
 
Registered: Mar 2003
Location: Cambridge, MA, USA
Distribution: Ubuntu (Dapper and Heron)
Posts: 377

Rep: Reputation: 31
Thanks blackhole54 for the excellent pointers. I will experiment a bit and see what changing these two options can do for me. E.g., if I instruct dhclient not to request domain-name-servers, will it leave /etc/resolv.conf alone? By the way, my config file as supplied looks like this,
Code:
request subnet-mask, broadcast-address, time-offset, routers,
        domain-name, domain-name-servers, host-name,
        netbios-name-servers, netbios-scope;
(The rest is comments.) I.e., it relies largely on defaults.
 
Old 11-02-2006, 03:15 PM   #8
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
I believe your config file treats all interfaces identically, where the sample file I quoted (I believe) shows how to break it out by interface.

I would imagine the best thing is to break it out by interface and leave your wireless with the existing options. I would then expect that removing the router and domain-name-servers from the options for ethernet would prevent that interface from mucking with your /etc/resolv.conf file and your routing table.

Good luck.

Last edited by blackhole54; 11-02-2006 at 03:20 PM.
 
  


Reply

Tags
connection, multiple


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple internet connections kojie Linux - Networking 2 12-08-2004 03:19 PM
Multiple Wireless Connections vanv101 Slackware 7 10-24-2004 07:39 AM
BNC connections on ethernet cards StressedLemming Linux - Networking 1 10-31-2003 01:00 PM
multiple ethernet connections in redhat 8.0 kkempter Linux - Networking 3 02-07-2003 03:38 AM
ethernet connections vicente Linux - Networking 1 09-30-2001 12:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 04:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration