You are not logged in.

#1 2010-05-17 15:17:08

Lars Stokholm
Member
From: Denmark
Registered: 2009-03-17
Posts: 223

Wireless networking in Arch vs. FreeBSD

Ever since I switched from FreeBSD to Arch, I've been wondering why wireless networking is such a hazzle in Arch compared to FreeBSD.

In FreeBSD I would let my wpa_supplicant.conf contain something like this:

network={
  ssid="home_ssid"
  psk="some_passphrase"
}

network={
  ssid="friend_ssid"
  psk="some_passphrase"
}

network={
  ssid="work_ssid"
  psk="some_passphrase"
}

In /etc/rc.conf I would simply put ifconfig_wlan0="WPA DHCP" and I would be done. I could take my laptop and move it between different access points and FreeBSD would automagically switch between them (is that what's called roaming?).

Why is it not as simple as that in Arch? As far as I can tell I need netcfg or a similar "wrapper" around wpa_supplicant.conf to do the same thing. Is there something I have misunderstood?

Offline

#2 2010-05-17 15:36:25

gazj
Member
From: /home/gazj -> /uk/cambs
Registered: 2007-02-09
Posts: 681
Website

Re: Wireless networking in Arch vs. FreeBSD

what if you go somewhere and you need to use wep, I take it you need to change rc.conf (not a freebsd user so I do not know) with netcfg this is not needed, just make the new profile. 

Netcfg is an extremely powerful network tool with huge possibilities not limited to wpa, wep ppp including mobile/cell phone modems and others are available too

Wifi-select is worth installing for connecting to networks on the fly that you may not want to keep a config for, i.e in a cafe or other free networks.

example configs

WPA

CONNECTION='wireless'
DESCRIPTION='A simple WPA encrypted wireless connection'
INTERFACE='wlan0'
SECURITY='wpa'
ESSID='MyNetwork'
KEY='WirelessKey'
IP='dhcp'

WEP

CONNECTION='wireless'
DESCRIPTION='A simple WEP encrypted wireless connection'
INTERFACE='wlan0'
SECURITY='wep'
ESSID='MyNetwork'
KEY='1234567890'
IP='dhcp

PPP

CONNECTION='ppp'
INTERFACE='ignore'
PEER='provider'
PPP_TIMEOUT=10

Offline

#3 2010-05-17 15:38:50

gazj
Member
From: /home/gazj -> /uk/cambs
Registered: 2007-02-09
Posts: 681
Website

Re: Wireless networking in Arch vs. FreeBSD

or if one of your wpa configs needs a static ip, unlikely yes but possible

Offline

#4 2010-05-17 15:54:38

delcake
Member
Registered: 2008-07-28
Posts: 62

Re: Wireless networking in Arch vs. FreeBSD

Hmm, I set up my wpa_supplicant.conf in a similar way, but I just call wpa_supplicant directly rather than using a wrapper.

sudo wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -B
sudo dhcpcd wlan0

That'll get me internet, though I've not tried roaming so I can't speak with any authority on that front. I have recently put together a little wpa_sup daemon that handles the above for me on boot now to streamline things a little bit.

Offline

#5 2010-05-17 16:48:20

Lars Stokholm
Member
From: Denmark
Registered: 2009-03-17
Posts: 223

Re: Wireless networking in Arch vs. FreeBSD

gazj - WEP is not a problem, it can be configured though wpa_supplicant.conf. If you need to use different IPs I don't know what you'll do though.

delcake - Where do you put those lines? In rc.local?

Edit: Oh, you made a daemon. smile

Last edited by Lars Stokholm (2010-05-17 17:11:08)

Offline

#6 2010-05-17 16:52:29

gazj
Member
From: /home/gazj -> /uk/cambs
Registered: 2007-02-09
Posts: 681
Website

Re: Wireless networking in Arch vs. FreeBSD

Ah, I see I didn't know wpa_supplicant could do wep.  As you can see netcfg is a wrapper for several networking possibilites.

Maybe this is more what you are looking for http://bbs.archlinux.org/viewtopic.php?id=59004 [+]

Still does not sound as simple as the freebsd method you mention

Offline

#7 2010-05-17 16:57:55

Lars Stokholm
Member
From: Denmark
Registered: 2009-03-17
Posts: 223

Re: Wireless networking in Arch vs. FreeBSD

Actually, what delcake says doesn't sound too different from what can be done in FreeBSD. I just followed the wiki when I first set up Arch and here netcfg was suggested.

Offline

#8 2010-05-17 17:26:27

parintachin
Member
Registered: 2009-05-25
Posts: 72

Re: Wireless networking in Arch vs. FreeBSD

you could use autowifi from aur . you just just set up wpa_supplicant.conf for roaming (like you are used to from bsd) and have the autowifi daemon running .if you want a gui you can use wpa_gui or wpa_cli in a terminal.
works wonderfull smile

Offline

#9 2010-05-17 17:58:35

delcake
Member
Registered: 2008-07-28
Posts: 62

Re: Wireless networking in Arch vs. FreeBSD

Yup, I pretty much just gutted the network daemon and set up some simple lines to get wpa_supplicant and dhcpd up and running.

Here's what I came up with:

## wpa_sup [plain_text]
#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions

case "$1" in
    start)
        if ! ck_daemon wpa_sup; then
            echo "WPA Supplicant is already running.  Try 'wpa_sup restart'"
            exit
        fi

        stat_busy "Starting WPA Supplicant"
        error=0        
        /usr/sbin/wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -B || error=1
        /usr/sbin/dhcpcd -q wlan0 || error=1
        if [ $error -eq 0 ]; then
            add_daemon wpa_sup
            stat_done
        else
            stat_fail
        fi
        ;;
    stop)
        #if ck_daemon wpa_sup; then
        #    echo "WPA Supplicant is not running.  Try 'wpa_sup start'"
        #    exit
        #fi

        stat_busy "Stopping Network"
        rm_daemon wpa_sup
        error=0
        killall wpa_supplicant || error=1
        killall dhcpcd || error=1
        if [ $error -eq 0 ]; then
            stat_done
        else
            stat_fail
        fi
        ;;
    restart)
        $0 stop
        /bin/sleep 2
        $0 start
        ;;
    *)
        echo "usage: $0 {start|stop|restart}"  
esac

# vim: set ts=2 noet:

Yeah, probably fairly ugly but it gets the job done for my simple use-case. tongue

Last edited by delcake (2010-05-17 17:59:22)

Offline

Board footer

Powered by FluxBB