Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

How to prevent net.eth0/wlan0 to start?

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
19 posts • Page 1 of 1
Author
Message
Ray ishido
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 141
Joined: Tue Jan 17, 2006 12:30 pm
Location: Piracicaba (Brazil)

How to prevent net.eth0/wlan0 to start?

  • Quote

Post by Ray ishido » Sun Nov 29, 2009 7:14 pm

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:

Code: Select all

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?
Top
erik258
Advocate
Advocate
User avatar
Posts: 2650
Joined: Tue Apr 12, 2005 8:39 pm
Location: Twin Cities, Minnesota, USA
Contact:
Contact erik258
Website

  • Quote

Post by erik258 » Sun Nov 29, 2009 8:58 pm

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:

Code: Select all

RC_PLUG_SERVICES="!net.*"
Incidentally you may also want to look at lines 48-61. Setting

Code: Select all

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.
Configuring a Firewall? Try my iptables configuration
LinuxCommando.com is my blog for linux-related scraps and tidbits. Stop by for a visit!
Top
Ray ishido
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 141
Joined: Tue Jan 17, 2006 12:30 pm
Location: Piracicaba (Brazil)

  • Quote

Post by Ray ishido » Mon Nov 30, 2009 1:36 am

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)

Code: Select all

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.
Top
kmare
l33t
l33t
User avatar
Posts: 619
Joined: Sat Nov 20, 2004 8:28 pm
Location: Thessaloniki, Greece

  • Quote

Post by kmare » Mon Nov 30, 2009 9:11 pm

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 ] .
Never argue with an idiot. They will only pull you down to their level, then beat you with experience.
Top
Ray ishido
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 141
Joined: Tue Jan 17, 2006 12:30 pm
Location: Piracicaba (Brazil)

  • Quote

Post by Ray ishido » Tue Dec 01, 2009 1:05 pm

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.
Top
VinzC
Watchman
Watchman
User avatar
Posts: 5100
Joined: Sat Apr 17, 2004 1:51 pm
Location: Dark side of the mood

  • Quote

Post by VinzC » Tue Dec 01, 2009 4:10 pm

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: Select all

 block. Use [quote] instead.
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Top
erik258
Advocate
Advocate
User avatar
Posts: 2650
Joined: Tue Apr 12, 2005 8:39 pm
Location: Twin Cities, Minnesota, USA
Contact:
Contact erik258
Website

  • Quote

Post by erik258 » Sun Dec 06, 2009 12:21 am

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
Configuring a Firewall? Try my iptables configuration
LinuxCommando.com is my blog for linux-related scraps and tidbits. Stop by for a visit!
Top
luispa
Guru
Guru
Posts: 359
Joined: Fri Mar 17, 2006 10:46 pm
Location: España

  • Quote

Post by luispa » Sun Dec 06, 2009 7:54 am

Not sure, but just in case, there are several "need net" in the other init.d scripts.
will them launch the net.* ?

Luis
Top
VinzC
Watchman
Watchman
User avatar
Posts: 5100
Joined: Sat Apr 17, 2004 1:51 pm
Location: Dark side of the mood

  • Quote

Post by VinzC » Sun Dec 06, 2009 10:31 am

RC_TTY_NUMBER=11
RC_PARALLEL_STARTUP="no"
RC_INTERACTIVE="yes"
RC_HOTPLUG="yes"
RC_COLDPLUG="yes"
RC_PLUG_SERVICES="!net.*"
RC_NET_STRICT_CHECKING="lo"
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
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.

Code: Select all

raoul ray # rc-update show          
...

       NetworkManager |      default                                  
...
             netmount |      default                                  
...
BTW Isn't NetworkManager supposed to start these network devices?
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Top
WastingBody
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 105
Joined: Fri May 09, 2008 11:37 pm

  • Quote

Post by WastingBody » Sun Dec 06, 2009 7:07 pm

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.

Code: Select all

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
Top
VinzC
Watchman
Watchman
User avatar
Posts: 5100
Joined: Sat Apr 17, 2004 1:51 pm
Location: Dark side of the mood

  • Quote

Post by VinzC » Sun Dec 06, 2009 9:45 pm

Code: Select all

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$... :lol: :lol: :lol: :lol:
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Top
WastingBody
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 105
Joined: Fri May 09, 2008 11:37 pm

  • Quote

Post by WastingBody » Sun Dec 06, 2009 11:14 pm

It would be nice to have one of those nifty little check boxes that could disable networking by default.
Top
joeklow
n00b
n00b
User avatar
Posts: 46
Joined: Sun Jan 23, 2011 11:58 am

  • Quote

Post by joeklow » Thu Mar 24, 2011 12:43 am

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.

Code: Select all

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
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$... :lol: :lol: :lol: :lol:
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.
Top
divago
Tux's lil' helper
Tux's lil' helper
Posts: 84
Joined: Fri Jun 04, 2010 9:10 pm

  • Quote

Post by divago » Thu Mar 24, 2011 9:42 am

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 :) so i'll try it as soon as possible

hope this could help you :)
Top
skellr
Veteran
Veteran
User avatar
Posts: 1037
Joined: Sat Jun 18, 2005 1:34 am
Location: The Village, Portmeirion

  • Quote

Post by skellr » Thu Mar 24, 2011 12:24 pm

Also make sure that net.wlan0 or net.eth0 isn't a symlink to net.lo in /etc/init.d/
Top
divago
Tux's lil' helper
Tux's lil' helper
Posts: 84
Joined: Fri Jun 04, 2010 9:10 pm

  • Quote

Post by divago » Thu Mar 24, 2011 2:52 pm

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

Code: Select all

unlink /etc/init.d/net.eth0
unlink /etc/init.d/net.wlan0
and now it works fine :) net start with NM (or wicd) and also start sshd...
Top
trossachs
Veteran
Veteran
User avatar
Posts: 1204
Joined: Thu Jan 22, 2004 9:48 am
Location: London

  • Quote

Post by trossachs » Fri Nov 04, 2011 8:49 am

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?

Code: Select all

iface_eth1="192.168.1.6 netmask 255.255.255.0 brd 192.168.1.0"
routes_eth1="default via 192.168.1.1"
Top
bornmw
n00b
n00b
Posts: 49
Joined: Mon Apr 13, 2009 4:23 am

  • Quote

Post by bornmw » Fri Dec 02, 2011 5:56 pm

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/h ... t=4&chap=1 says it should be a symlink
Top
bornmw
n00b
n00b
Posts: 49
Joined: Mon Apr 13, 2009 4:23 am

  • Quote

Post by bornmw » Fri Dec 02, 2011 6:57 pm

just for the record - /etc/conf.d/rc is baselayout 1 and is now deprecated
use /etc/rc.conf which is baselayout 2
Top
Post Reply

19 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic