[SOLVED] How can I connect to a wireless network without GUI app?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How can I connect to a wireless network without GUI app?
I just installed i3wm(http://i3wm.org/) a minimalist window manager. I am getting used to it, but i still can't figure out how to connect to a wireless network.
I used to do it with the gnome environment, but i3 doesn't provide a way to do it automatically.
Is there an easy way to connect to a network(eg, a third party app) or should i do it from the terminal?(how do i do it from the terminal anyway)
I just installed i3wm(http://i3wm.org/) a minimalist window manager. I am getting used to it, but i still can't figure out how to connect to a wireless network.
I used to do it with the gnome environment, but i3 doesn't provide a way to do it automatically.
Is there an easy way to connect to a network(eg, a third party app) or should i do it from the terminal?(how do i do it from the terminal anyway)
You could use the following from console as root;
Quote:
You should have your '/etc/resolv.conf' setup with your 'ISP DNS' nameservers.
sample '/etc/resolv.conf';
Code:
search 192.168.0.1 #if this happens to be your DNS
nameserver xxx.xxx.xxx.xxx #ISP DSN 'replace xxx.xxx.xxx.xxx
#with IP from your ISP
nameserver 4.2.2.1 #Verizon third level DNS
nameserver 4.2.2.2 #if needed
nameserver 4.2.2.3
nameserver 4.2.2.4
You could setup a static IP first, do as root from cli.
Code:
~#ifconfig wlan0 192.168.0.18 #<<< available IP
~#route add default gw 192.168.0.1 #<<your gateway
~#iwlist wlan0 scan #<< use information to fill in for essid & ap information
~#iwconfig wlan0 essid "Your Wireless"
~#iwconfig wlan0 key your_key_here
~#iwconfig wlan0 ap xx:xx:xx:xx:xx:xx #<<Your _ap_from iwlist
Test it;
Code:
~#route -n #show the route table
~#ifconfig wlan0 up #should be up already
~#ping 192.168.0.1 #ping your gateway
~#ping 208.69.32.130 #google.com IP
~#ping google.com #test DNS, if fail then
#check /etc/resolv.conf
I use the script below to setup my wireless while experimenting.
Code:
wlan.sh;
#start here
#----------------------- cut-------------------
#!/bin/bash
#
#10-26-09 13:30 gws
#setup the wlan0 device
#
/sbin/ifconfig wlan0 192.168.0.18 #available IP
/sbin/route add default gw 192.168.0.1
/sbin/iwconfig wlan0 essid "Your_Wireless_Access"
/sbin/iwconfig wlan0 key Place Your_key
/sbin/iwconfig wlan0 ap 00:00:00:00:00:00 << your AP HW address from above iwlist scan
#-----------------------Cut------------------
#end here
Be sure to include essid, key and AP for the above sample.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.