Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
14
rated 0 times [  14] [ 0]  / answers: 1 / hits: 43289  / 2 Years ago, sat, june 11, 2022, 12:23:46

I need my machine to connect to a wireless network automatically every time it starts



I'm running a headless server (10.04) and I use following commands to manually connect to the network



sudo iwconfig wlan0 essid "SSID_Name"
sudo iwconfig wlan0 key XXXXX
sudo iwconfig wlan0 key open
sudo iwconfig wlan0 mode Managed
sudo dhclient wlan0


I will appreciate if we can do that by modifying etc/network/interfaces file



Please note that my router is running wep, thanks in advance


More From » wireless

 Answers
1

Please amend your /etc/network/interfaces file to:



auto lo
iface lo inet loopback

auto wlan0
iface wlan0 inet dhcp
wireless-ssid SSID_Name
wireless-key XXXXX


If you expect to ssh and ftp into the server, you need to know where it is. Do so with a static IP address:



auto lo
iface lo inet loopback

auto wlan0
iface wlan0 inet static
address 192.168.1.150
netmask 255.255.255.0
gateway 192.168.1.1
wireless-ssid SSID_Name
wireless-key XXXXX
dns-nameservers 8.8.8.8 192.168.1.1


Moreover, your settings imply that your network is encrypted with WEP which is quite insecure. I recommend you change the router to WPA2-AES:



auto lo
iface lo inet loopback

auto wlan0
iface wlan0 inet static
address 192.168.1.150
netmask 255.255.255.0
gateway 192.168.1.1
wpa-essid SSID_Name
wpa-psk XXXXX
dns-nameservers 8.8.8.8 192.168.1.1


Be sure to select an address outside the range used by the DHCP server in the router and, of course, substitute your details here.


[#27237] Sunday, June 12, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
intssive

Total Points: 493
Total Questions: 119
Total Answers: 101

Location: Liberia
Member since Mon, Feb 1, 2021
3 Years ago
intssive questions
Tue, Mar 21, 23, 08:19, 1 Year ago
Wed, Aug 31, 22, 04:04, 2 Years ago
Sat, Sep 25, 21, 15:09, 3 Years ago
Fri, Dec 31, 21, 09:13, 2 Years ago
;