# Coldplug always activates wireless card

## VinzC

Hi.

I have a Dell Inspiron 6000 and a WiFi card (Intel Corporation PRO/Wireless 2915ABG MiniPCI Adapter (rev 05)). I'm using coldplug 20040920 and baselayout 1.11.12-r1. The wlan interface is eth1. There is a wired ethernet interface, eth0, a broadcom 4401.

Each time I boot my PC eth1 is active and gets its IP address from DHCP servers even after I rc-update -d net.eth1... This is a bit annoying when I must use the wired lan and not the wireless interface.

Is this behaviour by design or is there a fix, workaround or even a hack?

----------

## nielchiano

I think it's designed to do so: you want to bring up all plugged in devices...

Solutions:

Do you mind havinh eth1 up? It doesn't cause your traffic to go over the WLAN. Linux uses the routing table to see to where he should send his traffic. If you tell him to send all traffic (by default) to the wired lan, he'll do that. Only when he sees that he can reach the destination straight on the wlan he'll take that "shortcut"

Workaround: don't plug the WLAN in  :Wink: 

bring it down manualy in /etc/conf.d/local.start

----------

## VinzC

 *nielchiano wrote:*   

> I think it's designed to do so: you want to bring up all plugged in devices...

 

Well, not always in fact.

 *nielchiano wrote:*   

> Do you mind havinh eth1 up? It doesn't cause your traffic to go over the WLAN. Linux uses the routing table to see to where he should send his traffic. If you tell him to send all traffic (by default) to the wired lan, he'll do that. Only when he sees that he can reach the destination straight on the wlan he'll take that "shortcut"

 

See my post https://forums.gentoo.org/viewtopic-t-308330-highlight-dhcp+wireless.html . I must sometimes use DHCP configuration parameters that I receive from eth0 in some cases and from eth1 in some others.

 *nielchiano wrote:*   

> Workaround: don't plug the WLAN in 

 

rotfl  :Very Happy: 

 *nielchiano wrote:*   

> bring it down manualy in /etc/conf.d/local.start

 

Unfortunately this will require me to change net.local as often as I would have to manually switch between interfaces. Maybe creating some sort of network profiles would be cool. I would add to a profile the network interfaces I would like to enable. If I could select which profile to run at boot, for instance, would be even more interresting; a runlevel for instance. Or do you have any other suggestion?

----------

## nielchiano

 *VinzC wrote:*   

> Or do you have any other suggestion?

 

http://www.gentoo.org/doc/en/handbook/handbook-hppa.xml?part=2&chap=4#doc_chap5

----------

## kill

It is actually a bug sorta. Coldplug and Hotplug should not be starting your network devices because that is handled by net.xxx. You may try some of the solutions here to keep your nic from being started.

----------

## VinzC

 *nielchiano wrote:*   

>  *VinzC wrote:*   Or do you have any other suggestion? 
> 
> http://www.gentoo.org/doc/en/handbook/handbook-hppa.xml?part=2&chap=4#doc_chap5

 

Great! exactly what I was looking for. Is it a new article? I don't remember seeing it since I began with Gentoo last year. Note: removing net.eth1 from any runlevel won't help since it's activated anyways. But it's a good start.

----------

## VinzC

 *kill wrote:*   

> It is actually a bug sorta. Coldplug and Hotplug should not be starting your network devices because that is handled by net.xxx. You may try some of the solutions here to keep your nic from being started.

 

Thanks. I can wait till there is a fix. I'll try the "profile" (soft level) first and if I have time I'll dig into it.

----------

## spiryt

use /etc/hotplug/blacklist to disable hotpluging of the module responsible for your wireless nic.

----------

## VinzC

 *spiryt wrote:*   

> use /etc/hotplug/blacklist to disable hotpluging of the module responsible for your wireless nic.

 

Thanks, I'll try that. I suppose I can still use /etc/modules.autoload.d/kernel-2.6 to manually load the module and yet prevent the network interface from being activated?

----------

## spiryt

 *Quote:*   

> Thanks, I'll try that. I suppose I can still use /etc/modules.autoload.d/kernel-2.6 to manually load the module and yet prevent the network interface from being activated?

 

I haven't tested it but it's worth a try. Good Luck

----------

## DieterVDW

I had a similar problem, and solved it by renaming:

/etc/hotplug/net.agent

to

/etc/hotplug/net.agent.disabled

(or make it unexecutable)

Took me a while to find that out  :Rolling Eyes:  .

----------

## VinzC

I think if you put the module name in /etc/modules.autoload.d/kernel-2.6 hotplug won't activate it since autoload occurs before colplug. Hence you won't have to blacklist the module either, I think. I'll try and tell you if it worked. IMHO renaming the net.agent file is a bit too drastic for it will prevent any Plug & Play network interface from being brought up.

----------

## DieterVDW

 *VinzC wrote:*   

> I think if you put the module name in /etc/modules.autoload.d/kernel-2.6 hotplug won't activate it since autoload occurs before colplug. Hence you won't have to blacklist the module either, I think. I'll try and tell you if it worked. IMHO renaming the net.agent file is a bit too drastic for it will prevent any Plug & Play network interface from being brought up.

 

No I tried that already, loading the modules using autoload didn't change a thing...

For me, having no PnP network interfaces, renaming net.agent is the ideal solution.

I'm open for better suggestions though!

----------

## beatryder

do you not have an RF switch?  Just shut it off.

The other option is to find out what modules coldplug is loading, add them to /etc/modules.autoload/kernel2.6

and then axe coldplug.

Thats what I did, I let the modules load, but have the rf switch shut off

and i set the dchp time out to 3 seconds on the wired interface and one on the wireless,

----------

## VinzC

 *DieterVDW wrote:*   

>  *VinzC wrote:*   I think if you put the module name in /etc/modules.autoload.d/kernel-2.6 hotplug won't activate it since autoload occurs before colplug. Hence you won't have to blacklist the module either, I think. I'll try and tell you if it worked. IMHO renaming the net.agent file is a bit too drastic for it will prevent any Plug & Play network interface from being brought up. 
> 
> No I tried that already, loading the modules using autoload didn't change a thing...
> 
> For me, having no PnP network interfaces, renaming net.agent is the ideal solution.
> ...

 

How about spiryt's trick: blacklist the module and put it in /etc/modules.autoload.d/kernel-2.6? Coldplug is responsible for initializing the interface (IP address); if you load it manually the interface is just enabled but the DHCP command has to be run manually.

----------

## DieterVDW

 *VinzC wrote:*   

>  *DieterVDW wrote:*    *VinzC wrote:*   I think if you put the module name in /etc/modules.autoload.d/kernel-2.6 hotplug won't activate it since autoload occurs before colplug. Hence you won't have to blacklist the module either, I think. I'll try and tell you if it worked. IMHO renaming the net.agent file is a bit too drastic for it will prevent any Plug & Play network interface from being brought up. 
> 
> No I tried that already, loading the modules using autoload didn't change a thing...
> 
> For me, having no PnP network interfaces, renaming net.agent is the ideal solution.
> ...

 

Aha that does the trick indeed! Better solution!

I didn't quite know how to use the blacklist, so thanks for clearing that up  :Wink:  .

----------

## VinzC

I think there's a more elegant solution. I still want to activate wlan but only with preferred networks. I then put in preferred_aps_eth1 only those networks I trust and I want to auto-connect. The associate_order variable in /etc/conf.d/wireless must also contain "preferredonly" instead of the default "any". As a personnal policy I must manually connect to non crypted networks while connection to favorite, WEP networks should be automatic.

----------

