Results 1 to 6 of 6
For some reason Ubuntu 8.04 doesn't save my college network settings, so I have to connect manually each time. This is what I physically have to do to connect:
1) ...
- 05-14-2009 #1
connect to network via command line
For some reason Ubuntu 8.04 doesn't save my college network settings, so I have to connect manually each time. This is what I physically have to do to connect:
1) Click on network manager icon in the notification area
2) Click "connect to other wireless network"
3) Type in "NETWORK_NAME" into network name area field
4) Select WPA enterprise under wireless security
5) Type in "USERNAME" into username field
6) Type in "PASSWORD" into password field
So what I would like to know: is there any command line equivalent for the above six steps? I would like to write a script which will carry out the above six steps for me automatically, using the parameters NETWORK_NAME, USERNAME and PASSWORD.
Thank you!
- 05-14-2009 #2
Connecting to a network via the command line isn't difficult, but it is a little trickier with WPA encryption.
You need to configure wpa_supplicant. Check if you have a config file already, at /etc/wpa_supplicant.conf. I don't think Ubuntu does, but if so, back it up.
Then
Add the followingCode:sudo gedit /etc/wpa_supplicant.conf
thenCode:ctrl_interface_group=0 eapol_version=1 #Sets AP sellection to be handled by wpa_supplicant or the driver. # 0=driver 1=wpa_supplicant ap_scan=1 network={ ssid="some_secure_network" scan_ssid=1 proto=WPA key_mgmt=WPA-EAP pairwise=TKIP eap=PEAP ca_cert="/etc/certs/CAcert.cer" identity="myusername" password="mypasswrd" }
I'm not familiar with the Enterprise WPA encryption; if this doesn't work, you can check here for more information. You'll need to direct the certification file to the right place, I imagine.Code:sudo wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf sudo dhclient wlan0
Also, you might want to check out replacing the network manager in Ubuntu with wicd.
- 05-14-2009 #3
reed9:
what is -B _Dwext?
and what does dhclient, is it a tool to assign ip and so automatically???Dual Booting Ubuntu 10.04, Windows 7
Toshiba Satellite A200-1M5, Duo Core 2.0 Ghz, 1 Gigs RAM, 256 Intel Card
You are registered Linux user number 490788
Happy Linuxing
- 05-14-2009 #4
Yup, DHCLIENT is a tool to request an IP address from a server. Some distros use DHCPCD instead.
The -B flag tells it to run in the background. -D is to indicate a driver. wext, or Wireless Extensions, is a generic driver that works in the majority of cases.
EDIT:
If you're using WEP encryption or no encryption, to connect to a wireless network from the command line is just
You can useCode:sudo iwconfig wlan0 essid "MY WIRELESS" key s:my_wep_key sudo dhclient wlan0
to scan for wireless networks in range.Code:sudo iwlist wlan0 scanning
- 05-14-2009 #5
thnx dude
Dual Booting Ubuntu 10.04, Windows 7
Toshiba Satellite A200-1M5, Duo Core 2.0 Ghz, 1 Gigs RAM, 256 Intel Card
You are registered Linux user number 490788
Happy Linuxing
- 05-15-2009 #6
Thanks for the reply,
I will try it out when I get home and post the results.


Reply With Quote
