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? |
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 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?) |
Wow. Thanks. I really appreciate the fix. It was getting really annoying.
Does anybody know an automated version? |
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?
|
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. |
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; I hope this helps you and earthmeLon. |
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, |
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. |
All times are GMT -5. The time now is 11:37 PM. |