How to Automatic Wireless Network Connection At Boot

This howto relies on the fact that your card is recognized and working.
[b]No network auto-connection at boot[/b]
If you configure your network and when you reboot, the operation has to be repeated, it’s because your network configuration data hasn’t been/isn’t being stored.

I have already shown how to configure a network manually via the command line, now you need to know where to store the data so that everything connects automatically at boot.

[b]Nano text editor:[/b]
*note* I use the text editor “Nano” it edits text inside the terminal with no need to open an external GUI application like Gedit, Kate or Mousepad. You can use what you prefer, but I will add the commands for Nano as well.
[b]
/etc/rc.local[/b]
The rc.local file is a script which will run at boot and issue any commands that you add. In this case, we are going to issue the network config commands and connect.
[b]
Howto:[/b]
1. Open your terminal to edit the “rc.local” file.

sudo nano /etc/rc.local

[b]It will be empty apart from a description:[/b]

#!/bin/sh -e<br />#<br /># rc.local<br />#<br /># This script is executed at the end of each multiuser runlevel.<br /># Make sure that the script will "exit 0" on success or any other<br /># value on error.<br />#<br /># In order to enable or disable this script just change the execution<br /># bits.<br />#<br /># By default this script does nothing.<br /><br />exit 0<br /><br />

You need to add your commands between the last [b]#[/b] and the [b]exit 0[/b] code:

I connect through a wireless network, with a 13 digit “ascii” wep key, I need the “s:” before my key to denote ascii. You may only need to type your key if it is a 64/128bit wep key.

[b]Mine looks like this:[/b]

#!/bin/sh -e<br />#<br /># rc.local<br />#<br /># This script is executed at the end of each multiuser runlevel.<br /># Make sure that the script will "exit 0" on success or any other<br /># value on error.<br />#<br /># In order to enable or disable this script just change the execution<br /># bits.<br />#<br /># By default this script does nothing.<br />sudo iwconfig wlan0 essid WLAN_XX<br />sudo iwconfig wlan0 mode managed<br />sudo iwconfig wlan0 key s:xxxxxxxxxxxxx<br />sudo /etc/init.d/networking start<br /><br />exit 0<br />

Now when you reboot, this script will run and connect your network card.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s