Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Starting wireless at boot questions
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Kasumi_Ninja
Veteran
Veteran


Joined: 18 Feb 2006
Posts: 1825
Location: The Netherlands

PostPosted: Wed Oct 03, 2007 4:06 pm    Post subject: Starting wireless at boot questions Reply with quote

Now that I managed to connect to my wifi I would like to connect automatically every time the system start. I have read
Gentoo Network Configuration guide but I have still some questions left. For starters does my /etc/conf.d/net configuration make sense? (is ndiswrapper actually a driver?). Or do I need to add some improvements?

# cat /etc/conf.d/net
Code:
# This blank configuration will automatically use DHCP for any net.*
# scripts in /etc/init.d.  To create a more complete configuration,
# please review /etc/conf.d/net.example and save your configuration
# in /etc/conf.d/net (this file :]!).

modules=( "wpa_supplicant" )

wpa_supplicant_eth0="-Dndiswrapper"

# The below line not be changed otherwise we refuse to work
ctrl_interface=/var/run/wpa_supplicant

# Ensure that only root can read the WPA configuration
ctrl_interface_group=0

# Let wpa_supplicant take care of scanning and AP selection
ap_scan=1

# Simple case: WPA-PSK, PSK as an ASCII passphrase, allow all valid ciphers
network={
  ssid="Gentoo_Linux"
  psk="mysecretpassword"
  # The higher the priority the sooner we are matched
  priority=5
}


Update:
At boot I get the following information:
Code:

 * Starting eth0
 *   Configuration not set for eth0 - assuming DHCP
 *   Bringing up eth0
 *     dhcp
 *       Running dhcpcd ...                                                                                                                          [ ok ]
 *       eth0 received address myip
 * Starting dhcdbd ...                                                                                                                               [ ok ]
 * Starting NetworkManager ...                                                                                                                       [ ok ]
 * Mounting network filesystems ...     


Code:

/etc/conf.d/net: line 25: syntax error near unexpected token `}'
/etc/conf.d/net: line 25: `}'
 * Starting lo
 *   Bringing up lo
 *     127.0.0.1/8                                                                                                                                       
[ ok ] *   Adding routes
 *     127.0.0.0/8 ...                                                                                                                                   
[ ok ]/etc/conf.d/net: line 25: syntax error near unexpected token `}'
/etc/conf.d/net: line 25: `}'

_________________
Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered
Back to top
View user's profile Send private message
Kasumi_Ninja
Veteran
Veteran


Joined: 18 Feb 2006
Posts: 1825
Location: The Netherlands

PostPosted: Wed Oct 03, 2007 4:58 pm    Post subject: Reply with quote

From /usr/share/doc/wpa_supplicant-0.5.7/README I learned that ndiswrapper indeed is a driver. And I realized my mistake with /etc/conf.d/net :oops:. The only question left is how do I configure it order to start wifi at boot? My guess is that I need to get rid of this message first:

Code:
 *   Configuration not set for eth0 - assuming DHCP


Here the new /etc/conf.d/net and wpa_supplicant.conf:

# cat /etc/conf.d/net
Code:
# This blank configuration will automatically use DHCP for any net.*
# scripts in /etc/init.d.  To create a more complete configuration,
# please review /etc/conf.d/net.example and save your configuration
# in /etc/conf.d/net (this file :]!).

modules=( "wpa_supplicant" )

wpa_supplicant_eth0="-Dndiswrapper"


# cat /etc/wpa_supplicant/wpa_supplicant.conf
Code:
# This is a network block that connects to any unsecured access point.
# We give it a low priority so any defined blocks are preferred.

# The below line not be changed otherwise we refuse to work
ctrl_interface=/var/run/wpa_supplicant

# Ensure that only root can read the WPA configuration
ctrl_interface_group=0

# Let wpa_supplicant take care of scanning and AP selection
ap_scan=1

# Simple case: WPA-PSK, PSK as an ASCII passphrase, allow all valid ciphers
network={
  ssid="Gentoo_Linux"
  psk="myysecretpassword"
  # The higher the priority the sooner we are matched
  priority=5
}

_________________
Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered
Back to top
View user's profile Send private message
mikb
Tux's lil' helper
Tux's lil' helper


Joined: 14 Dec 2005
Posts: 124
Location: Sydney Australia

PostPosted: Thu Oct 04, 2007 4:33 am    Post subject: Reply with quote

Aniruddha wrote:
The only question left is how do I configure it order to start wifi at boot? My guess is that I need to get rid of this message first:

Code:
 *   Configuration not set for eth0 - assuming DHCP


That's a warning - add the appropriate line to /etc/conf.d/net, and it will go away.
Code:
config_eth0=( "dhcp" )


Here's how to get it to start at boot (see http://gentoo-wiki.com/HOWTO_Wireless_Configuration_and_Startup):

Create a link that corresponds to your network interface in /etc/init.d and then start it:

Code:
cd /etc/init.d
# ln -s net.lo net.eth0
# /etc/init.d/net.eth0 start

_________________
With sufficient thrust, pigs fly just fine (RFC 1925, apparently talking about Gentoo)
Back to top
View user's profile Send private message
Kasumi_Ninja
Veteran
Veteran


Joined: 18 Feb 2006
Posts: 1825
Location: The Netherlands

PostPosted: Thu Oct 04, 2007 8:30 am    Post subject: Reply with quote

Thanks for the link! With the additional help from the wiki I was able to solve this :):

Quote:

Note: With ndiswrapper version 1.13 and newer, use -Dwext instead of -Dndiswrapper (ndiswrapper.sourceforge.net


Code:

# cd /etc/init.d
# ln -s net.lo net.wlan0
# /etc/init.d/net.wlan0 start
 * Starting wlan0
 *   Starting wpa_supplicant on wlan0 ...                                 [ ok ]
 *   Starting wpa_cli on wlan0 ...                                        [ ok ]
 *     Backgrounding ...


# cat /etc/conf.d/net
Code:
# This blank configuration will automatically use DHCP for any net.*
# scripts in /etc/init.d.  To create a more complete configuration,
# please review /etc/conf.d/net.example and save your configuration
# in /etc/conf.d/net (this file :]!).

modules=( "wpa_supplicant" )

wpa_supplicant_wlan0="-Dwext"

#essid_wlan0="Gentoo_Linux"
#config_wlan0=( "dhcp" )

# cat /etc/wpa_supplicant/wpa_supplicant.conf
Code:
# This is a network block that connects to any unsecured access point.
# We give it a low priority so any defined blocks are preferred.

# The below line not be changed otherwise we refuse to work
ctrl_interface=/var/run/wpa_supplicant

# Ensure that only root can read the WPA configuration
ctrl_interface_group=0

# Let wpa_supplicant take care of scanning and AP selection
ap_scan=1

# Simple case: WPA-PSK, PSK as an ASCII passphrase, allow all valid ciphers
network={
  ssid="Gentoo_Linux"
  psk="mysecretpassword"
  # The higher the priority the sooner we are matched
  priority=5
}

_________________
Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered
Back to top
View user's profile Send private message
z_sfeng
Apprentice
Apprentice


Joined: 21 Apr 2004
Posts: 154
Location: Finland

PostPosted: Mon Oct 22, 2007 9:00 am    Post subject: Reply with quote

I noticed you have NetworkManager running.
As my understanding, you can only run either NetworkManger or net.* script, but not both.

chech this howto:
http://gentoo-wiki.com/NetworkManager

I recommond not to use NetworkManager if you want wireless up at boot time.
Back to top
View user's profile Send private message
Kasumi_Ninja
Veteran
Veteran


Joined: 18 Feb 2006
Posts: 1825
Location: The Netherlands

PostPosted: Sun Nov 04, 2007 5:59 pm    Post subject: Reply with quote

z_sfeng wrote:
I noticed you have NetworkManager running.
As my understanding, you can only run either NetworkManger or net.* script, but not both.

chech this howto:
http://gentoo-wiki.com/NetworkManager

I recommond not to use NetworkManager if you want wireless up at boot time.


Thanks for the link! Why wouldn't you recommend NetworkManager to start wireless up at boot time?
You can run both but you will be wasting cpu:

Quote:
If all goes well installing and starting NetworkManager you should disable any of your existing networking scripts and configs. If you don't, you will have dueling dhcp clients fighting over your interfaces eating up CPU.


I really can't imagine why you should remove your configs and startup scripts?!

Quote:
Clean up your old network settings

If all goes well installing and starting NetworkManager you should disable any of your existing networking scripts and configs. If you don't, you will have dueling dhcp clients fighting over your interfaces eating up CPU.

Remove your current network devices from start up:

rc-update del net.eth0
rc-update del net.ath0
...

Remove the startup scripts:

rm /etc/init.d/net.eth0
rm /etc/init.d/net.ath0
...

Disallow device initiated services for the network to be started:
File: /etc/conf.d/rc

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

Remove your current settings (make a backup now if necessary):

rm /etc/conf.d/net
rm /etc/wpa_supplicant/wpa_supplicant.conf

_________________
Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered
Back to top
View user's profile Send private message
z_sfeng
Apprentice
Apprentice


Joined: 21 Apr 2004
Posts: 154
Location: Finland

PostPosted: Mon Nov 05, 2007 8:45 am    Post subject: Reply with quote

Quote:

Thanks for the link! Why wouldn't you recommend NetworkManager to start wireless up at boot time?
You can run both but you will be wasting cpu:


Because these two compete each other, and only one can be the winner.

Current version of NetworkManager does not support wireless up at boot time. You need to login KDE/Gnome to get wireless connection
Back to top
View user's profile Send private message
Kasumi_Ninja
Veteran
Veteran


Joined: 18 Feb 2006
Posts: 1825
Location: The Netherlands

PostPosted: Mon Nov 05, 2007 9:32 am    Post subject: Reply with quote

z_sfeng wrote:
Quote:

Thanks for the link! Why wouldn't you recommend NetworkManager to start wireless up at boot time?
You can run both but you will be wasting cpu:


Because these two compete each other, and only one can be the winner.

Current version of NetworkManager does not support wireless up at boot time. You need to login KDE/Gnome to get wireless connection


Good to know that. Thanks!
_________________
Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum