Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
wireless networking where to start?
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
ALF__
Tux's lil' helper
Tux's lil' helper


Joined: 30 Nov 2003
Posts: 143

PostPosted: Sat Jun 28, 2014 9:53 am    Post subject: wireless networking where to start? Reply with quote

Hello!


ive been using gentoo for many years and i always seem to get things working either by google or some fiddling,

Something i dont seem to get is wireless networking. i have no idea were to start, and every guide seem to point i different directions.

I have the wireless card installed, and it shows up properly with iwconfig as wlp2s14f2u1.

Now i have tried with wpa_supplicant to get things to work, but there seem to be 10 config files that should work together, every guide says different things, and i have no idea were to start.

wpa_gui dont work for some odd reason, i just get an empty window, probably because i dont use kde, i use fluxbox.

i have downloaded both wpa_Supplicant, wicd and wireless-tools.

What should i do, and where do i start?
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Sat Jun 28, 2014 11:37 am    Post subject: Re: wireless networking where to start? Reply with quote

ALF__ wrote:
What should i do, and where do i start?

ALF__ ... well, there are basically three or four things involved, the kernel driver and kernel 802.11 networking layer, openrc/netifrc (or some other tool that manages starting and stoping the connection), wpa_supplicant as the 802.11 supplication client, and (possibly) a dhcp client for aquiring an IP address.

Here are some configuration examples and checks ... some of these are dependent on what card is in use, and what your use case is ... without further details I can only guess ...

Assuming the driver for the wireless card is in kernel, and enabled, the following is an example of whats required for the 802.11 networking (NL80211 ... 'netlink')
Code:
# egrep '(WEXT|(MAC|CFG|NL)80211)' /usr/src/linux/.config
CONFIG_WEXT_CORE=y
CONFIG_WEXT_PROC=y
CONFIG_CFG80211=m
# CONFIG_NL80211_TESTMODE is not set
# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
# CONFIG_CFG80211_REG_DEBUG is not set
CONFIG_CFG80211_DEFAULT_PS=y
# CONFIG_CFG80211_INTERNAL_REGDB is not set
CONFIG_CFG80211_WEXT=y
CONFIG_MAC80211=m
CONFIG_MAC80211_HAS_RC=y
CONFIG_MAC80211_RC_MINSTREL=y
CONFIG_MAC80211_RC_MINSTREL_HT=y
CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
CONFIG_MAC80211_RC_DEFAULT="minstrel_ht"
# CONFIG_MAC80211_MESH is not set
CONFIG_MAC80211_LEDS=y
# CONFIG_MAC80211_MESSAGE_TRACING is not set
# CONFIG_MAC80211_DEBUG_MENU is not set
# CONFIG_MAC80211_HWSIM is not set

The above is for an Atheros chipset, it should however be fairly similar for others drivers using NL80211. The only option here that isn't generally enabled (if, say, you're using genkernel) is CFG80211_WEXT (the WEXT compatibility layer) this should be enabled if you want/need to use tools (like those from the wireless-tools package) that use the old WEXT (wireless extentions).

Next, openrc/netifrc is configure via the files in /etc/conf.d and /etc/init.d

/etc/conf.d/net
Code:
modules_wlp2s14f2u1="wpa_supplicant dhcpcd"
wpa_supplicant_wlp2s14f2u1="-Dnl80211 -qq"
config_wlp2s14f2u1="dhcp"
#enable_ipv6_wlp2s14f2u1="false"

That should be all that's needed ... but other options such as dns, or dhcpcd, configuration can be added.

A typical wpa_supplicant.conf will look something like the following:

/etc/wpa_supplicant/wpa_supplicant.conf
Code:
ctrl_interface=DIR=/run/wpa_supplicant GROUP=wheel
update_config=1

network={
    ssid="AP_NAME" # the AP's 'ESSID'
    proto=RSN # or WPA ... dependent on what the AP supports
    key_mgmt=WPA-PSK
    psk="your psk here"
}

Again, this is the basics for wpa, for 802.1x supplication, or wep, then other/differing configuration is required.

You can find out what the AP supports with the following:

Code:
# awk '{RS="Cell"}/AP_NAME/' <(iwlist wlp2s14f2u1 scan)

Link the interface to net.lo

Code:
# ln -s /etc/init.d/net.lo /etc/init.d/net.wlp2s14f2u1

Once the above is in place then it should be possible to start the service ... you might also add it to the default runlevel to have it start at boot.

Code:
# /etc/init.d/net.wlp2s14f2u1 start
# rc-update add net.wlp2s14f2u1 default
# wpa_cli status

If the wpa supplication with the AP fails for some reason then wpa_supplicant can be made to provide a debug (-d) log ('-dd' or '-ddd' for more verbose logging). Note, comment the above line and replace it with the following:

/etc/conf.d/net
Code:
wpa_supplicant_wlp2s14f2u1="-Dnl80211 -d -f /var/log/wpa_supplicant.log"

If you have issues then pastbin the log and post the output of of the above scan ... if you have any further questions then just ask.

best ... khay
Back to top
View user's profile Send private message
druggo
Apprentice
Apprentice


Joined: 24 Sep 2003
Posts: 289
Location: Hangzhou, China

PostPosted: Sat Jun 28, 2014 11:52 am    Post subject: Reply with quote

what init system are you using ? openrc or systemd ?
_________________
HighWayToHell(blog)
http://blog.druggo.org/
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Sat Jun 28, 2014 12:07 pm    Post subject: Reply with quote

druggo wrote:
what init system are you using ? openrc or systemd ?

druggo ... by this thread it would seem openrc.

best ... khay
Back to top
View user's profile Send private message
ALF__
Tux's lil' helper
Tux's lil' helper


Joined: 30 Nov 2003
Posts: 143

PostPosted: Sat Jun 28, 2014 12:35 pm    Post subject: Reply with quote

Hi guys.


Thanks for all your help.

I managed to get this to work.
It seems like i had everything right, but it wasnt possible to start wicd by it self without adding it to default runtime. So i added it to default, and then wicd-curses worked, and with that it worked straight away.

If you guys could just clarify something for me. Is wpa_supplicant needed for wicd to work? or are they just overlapping each other?
Firstly i thought that wpa_supplicant was some driver for the encryption? If it is not, i could just remove it?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sat Jun 28, 2014 12:38 pm    Post subject: Reply with quote

ALF__,

wlp2s14f2u1 tells that your WiFi is USB.

In addition to the things khayyam listed, USB devices often but not always need firmware.
lsusb will list the Vendor and Device IDs of your chipset, that info will help us to help 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
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Sat Jun 28, 2014 1:15 pm    Post subject: Reply with quote

ALF__ wrote:
If you guys could just clarify something for me. Is wpa_supplicant needed for wicd to work? or are they just overlapping each other?

ALF__ ... wpa_supplicant is required for any WPA supplication, so any network tool (like wicd) that provides wpa will use wpa_supplicant.

ALF__ wrote:
Firstly i thought that wpa_supplicant was some driver for the encryption? If it is not, i could just remove it?

No, wpa_supplicant is a WPA and 802.1x supplicant, there is no other method of wpa supplication, so you need it.

best ... khay
Back to top
View user's profile Send private message
cwr
Veteran
Veteran


Joined: 17 Dec 2005
Posts: 1968

PostPosted: Sat Jun 28, 2014 3:10 pm    Post subject: Reply with quote

FWIW, a command line invocation of wpa_supplicant is:
Code:

#!/bin/bash
# Connect using wpa_supplicant running in a terminal.
date
ifconfig eth0 down
(sleep 10 && dhclient wlan0) &
wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf -f/var/log/wpa.log -dd -t
# eof

(The script doesn't return - it stays running until you hit ^C or close the terminal.)

A typical conf script woulld be:
Code:

# /etc/wpa_supplicant/wpa_supplicant.conf

# The below line must 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

# Allow tools to update configuration.
#update_config=1

# Simple case: WPA-PSK, PSK as an ASCII passphrase, allow all valid ciphers
# Use wpa_passphrase to produce the hex string.
network={
  ssid="COINS"
  psk="wildebeest thunder across the lonely tennis-court"
  #psk=ac2f12127f77a7db8947d31b7864726e039c20965efe0b11270be86a96a09827
  # The higher the priority the sooner we are matched
  priority=5
}
Back to top
View user's profile Send private message
ALF__
Tux's lil' helper
Tux's lil' helper


Joined: 30 Nov 2003
Posts: 143

PostPosted: Sun Jun 29, 2014 12:33 pm    Post subject: Reply with quote

khayyam wrote:
ALF__ wrote:
If you guys could just clarify something for me. Is wpa_supplicant needed for wicd to work? or are they just overlapping each other?

ALF__ ... wpa_supplicant is required for any WPA supplication, so any network tool (like wicd) that provides wpa will use wpa_supplicant.

ALF__ wrote:
Firstly i thought that wpa_supplicant was some driver for the encryption? If it is not, i could just remove it?

No, wpa_supplicant is a WPA and 802.1x supplicant, there is no other method of wpa supplication, so you need it.

best ... khay



Hello! Okey, thank you, then i leave it be :)

It works fine, and wicd-curses works like a charm.


As always, thank you guys for all your help. This time i was more close to the solution than i thought 8O
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