# How to prevent net.eth0/wlan0 to start?

## Ray ishido

Hello,

surely a noob question but I don't find the answer:

Net.eth0 and net.wlan0 start at boot, but they are not programmed to start:

```
raoul ray # rc-update show          

                  lvm | boot                                          

                  xdm |      default                                  

                 fsck | boot                                          

                 hald |      default                                  

                 mtab | boot                                          

                 root | boot                                          

                 swap | boot                                          

                 udev |                                 sysinit       

              keymaps | boot                                          

                devfs |                                 sysinit       

                dmesg |                                 sysinit       

                local |      default          nonetwork               

            savecache |              shutdown                         

       NetworkManager |      default                                  

           localmount | boot                                          

          consolefont | boot                                          

             firewall |      default                                  

               dhcdbd |      default                                  

              modules | boot                                          

             hostname | boot                                          

             mount-ro |              shutdown                         

               net.lo | boot                                          

               procfs | boot                                          

             netmount |      default                                  

               sysctl | boot                                          

              urandom | boot                                          

         termencoding | boot                                          

       udev-postmount |      default                                  

              hwclock | boot                                          

             bootmisc | boot                                          

        device-mapper | boot                                          

            alsasound |      default                                  

            killprocs |              shutdown   
```

so, How do I prevent them from starting?

----------

## erik258

Hello, 

your network interfaces are being automatically started by, um, either hotplug or coldplug.  See /etc/conf.d/rc to modify which services are started automatically.  Take a look at lines 39-46 in particular.  They describe how to add entries in RC_PLUG_SERVICES so that particular network interfaces don't automatically start.  

For your purposes something like this should do the job:

```
RC_PLUG_SERVICES="!net.*"
```

Incidentally you may also want to look at lines 48-61. Setting 

```
RC_STRICT_CHECKING="lo" 
```

will make your computer consider networking up (a requirement for rc services like sshd and nfsmount) if the local loopback device is up (which it pretty much always is).  This allows you to shift between networks at will without stopping and restarting services that depend on networking, and is pretty much essential for laptops or other devices that move around a lot.

----------

## Ray ishido

Hi,

thank you for your answer.

It didn't solve the pb. here is my /etc/conf.d/rc (only the lines that are not commented) 

```

RC_TTY_NUMBER=11

RC_PARALLEL_STARTUP="no"

RC_INTERACTIVE="yes"

RC_HOTPLUG="yes"

RC_COLDPLUG="yes"

[b]RC_PLUG_SERVICES="!net.*"[/b]

[b]RC_NET_STRICT_CHECKING="lo"[/b]

RC_DOWN_INTERFACE="yes"

RC_VOLUME_ORDER="raid evms lvm dm"

RC_VERBOSE="no"

RC_BOOTLOG="no"

RC_BOOTCHART="no"

RC_USE_FSTAB="no"

RC_USE_CONFIG_PROFILE="yes"

RC_FORCE_AUTO="no"

RC_DEVICES="auto"

RC_DEVICE_TARBALL="no"

RC_DMESG_LEVEL="1"

RC_RETRY_KILL="yes"

RC_RETRY_TIMEOUT=1

RC_RETRY_COUNT=5

RC_FAIL_ON_ZOMBIE="no"

RC_KILL_CHILDREN="no"

RC_WAIT_ON_START="0.1"

svcdir="/var/lib/init.d"

svcmount="no"

svcfstype="tmpfs"

svcsize=2048
```

I really don't understand why the system bring up eth0 and wlan0 on boot.

----------

## kmare

you have

[ b ]RC_PLUG_SERVICES="!net.*"[ /b ]

[ b ]RC_NET_STRICT_CHECKING="lo"[ /b ] 

in your file.. you should remove the [ b ] and [ /b ] .

----------

## Ray ishido

hi, 

No, in the file [ b ]  and [ /b ] are not present. I wanted to underline those lines in my post but didn't notice it didn't function.

----------

## VinzC

 *Ray ishido wrote:*   

> hi, 
> 
> No, in the file [ b ]  and [ /b ] are not present. I wanted to underline those lines in my post but didn't notice it didn't function.

 

Highlighting doesn't work within a [code] block. Use [quote] instead.

----------

## erik258

phpBB formatting aside, that seems right to me.  Do you have any net.* devices in your rc-scripts?  Boot and default shouldn't contain them

----------

## luispa

Not sure, but just in case, there are several "need net" in the other init.d scripts. 

will them launch the net.* ?

Luis

----------

## VinzC

 *Quote:*   

> RC_TTY_NUMBER=11
> 
> RC_PARALLEL_STARTUP="no"
> 
> RC_INTERACTIVE="yes"
> ...

 

 *Ray ishido wrote:*   

> I really don't understand why the system bring up eth0 and wlan0 on boot.

 

Udev triggers network scripts as soon as it's activated -- see boot messages before any other services. As a quick check, unset RC_PLUG_SERVICES and see what happens.

```
raoul ray # rc-update show          

...

       NetworkManager |      default                                  

...

             netmount |      default                                  

...
```

BTW Isn't NetworkManager supposed to start these network devices?

----------

## WastingBody

NetworkManager will start those devices on their own. Put this in your "/etc/conf.d/local.start"; it will disable NetworkManager from starting the wireless interface until you want to start it with the applet.

```
dbus-send --system --type=method_call --dest=org.freedesktop.NetworkManager \

   /org/freedesktop/NetworkManager org.freedesktop.DBus.Properties.Set \

   string:org.freedesktop.NetworkManager string:WirelessEnabled \

   variant:boolean:false
```

----------

## VinzC

```
dbus-send --system --type=method_call --dest=org.freedesktop.NetworkManager \

   /org/freedesktop/NetworkManager org.freedesktop.DBus.Properties.Set \

   string:org.freedesktop.NetworkManager string:WirelessEnabled \

   variant:boolean:false
```

 *WastingBody wrote:*   

> NetworkManager will start those devices on their own. Put this in your "/etc/conf.d/local.start"; it will disable NetworkManager from starting the wireless interface until you want to start it with the applet.

 

Wow! Looks like some people are making GNU desktop et al. as complex and non-obvious to manage as Window$...  :Laughing:   :Laughing:   :Laughing:   :Laughing: 

----------

## WastingBody

It would be nice to have one of those nifty little check boxes that could disable networking by default.

----------

## joeklow

 *WastingBody wrote:*   

> NetworkManager will start those devices on their own. Put this in your "/etc/conf.d/local.start"; it will disable NetworkManager from starting the wireless interface until you want to start it with the applet.
> 
> ```
> dbus-send --system --type=method_call --dest=org.freedesktop.NetworkManager \
> 
> ...

 

Any way to include this functionality into NetworkManager init.d script (without modifying it)?

I have some weird problems with NM/DBUS/ACPI/ath9k device working together, e.g. unpredicable shutdowns (cant power on until AC power cut for seconds)

 *VinzC wrote:*   

> 
> 
> Wow! Looks like some people are making GNU desktop et al. as complex and non-obvious to manage as Window$...    

 

Unobvious hacks are for features, that are normally unexpected even at developer station and network's geek laptop, right?

However, that Ubuntish NM really drives me crazy.

----------

## divago

hi, i got same problem here

(net.eth0 and net.wlan0 still start even if i rc-update deleted it, and NetworkManager/wicd does'nt start)

btw someone adviced me to just delete /etc/init.d/net.eth0 and /etc/init.d/net.wlan0 script; i dunno if this is working, 'cause at the moment i cannot reboot the pc  :Smile:  so i'll try it as soon as possible

hope this could help you  :Smile: 

----------

## skellr

Also make sure that net.wlan0 or net.eth0 isn't a symlink to net.lo in /etc/init.d/

----------

## divago

 *skellr wrote:*   

> Also make sure that net.wlan0 or net.eth0 isn't a symlink to net.lo in /etc/init.d/

 

ok in my case net.eth0 and net.wlan0 was link to net.lo

so i unlinked it with

```
unlink /etc/init.d/net.eth0

unlink /etc/init.d/net.wlan0
```

and now it works fine  :Smile:  net start with NM (or wicd) and also start sshd...

----------

## trossachs

I have a similar problem in that whenever I start eth1, it defaults to dhcp and requests an address even though I have specifically specified a static one. Why does it not read from /etc/conf.d/net?

```
iface_eth1="192.168.1.6 netmask 255.255.255.0 brd 192.168.1.0"

routes_eth1="default via 192.168.1.1"
```

----------

## bornmw

 *skellr wrote:*   

> Also make sure that net.wlan0 or net.eth0 isn't a symlink to net.lo in /etc/init.d/

 

but http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4&chap=1 says it should be a symlink

----------

## bornmw

just for the record - /etc/conf.d/rc is baselayout 1 and is now deprecated

use /etc/rc.conf which is baselayout 2

----------

