DaemonForums  

Go Back   DaemonForums > NetBSD > NetBSD General

NetBSD General Other questions regarding NetBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 18th January 2012
tolstoi tolstoi is offline
Port Guard
 
Join Date: Dec 2011
Posts: 25
Default Start only connected Nic at boot

When I boot NetBSD both services for ethernet and wireless are started even though only one of them, mostly the wireless one are connected.

I'd like to know if there is a way that only the connected nic begins its service.

For example, if the system realizes that there is no ethernet cable connected to just start the wireless one.

I've only added my wireless to rc.conf and that is a little confusing to me why the system tries to bring up the ethernet connection as well.
Reply With Quote
  #2   (View Single Post)  
Old 18th January 2012
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by tolstoi View Post
I'd like to know if there is a way that only the connected nic begins its service.
The kernel loads drivers for the devices it detects upon boot. Drivers can be permanently disabled, but this isn't what you want.

Interfaces are configured through either ifconfig(8) or ifconfig.if(5). If you are wanting to selectively start (configure) your wireless interface based upon whether your wired interface is active (I'm guessing from upon boot...), you will need to write a script which parses the output of ifconfig(8) to determine whether the wired interface is up or down, & depending upon this, pass the appropriate information to ifconfig(8) to configure the wireless interface.

I believe all the information you need is in the manpages cited. Now all you need is to write the script itself.
Reply With Quote
  #3   (View Single Post)  
Old 18th January 2012
tolstoi tolstoi is offline
Port Guard
 
Join Date: Dec 2011
Posts: 25
Default

Thanks. I read something similar to the points you mentioned on hubertf's NetBSD blog but the post was quite old and I thought there could be other solutions meanwhile.
Reply With Quote
  #4   (View Single Post)  
Old 19th January 2012
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by tolstoi View Post
I've only added my wireless to rc.conf and that is a little confusing to me why the system tries to bring up the ethernet connection as well.
I suspect you added a command to ifconfig(8) which configures your wireless interface to rc.conf. This will configure your wireless interface every time you boot.

Most people don't want this. By placing the command into an executable script in your home directory, ~/bin/, or where ever the script can be found on the path, you can manually configure the interface whenever you want.

I also suspect there is an ifconfig.if(5) file specific to your Ethernet interface in /etc/. The purpose of this file is to configure an interface consistently upon every boot. From your comments, this may be source of your confusion. Your Ethernet interface is so configured, but your wireless interface wasn't until you forced a similar configuration into rc.conf.
Reply With Quote
  #5   (View Single Post)  
Old 19th January 2012
shep shep is offline
Real Name: Scott
Arp Constable
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,503
Default

As ocicat alluded to, there are at least 2 ways to starts a network connection
1) From rc.conf
2) From an ifconfig.if file in /etc
If you are looking to automate your connection, once you get them sorted out, there are several options. If your are using wpa_supplicant for your wireless you can set priorities and bring up wired, open-wireless, wep-wireless and wpa(2)-wireless. For example if the wired interface has the highest priority and the cable is plugged in and active it will associate with the wired nic and stop. Search for priority and wpa_supplicant and read the wpa_supplicant man page for more info. Another option is to # the unneeded connection in rc.conf. I think a wireless network manager has also has been ported to NetBSD that will handle wired connections.

Last edited by shep; 19th January 2012 at 01:52 AM. Reason: spelling and punctuation
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
proftpd start at boot wont work jjjustjjjay OpenBSD General 9 28th February 2010 12:40 AM
SATA connected CD/DVD drives, any experience? teig FreeBSD General 13 6th December 2008 01:35 AM
Can start rtorrent like apache and mysql when system boot mfaridi FreeBSD Ports and Packages 0 26th November 2008 09:27 AM
Transmission web inteface start when system boot mfaridi FreeBSD Ports and Packages 2 27th September 2008 06:53 AM
How can I start xscreensaver daemon at boot rex FreeBSD General 7 15th May 2008 02:34 PM


All times are GMT. The time now is 10:06 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick