View previous topic :: View next topic |
Author |
Message |
skorefish Apprentice
Joined: 21 Jun 2015 Posts: 285
|
Posted: Sun Jul 19, 2015 9:17 pm Post subject: [solved]command line connect to wireless lan |
|
|
Hello,
What are the steps to connect to a wireless lan from the command line.
I want to use a fix ip adress for the wlan.
Last edited by skorefish on Wed Jul 22, 2015 8:20 pm; edited 1 time in total |
|
Back to top |
|
|
Tony0945 Watchman
Joined: 25 Jul 2006 Posts: 5127 Location: Illinois, USA
|
Posted: Sun Jul 19, 2015 10:05 pm Post subject: |
|
|
ssh? What do you mean by "connect to a wireless lan"? Control the lan? Log in to another computer? Or do you have a wireless computer and wish to connect to the lan? I can't think of any other situation where it would matter if the lan was wired or wireless. If that's it see https://wiki.gentoo.org/wiki/Wpa_supplicant |
|
Back to top |
|
|
Roman_Gruber Advocate
Joined: 03 Oct 2006 Posts: 3846 Location: Austro Bavaria
|
Posted: Sun Jul 19, 2015 11:48 pm Post subject: |
|
|
something like, when you use the old naming sheme. (net-ifnames=0 or so on the kernel command line during booting)
ifconfig -a
ifconfig eth0 down
ifconfig wlan0 up
when you type wpa_supplicant
Quote: |
wpa_supplicant -Dnl80211 -iwlan0 -c/etc/wpa_supplicant.conf |
And this is kinda the command line i use on my other box. You just need the config file as shown above: /etc/wpa_supplicant.conf
And thats tricky on the wireless stuff in question.
and than i think also Dhcpcd wlan0
I start the network as root on every login myself. I dislike those autoscripts because they hardly worked for myself.
I see instantly if i have a connection or not and leave the terminal open and thats it. Maybe I am too oldfashioned ...
also check if your wlan card is recognized and has the firmware needed ... wlan cards usually need some firmware and some kernel settings / modules |
|
Back to top |
|
|
skorefish Apprentice
Joined: 21 Jun 2015 Posts: 285
|
Posted: Mon Jul 20, 2015 6:04 am Post subject: |
|
|
Quote: | wlan cards usually need some firmware and some kernel settings / modules |
Do you know a good link for the firmware ? I have a Qualcom Atheros AR9485 wireless card |
|
Back to top |
|
|
skorefish Apprentice
Joined: 21 Jun 2015 Posts: 285
|
Posted: Mon Jul 20, 2015 6:06 am Post subject: |
|
|
Quote: | Or do you have a wireless computer and wish to connect to the lan? | that's what i'm looking for |
|
Back to top |
|
|
Roman_Gruber Advocate
Joined: 03 Oct 2006 Posts: 3846 Location: Austro Bavaria
|
Posted: Mon Jul 20, 2015 7:19 am Post subject: |
|
|
skorefish wrote: | Quote: | wlan cards usually need some firmware and some kernel settings / modules |
Do you know a good link for the firmware ? I have a Qualcom Atheros AR9485 wireless card |
google is your friend
http://ubuntuforums.org/showthread.php?t=2201597
Quote: |
ubuntu:~$ lspci -nnk | grep -A2 0280
03:00.0 Network controller [0280]: Qualcomm Atheros AR9485 Wireless Network Adapter [168c:0032] (rev 01)
Subsystem: AzureWave Device [1a3b:2c97]
Kernel driver in use: ath9k |
=> Kernel driver in use: ath9k |
|
Back to top |
|
|
skorefish Apprentice
Joined: 21 Jun 2015 Posts: 285
|
Posted: Mon Jul 20, 2015 8:30 am Post subject: |
|
|
Quote: | Kernel driver in use: ath9k |
yes, I installed that one, so this is the firmware ?
but still can't connect... |
|
Back to top |
|
|
Roman_Gruber Advocate
Joined: 03 Oct 2006 Posts: 3846 Location: Austro Bavaria
|
Posted: Mon Jul 20, 2015 9:35 am Post subject: |
|
|
Did you followed the hints there?
Did you checked similar linux pages on "google" for that card? and applied the solutions?
the ubuntu page above covers quite everything.
maybe the firmware for your card is in that package:
qlist -Iv firmware
sys-kernel/linux-firmware-20150320
may i kindly ask you to research that topic?
Code: | but still can't connect... |
could be anything... you need to be more specific
It is also advised to do some reading and apply those solutions and follow the guides. most of the time the issue is solved than.
--
well you may post anything relevant, starting with wpa_supplicant.conf / lsmod output, which protocol in question you are using for wifi and such... and the command line output of the "i can not connect issue"...
It also helps when you try first to connect without security to that wifi node, to check if the card works at all.
--
Code: | iwconfig wlan0 scan
|
So wahts there? that should give you a general idea if your wlan card works or not. if you see your node than you need to set up correct your config file or pass everything in the command line for wpa_supplicant.conf |
|
Back to top |
|
|
Tony0945 Watchman
Joined: 25 Jul 2006 Posts: 5127 Location: Illinois, USA
|
Posted: Mon Jul 20, 2015 2:13 pm Post subject: |
|
|
Example of a working /etc/wpa_supplicant.conf. only the SSID and passphrase have been changed to protect the not so innocent:
Quote: | # 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
# Same as previous, but request SSID-specific scanning (for APs that reject
# broadcast SSID)
network={
ssid="MySSID"
scan_ssid=1
psk="Mypassphrase"
priority=2
}
# Only WPA-PSK is used. Any valid cipher combination is accepted
#network={
# ssid="example"
# proto=WPA
# key_mgmt=WPA-PSK
# pairwise=CCMP TKIP
# group=CCMP TKIP WEP104 WEP40
# psk=06b4be19da289f475aa46a33cb793029d4ab3db7a23ee92382eb0106c72ac7bb
# priority=2
#}
|
Have you symlinked /etc/net.wlan0 to /etc/net.lo?
Have you added net.wlan0 to rc-update boot level?
Quote: |
ln -s /etc/init.d/net.lo /etc/init.d/net.wlan0
rc-update add net.wlan0 boot |
Post some logs showing errors. |
|
Back to top |
|
|
skorefish Apprentice
Joined: 21 Jun 2015 Posts: 285
|
Posted: Mon Jul 20, 2015 7:23 pm Post subject: |
|
|
i made it a little simpeler and threw out the security. After a few commands i can ssh the other computer in my network, so the card works.
Code: |
ifconfig eth0 down
ifconfig wlan0 up
iwconfig wlan0 essid MirrOrNet
ifconfig wlan0 192.168.2.1
ping 192.168.2.1
|
but there is a problem with the naming server. |
|
Back to top |
|
|
Tony0945 Watchman
Joined: 25 Jul 2006 Posts: 5127 Location: Illinois, USA
|
Posted: Mon Jul 20, 2015 8:50 pm Post subject: |
|
|
/etc/resolv.conf again with the domain name changed:
Quote: |
# Generated by dhcpcd from eth0.dhcp
# /etc/resolv.conf.head can replace this line
domain MyDomainname
nameserver 192.168.0.1
# /etc/resolv.conf.tail can replace this line
|
Supposedly you can have three nameserver lines, but I've never seen it use anything more than two.
Look again at the file I posted above. If you are using WPA2 (and if not why not?) all you need to do is add your SSID and passphrase.
PUT THE SECURITY BACK!!! |
|
Back to top |
|
|
skorefish Apprentice
Joined: 21 Jun 2015 Posts: 285
|
Posted: Tue Jul 21, 2015 7:52 am Post subject: |
|
|
I put the security back up, now trying to work with the wpa_supplicant
see my command + result here:
https://bpaste.net/show/b4fcf44b778b
It complains about RFKILL, don't know what to do with it...
I tried the resolv.conf yesterday, but it only works for my eth0 connection, not for the wlan0 |
|
Back to top |
|
|
skorefish Apprentice
Joined: 21 Jun 2015 Posts: 285
|
Posted: Tue Jul 21, 2015 9:54 am Post subject: |
|
|
Quote: | rfkill: Cannot open RFKILL control device
WEXT: RFKILL status not available |
solution: check RF_Switch subsystem in kernel .conf |
|
Back to top |
|
|
skorefish Apprentice
Joined: 21 Jun 2015 Posts: 285
|
Posted: Tue Jul 21, 2015 1:59 pm Post subject: |
|
|
Ok, the rfkill problem is solved but now it is not clear why it still won't connect. Please help
https://bpaste.net/show/f251aa6398f6
my router uses TKIP/AES WPA/PSK WPA2/PSK
So i want to use the WPA2/PSK
TKIP versu AES i don't know yet |
|
Back to top |
|
|
Tony0945 Watchman
Joined: 25 Jul 2006 Posts: 5127 Location: Illinois, USA
|
Posted: Tue Jul 21, 2015 6:43 pm Post subject: |
|
|
skorefish wrote: | Ok, the rfkill problem is solved but now it is not clear why it still won't connect. Please help
https://bpaste.net/show/f251aa6398f6
my router uses TKIP/AES WPA/PSK WPA2/PSK
So i want to use the WPA2/PSK
TKIP versu AES i don't know yet |
My router is set for WPA2 & AES. Use my wpa_supplicant.conf and you shouldn't have any trouble.
Is your router perhaps set to only accept a certain list of MAC addresses? Check your router log for error messages. |
|
Back to top |
|
|
mir3x Guru
Joined: 02 Jun 2012 Posts: 455
|
Posted: Wed Jul 22, 2015 5:49 am Post subject: |
|
|
Code: | wlan0: Failed to initialize driver interface
Failed to add interface wlan0 |
and Code: | l2_packet_init: socket(PF_PACKET): Address family not supported by protocol | ( when connecting with wext )
Thats problem not some MAC address.
Thats in both cases ( first with wext and second with nl80211), so
u miss some network option in kernel.
Maybe Networking support -> Nwetwroking options -> packet socket (CONFIG_PACKET)
If it doesnt work check all networking options and where u see "If unsure, say Y." then mark so _________________ Sent from Windows |
|
Back to top |
|
|
skorefish Apprentice
Joined: 21 Jun 2015 Posts: 285
|
Posted: Wed Jul 22, 2015 8:11 pm Post subject: |
|
|
hi thx a lot,
the wifi works !!! |
|
Back to top |
|
|
|