LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-31-2013, 01:21 PM   #1
Z038
Member
 
Registered: Jan 2006
Location: Dallas
Distribution: Slackware
Posts: 912

Rep: Reputation: 174Reputation: 174
Prevent wireless connection when wired interface is used


The system is an IBM Thinkpad T43 running Slackware. It has both a wired and a wireless NIC. If I plug in the wired connection, dhcpcd polls for an IP address on both eth0 (wired) and eth1 (wireless), and I get a unique IP address assigned to each. If I'm using the wired connection, I don't want the wireless to be used. How can I stop the wireless interface from seeking a connection when the wired NIC is in use?

Here are the messages I get during bootup from dhcpcd:

Code:
Polling for DHCP server on interface eth0:
dhcpcd[1459]: version 5.5.6 starting
dhcpcd[1459]: all: not configured to accept IPv6 RAs
dhcpcd[1459]: eth0: carrier acquired
dhcpcd[1459]: eth0: carrier lost
dhcpcd[1459]: eth0: waiting for carrier
dhcpcd[1459]: eth0: carrier acquired
dhcpcd[1459]: eth0: broadcasting for a lease
dhcpcd[1459]: eth0: offered 192.168.1.207 from 192.168.1.15
dhcpcd[1459]: eth0: acknowledged 192.168.1.207 from 192.168.1.15
dhcpcd[1459]: eth0: checking for 192.168.1.207
dhcpcd[1459]: timed out
dhcpcd[1459]: allowing 8 seconds for IPv4LL timeout
dhcpcd[1459]: eth0: leased 192.168.1.207 for 86400 seconds
dhcpcd[1459]: forked to background, child pid 1524
/etc/rc.d/rc.M:  eth1 information: 'Any ESSID'
Polling for DHCP server on interface eth1:
dhcpcd[1587]: version 5.5.6 starting
dhcpcd[1587]: all: not configured to accept IPv6 RAs
dhcpcd[1587]: eth1: broadcasting for a lease
dhcpcd[1587]: eth1: offered 192.168.1.208 from 192.168.1.15
dhcpcd[1587]: eth1: acknowledged 192.168.1.208 from 192.168.1.15
dhcpcd[1587]: eth1: checking for 192.168.1.208
dhcpcd[1587]: eth1: leased 192.168.1.208 for 86400 seconds
dhcpcd[1587]: forked to background, child pid 1640
Here is the output from ifconfig, and you can see that both interfaces have sent and received packets.

Code:
root@T7T:~# ifconfig -a
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.207  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::211:25ff:fe49:8fb0  prefixlen 64  scopeid 0x20<link>
        ether 00:1e:41:43:8e:c0  txqueuelen 1000  (Ethernet)
        RX packets 463  bytes 276308 (269.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 372  bytes 58389 (57.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 16

eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.208  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::212:f0ff:fe5b:303b  prefixlen 64  scopeid 0x20<link>
        ether 00:14:f3:7b:30:3c  txqueuelen 1000  (Ethernet)
        RX packets 468  bytes 48083 (46.9 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 16  bytes 1683 (1.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 21  base 0x6000  memory 0xa8401000-a8401fff

irda0: flags=128<NOARP>  mtu 2048
        irda 00:00:00:00  txqueuelen 8  (IrLAP)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 16436
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
Here is the output from iwconfig:

Code:
root@T7T:~# iwconfig
lo        no wireless extensions.

eth1      IEEE 802.11abg  ESSID:"skynet"  Nickname:"T7T"
          Mode:Managed  Frequency:2.462 GHz  Access Point: 00:1E:9B:F1:65:06
          Bit Rate:54 Mb/s   Tx-Power=20 dBm   Sensitivity=8/0
          Retry limit:7   RTS thr:off   Fragment thr:off
          Encryption key:9B71-A1C9-5D48-30CF-9A3E-31B0-E4BC-4778   Security mode:open
          Power Management:off
          Link Quality=99/100  Signal level=-21 dBm  Noise level=-89 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

irda0     no wireless extensions.

eth0      no wireless extensions.

I don't have an external switch on this laptop to disable the wireless NIC. So I need to be able to detect during the boot process whether the wired NIC is active, and if so, avoid activating the wireless one.

Thanks for any help you can offer on this.
 
Old 03-31-2013, 03:53 PM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,221

Rep: Reputation: 2539Reputation: 2539Reputation: 2539Reputation: 2539Reputation: 2539Reputation: 2539Reputation: 2539Reputation: 2539Reputation: 2539Reputation: 2539Reputation: 2539
Many laptops have something like 'Fast Ethernet Switching' in the Bios. That disables the second card once you configure one. It you have it in startup scripts, that can get messy.
 
Old 04-01-2013, 01:49 AM   #3
Z038
Member
 
Registered: Jan 2006
Location: Dallas
Distribution: Slackware
Posts: 912

Original Poster
Rep: Reputation: 174Reputation: 174
I can set the wireless interface to Enabled, Disabled, or Radio Off in BIOS. Having to change BIOS whenever I want to switch from wireless to wired operation or vice versa isn't something I'm interested in doing. Changing startup scripts can't be as messy as changing BIOS continually.
 
Old 04-01-2013, 05:13 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,221

Rep: Reputation: 2539Reputation: 2539Reputation: 2539Reputation: 2539Reputation: 2539Reputation: 2539Reputation: 2539Reputation: 2539Reputation: 2539Reputation: 2539Reputation: 2539
Yeah, I was thinking if you have startup scripts, they will talk to one card before the other. That enables that and disables the second nic, often regardless of whether the first comes has a link.

I think you need a script with a question in it. Maybe see if you can do something with rfkill or acpi.
 
Old 04-01-2013, 06:52 AM   #5
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,196

Rep: Reputation: 1044Reputation: 1044Reputation: 1044Reputation: 1044Reputation: 1044Reputation: 1044Reputation: 1044Reputation: 1044
You can use Networkmanager. Or KNetworkmanager if you are running KDE. It works surprisingly well for something that does most actions automagically.

For one, you can disable the wireless from a simple tray icon. If I am not mistaken, if you have both wired and wireless connection, Networkmanager prefers to use the wired connection as default.

jlinkels
 
Old 04-01-2013, 10:40 AM   #6
Z038
Member
 
Registered: Jan 2006
Location: Dallas
Distribution: Slackware
Posts: 912

Original Poster
Rep: Reputation: 174Reputation: 174
I would prefer to avoid starting the wireless interface at all during boot up if the wired interface is active. Activating it when I don't need it just takes extra time during boot up. Perhaps I can do it in /etc/rc.d/rc.inet1.
 
  


Reply


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
[SOLVED] DSL connection slow on Linux wired connection but fast on Windows wireless Pandarsson Linux - Wireless Networking 9 12-17-2010 06:55 PM
Problem Bridging Wired Interface to Wireless Interface. JivanAmara Linux - Networking 0 08-17-2009 02:25 AM
Bridging Wireless interface with the Wired one hohenzolern Linux - Wireless Networking 3 04-04-2006 04:49 PM
Wired interface priority over wireless in Debian Debian_Poland Linux - Wireless Networking 5 02-03-2006 12:51 PM
Laptop-net on wired/wireless interface blueplazma Linux - Wireless Networking 2 12-24-2004 03:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:07 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