Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Configuring wireless network
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Blind_Sniper
Tux's lil' helper
Tux's lil' helper


Joined: 20 Apr 2018
Posts: 86

PostPosted: Sun Mar 17, 2019 7:39 am    Post subject: [Solved] Configuring wireless network Reply with quote

Hi!
Need help with configuring wireless network.
lspci:
Code:
02:00.0 Network controller: Qualcomm Atheros AR9485 Wireless Network Adapter


lspci -nkk:
Code:
02:00.0 0280: 168c:0032 (rev 01)
        Subsystem: 168c:3118
        Kernel driver in use: ath9k


/etc/conf.d/net:
Code:
config_eth0="192.168.1.7 netmask 255.255.255.0 brd 192.168.1.255"
routes_eth0="default via 192.168.1.1"

config_wlan0="192.168.1.77 netmask 255.255.255.0 brd 192.168.1.255"
routes_wlan0="default via 192.168.1.1"

modules="wpa_supplicant"
wpa_supplicant_wlan0="-Dnl80211"


/etc/init.d/wpa_supplicant/wpa_supplicant.conf:
Code:
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
ap_scan=1

network={
  ssid="access_point_name"
  psk="password"
  priority=1
}


Kernel module seems loaded, adapter itself is good (works fine in Windows).
When I trying to start it I getting this:

Code:
# wpa_supplicant -Dnl80211 -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
Successfully initialized wpa_supplicant
rfkill: Cannot open RFKILL control device


nothing more.
I tried to stop wired ethernet before running wpa_supplicant but it doesn't help much

Code:
# ifconfig -a
eth0: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether d0:27:88:7d:e8:c6  txqueuelen 1000  (Ethernet)
        RX packets 1301  bytes 1029241 (1005.1 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1142  bytes 193672 (189.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 131  bytes 12172 (11.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 131  bytes 12172 (11.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 64:70:02:ec:ac:86  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0



Am I missed something?


Last edited by Blind_Sniper on Sun Mar 17, 2019 4:57 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42587
Location: 56N 3W

PostPosted: Sun Mar 17, 2019 10:41 am    Post subject: Reply with quote

Blind_Sniper,

RFKILL support in your kernel?

Code:
$ grep KILL /usr/src/linux/.config
# CONFIG_RFKILL is not set
That's the wrong answer for you.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Blind_Sniper
Tux's lil' helper
Tux's lil' helper


Joined: 20 Apr 2018
Posts: 86

PostPosted: Sun Mar 17, 2019 1:19 pm    Post subject: Reply with quote

Thanks for the reply.
I added rfkill option and rebuilt kernel, but still no luck.
The only change is that the message from wpa_supplicant
Code:
rfkill: Cannot open RFKILL control device

disappeared.

ifconfig doesn't show that wlan0 interface is running, only is "UP"

May be something wrong with /etc/conf.d/net ?
Physically eth0 and wlan0 they are from different devices (routers). Wired router is mine, wireless - my neighbor's router.
I asked my neighbor for using his connection when my connection fails (it occurs for an hour or so every couple of months), and he gave me his wifi password.
But both routers has the same address 192.168.1.1.
I think it shouldn't be a problem because in the windows wifi card works fine with both router (wifi card getting 192.168.1.3 address, ethernet card has 192.168.1.2 address)
Assuming it shouldn't be a problem, because I cannot connect even to my own wifi. So it seems not an ip addresses problem
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42587
Location: 56N 3W

PostPosted: Sun Mar 17, 2019 1:38 pm    Post subject: Reply with quote

Blind_Sniper,

Maybe the WiFi transmitter is off?
What does the rfkill command say?

Some systems have a hardware switch that controls the TX power, like a light switch.
Some have a hardware switch that signals the kernel.
Others expect you to use the rfkill command to control the WiFi transmitter.

Both routers being in the same subnet will case your networking to fail if both eth0 and wlan0 are active at the same time.
You can have at most, one default route.

Does the wifi have an IP address?
A link local address, starting 169. doesn't count.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 6968
Location: Saint Amant, Acadiana

PostPosted: Sun Mar 17, 2019 1:39 pm    Post subject: Reply with quote

I'd look at dmesg for clues.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
Blind_Sniper
Tux's lil' helper
Tux's lil' helper


Joined: 20 Apr 2018
Posts: 86

PostPosted: Sun Mar 17, 2019 2:07 pm    Post subject: Reply with quote

Transmitter (router) is up and running, I can connect to it from phone, signal strength +39 dB. WiFi card has a led which is green.
rfkill output:
Code:
# rfkill
ID TYPE DEVICE      SOFT      HARD
 0 wlan phy0   unblocked unblocked


I do not try to connect to both routers simultaneously. I stopping eth0 before running
Code:
ifconfig -v wlan0 up

it's an ifconfig output with stopped eth0:
Code:
# ifconfig -a
eth0: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether d0:27:88:7d:e8:c6  txqueuelen 1000  (Ethernet)
        RX packets 121322  bytes 156183051 (148.9 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 47451  bytes 6162648 (5.8 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 1  bytes 80 (80.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1  bytes 80 (80.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 64:70:02:ec:ac:86  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


wlan0 has no ip address assigned. Running wpa_supplicant doesn't assign ip address to wlan0 too.

dmesg only reflects eth0 (r8169) related messages (Link is down / Link is up) when I stoppong and starting /etc/init.d/net.eth0. Nothing related to wlan0 interface or ath9k module.
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 6968

PostPosted: Sun Mar 17, 2019 2:16 pm    Post subject: Reply with quote

Do note that "ifconfig interface up" just bring up the interface, it doesn't assign any IP to it, nor it would sent a dhcp query.
you can set this within ifconfig (wlan0 start should bring it up, but also setup properly ip and route to use), but as-is, using ifconfig to bring the interface up is not enough for the interface to work.
you could "ifconfig wlan0 192.168.1.77" or dhcpcd wlan0
Back to top
View user's profile Send private message
Blind_Sniper
Tux's lil' helper
Tux's lil' helper


Joined: 20 Apr 2018
Posts: 86

PostPosted: Sun Mar 17, 2019 4:56 pm    Post subject: Reply with quote

OK, got it working.
Apart from assigning ip address, interface should be tied to gateway. It strange that settings in /etc/conf.d/net getting ignored, so I have to do it manually.

Finally my wifi script looks like this:
Code:
#!/bin/bash
/etc/init.d/net.eth0  stop
ifconfig -v wlan0 up
ifconfig wlan0 192.168.1.77
ip route add default via 192.168.1.1 dev wlan0
wpa_supplicant -Dnl80211 -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf -dd


Now it works.
Thanks you all for your help.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum