disable wireless upon ethernet connection

I was wondering whether or not there was a method to auto disable my wireless connection whenever I connect through a LAN/ethernet line? I'm looking for a solution that can be done either through a script or program. I've heard of AirSafe but am having trouble getting a hold of a sales rep and was curious about other possible solutions.

Thanks.

Reply to
ericooi
Loading thread data ...

On 10 Jul 2006 12:29:23 -0700, snipped-for-privacy@gmail.com wrote in :

Windows will use the last connection you make.

Reply to
John Navas

John Navas hath wroth:

I beg to differ. Windoze assigns different route metrics to the ethernet and wireless connections. Ethernet is considered the "better" route and is used if available. See my tinkering at: |

formatting link

Why? I'm curious what problem you're trying to solve with such a script or program.

You can just right click on the network connection icons in the system tray and simply disable/enable the required interface.

Or, if just gotta do it with a script or program, try: | netsh interface set interface (nameofInterface) ENABLED | netsh interface set interface (nameofInterface) DISABLED

To get the interface names, run: | netsh interface dump It will probably be something like "Local Area Connecton 3" (with the quotes).

You can also use devcon (device control) program to do the same thing: |

formatting link
extract, and copy devcon.exe to an empty folder. Run: | devcon find * to list all the devices installed. Then run: | devcon disable device_name

Reply to
Jeff Liebermann

On Mon, 10 Jul 2006 22:15:28 -0700, Jeff Liebermann wrote in :

formatting link
I beg to differ back :) -- it's not that simple. For example, I'm now using a Wi-Fi connection with an automatic metric of 25. See The Cable Guy -- April 2005, "Windows XP and Windows Server 2003 Behavior When Connected to Both Wired and Wireless Networks" :

  • If there are multiple default routes with the lowest metric, choose the default route corresponding to the network adapter that is highest in the binding order.

The table right below that quote is more complete than your experiments, with differing metrics for different interfaces. Note that:

  • 10BaseT has the same metric as 802.11b, resolved by binding order.

That what I was thinking of, but of course my statement wasn't correct in the general case. [blush]

  • 10BaseT has a higher metric than 802.11a or 802.11g, and so won't be favored over wireless.

  • 100BaseT trumps everything else.

So if the OP has 100BaseT, then it will automatically take over from wireless, which is what he wants. If on the other hard he has 10BaseT. then it won't trump 802.11a or 802.11g, and might not even trump

802.11b.

Read on in that article for more insight on how to control the metric.

Reply to
John Navas

On Tue, 11 Jul 2006 05:50:55 GMT, John Navas wrote in :

formatting link
I was actually partially correct -- see below.

Since then it's been bugging me why Windows has automatically switched to lower speed connections I've made, which wouldn't seem to make sense given the above. For example, here's a route table with two Internet connections, excellent Wi-Fi "g" at a reported 54 Mbps, and EGPRS(EDGE) at under 200 Kbps over Bluetooth (with a virtual port speed of 460 Kbps):

|Active Routes: |Network Destination Netmask Gateway Interface Metric | 0.0.0.0 0.0.0.0 10.199.205.61 10.199.205.61 1 | 0.0.0.0 0.0.0.0 172.16.8.2 172.16.8.43 26 | 10.199.205.61 255.255.255.255 127.0.0.1 127.0.0.1 50 | 10.255.255.255 255.255.255.255 10.199.205.61 10.199.205.61 50 | 127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1 | 169.254.0.0 255.255.0.0 172.16.8.43 172.16.8.43 30 | 172.16.8.0 255.255.255.0 172.16.8.43 172.16.8.43 25 | 172.16.8.43 255.255.255.255 127.0.0.1 127.0.0.1 25 | 172.16.255.255 255.255.255.255 172.16.8.43 172.16.8.43 25 | 192.168.100.101 255.255.255.255 10.199.205.61 10.199.205.61 1 | 224.0.0.0 240.0.0.0 172.16.8.43 172.16.8.43 25 | 224.0.0.0 240.0.0.0 10.199.205.61 10.199.205.61 1 | 255.255.255.255 255.255.255.255 10.199.205.61 3 1 | 255.255.255.255 255.255.255.255 10.199.205.61 10.199.205.61 1 | 255.255.255.255 255.255.255.255 172.16.8.43 172.16.8.43 1 |Default Gateway: 10.199.205.61

Wi-Fi "g" Interface is 172.16.8.43; EGPRS Interface is 10.199.205.61 The EGPRS Metric of 1 trumps the Wi-Fi "g" Metric of 26 (note how it was bumped up from 25 to 26), making it the Default Gateway. If I now disconnect the EGPRS:

|Active Routes: |Network Destination Netmask Gateway Interface Metric | 0.0.0.0 0.0.0.0 172.16.8.2 172.16.8.43 25 | 127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1 | 169.254.0.0 255.255.0.0 172.16.8.43 172.16.8.43 30 | 172.16.8.0 255.255.255.0 172.16.8.43 172.16.8.43 25 | 172.16.8.43 255.255.255.255 127.0.0.1 127.0.0.1 25 | 172.16.255.255 255.255.255.255 172.16.8.43 172.16.8.43 25 | 224.0.0.0 240.0.0.0 172.16.8.43 172.16.8.43 25 | 255.255.255.255 255.255.255.255 172.16.8.43 3 1 | 255.255.255.255 255.255.255.255 172.16.8.43 172.16.8.43 1 |Default Gateway: 172.16.8.2

This behavior is what I had in mind when I originally wrote, "Windows will use the last connection you make." It happens because EGPRS is a Dial-Up connection. This behavior is controlled by the option "Use default gateway on remote network" in Advanced TCP/IP Settings for Dial-up Network Adapters.

For non-Dial-up Network Adapters, Metrics can be controlled with the Interface Metric option in Advanced TCP/IP Settings. This would allow the OP to do just what he wants no matter the speeds of the wireless and wired connections.

Reply to
John Navas

On 10 Jul 2006 12:29:23 -0700, snipped-for-privacy@gmail.com wrote in :

If your Ethernet is 100BaseT, it will always get preference over Wi-Fi when connected. 10BaseT might not, unless you do the following:

Interface Metrics control which interface will be used at any given time. To display them, Run "ROUTE PRINT" in a Command window. (To see which Interface corresponds to which IP address, Run "IPCONFIG /ALL".) The lowest Metric is given preference, and shown as the Default Route.

Metrics can be controlled with the Interface Metric option in Advanced TCP/IP Settings. To ensure what you want, set the Metric of Wireless to

40, and it will be automatically overridden by Ethernet, even 10BaseT.
Reply to
John Navas

John Navas hath wroth:

(...)

Nice investigation. I was wondering how this worked. I had the same experience. As soon as I fired up a dialup connection, my ethernet connected network connection died and the default route went to the dialup.

I did some digging in the MS Knowledge pile and found:

An explanation of the Automatic Metric feature for Internet Protocol routes

formatting link
The default values for XP SP2 are: Link Speed Metric Greater than 200 Mb 10 Greater than 80 Mb, and less than or equal to 200 Mb 20 Greater than 20 Mb, and less than or equal to 80 Mb 25 Greater than 4 Mb, and less than or equal to 20 Mb 30 Greater than 500 Kb, and less than or equal to 4 Mb 40 Less than or equal to 500 Kb 50

Description of the Wireless LAN Route Table Metric Behavior

formatting link
Configuring Multiple Adapters on the Same Physical Network
formatting link

Reply to
Jeff Liebermann

Cabling-Design.com Forums website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.