DaemonForums  

Go Back   DaemonForums > NetBSD > NetBSD General

NetBSD General Other questions regarding NetBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 21st August 2016
bsd-keith bsd-keith is offline
Real Name: Keith
Open Source Software user
 
Join Date: Jun 2014
Location: Surrey/Hants Border, England
Posts: 138
Default configuring wireless connection?

Spent yesterday searching, finding, & trying to use what little info there is about wifi setup., but it would appear that wifi still doesn't work - 7.0.1 (i386/amd64)
__________________
Linux since 1999, & now an OpenBSD user.
Reply With Quote
  #2   (View Single Post)  
Old 21st August 2016
shep shep is offline
Rc.conf Instructor
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,050
Default

My 7.0.1/i386 wireless setup, based on a now missing tutorial, is still working. I recall the tutorial provided dhcp vs dhclient options. dhclient did not work for me but dhcp did. I will drag out and post my redacted configs shortly.

I'm using an ralink usb dongle (rum). Replace rum with your driver, ie ath0

/etc/rc.conf
Code:
dhcpcd_flags="-q -b"
wpa_supplicant=YES
wpa_supplicant_flags="-B -i rum0 -c /etc/wpa_supplicant.conf"
I generated /etc/wpa_supplicant.conf using wpa_passphrase.
# wpa_passphrase your_SSID your_key > /etc/wpa_supplicant.conf

With dhcp you also need.
/etc/ifconfig.rum0
Code:
up
dhcp

Last edited by shep; 21st August 2016 at 09:56 PM. Reason: Forgot /etc/ifconfig.rum0
Reply With Quote
  #3   (View Single Post)  
Old 21st August 2016
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 759
Default

Quote:
Originally Posted by bsd-keith View Post
Spent yesterday searching, finding, & trying to use what little info there is about wifi setup., but it would appear that wifi still doesn't work - 7.0.1 (i386/amd64)
It would be good to start a new thread with a dmesg and more details about exactly what part of wireless setup is being difficult. If it's a matter of hardware support, perhaps current (the HEAD) may help, e.g., it has rtwn.
Reply With Quote
  #4   (View Single Post)  
Old 22nd August 2016
bsd-keith bsd-keith is offline
Real Name: Keith
Open Source Software user
 
Join Date: Jun 2014
Location: Surrey/Hants Border, England
Posts: 138
Default

Thanks Shep, I'll give that a try, mine also comes up as rum interface.

The 2002 laptop I'm trying NetBSD on has worked with every other O/S that I've thrown at it, (MS Vista came on it), various Linux, FreeBSD, (PC-BSD), OpenBSD.

But not NetBSD - & there is a dearth of info for setting up wifi.

EDIT: Gave it a try - but still doesn't come up.
__________________
Linux since 1999, & now an OpenBSD user.

Last edited by bsd-keith; 22nd August 2016 at 12:15 PM.
Reply With Quote
  #5   (View Single Post)  
Old 22nd August 2016
shep shep is offline
Rc.conf Instructor
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,050
Default

/etc/wpa_supplicant.conf
Code:
network={
        ssid="******"
        scan_ssid=1
        key_mgmt=WPA-PSK
        psk="**************"
}
During startup you should see
1) uhub
2) rum0
3) network start
4) dhcp lease acquired
Watching the messages should help narrow where the problem is.

I'm OK with forking this to a NetBSD wireless thread.
Reply With Quote
  #6   (View Single Post)  
Old 22nd August 2016
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,276
Default

Discussion on configuring wireless connections on NetBSD has been separated from its parent thread:

http://daemonforums.org/showthread.php?t=1882

...as it is the general laptop configuration thread.

We encourage discussion on this site, but we do ask members to restrict threads to a single topic to help promote clarity and understanding. Besides, starting new threads is cool...

Reply With Quote
  #7   (View Single Post)  
Old 22nd August 2016
bsd-keith bsd-keith is offline
Real Name: Keith
Open Source Software user
 
Join Date: Jun 2014
Location: Surrey/Hants Border, England
Posts: 138
Default

@ocicat
Sorry boss - it started out as a comment - I was a bit frustrated with NetBSD as I have never been able to get wifi working on it.

Hopefully this thread will end up helping others to get theirs working too.
__________________
Linux since 1999, & now an OpenBSD user.
Reply With Quote
  #8   (View Single Post)  
Old 22nd August 2016
bsd-keith bsd-keith is offline
Real Name: Keith
Open Source Software user
 
Join Date: Jun 2014
Location: Surrey/Hants Border, England
Posts: 138
Default

@shep
I don't think I've got a key_mgmt statement - will go & check.

( Narrowing it down - I do get uhub, rum0, & a network statement, but definately no dhcp lease acquired.)
__________________
Linux since 1999, & now an OpenBSD user.
Reply With Quote
  #9   (View Single Post)  
Old 22nd August 2016
bsd-keith bsd-keith is offline
Real Name: Keith
Open Source Software user
 
Join Date: Jun 2014
Location: Surrey/Hants Border, England
Posts: 138
Default

Still no joy - can you see any glaring faults in my setup?

rc.conf
Code:
#	$NetBSD: rc.conf,v 1.97 2014/07/14 12:29:48 mbalmer Exp $
#
# See rc.conf(5) for more information.
#
# Use program=YES to enable program, NO to disable it. program_flags are
# passed to the program on the command line.
#

# Load the defaults in from /etc/defaults/rc.conf (if it's readable).
# These can be overridden below.
#
if [ -r /etc/defaults/rc.conf ]; then
	. /etc/defaults/rc.conf
fi

# If this is not set to YES, the system will drop into single-user mode.
#
rc_configured=YES

# Add local overrides below.
#
wscons=YES
#
sshd=NO
postfix=NO
inetd=NO
#
#wlan
dhcpcd_flags="-q -b"
wpa_supplicant=YES
wpa_supplicant_flags="-B -i rum0 -c /etc/wpa_supplicant.conf"
ifconfig_rum0="dhcp"
#dhclient=YES
ifconfig.rum0
Code:
up
dhcp
wpa_supplicant.conf
Code:
#ctrl_interface=/var/run/wpa_supplicant
#ctrl_interface_group=wheel
#network={
#ssid="name"
#psk="phrase"
#}

network={
	ssid="name"
        scan_ssid=1
        key_mgmt=WPA-PSK
	#psk="phrase"
	psk=huge-number
}
partial dmesg
Code:
rum0 at uhub6 port 1
rum0: Ralink 802.11 bg WLAN, rev 2.00/0.01, addr 2
rum0: MAC/BBP RT2573 (rev 0x2573a), RF RT2528, address 00:1d:92:12:51:08
rum0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
rum0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
__________________
Linux since 1999, & now an OpenBSD user.
Reply With Quote
Old 22nd August 2016
bsd-keith bsd-keith is offline
Real Name: Keith
Open Source Software user
 
Join Date: Jun 2014
Location: Surrey/Hants Border, England
Posts: 138
Default

On start up screen I get :-

Starting network.
/etc/rc: WARNING: $hostname not set.
IPv6 mode: host
Configuring network interfaces: rum0.
Adding interface aliases:.
Waiting for DAD completion for statically configured addresses...
Starting wpa_supplicant.
Succesfully initialised wpa_supplicant
Building databases: dev, utmp,utmpx.
etc.
__________________
Linux since 1999, & now an OpenBSD user.
Reply With Quote
Old 22nd August 2016
shep shep is offline
Rc.conf Instructor
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,050
Default

Do you have a hostname set? It can either be in /etc/rc.conf or /etc/myname. I have mine in /etc/rc.conf.
https://www.netbsd.org/docs/network/

You can manually bring up networking with
# /etc/rc.d/network (re)start

It should spit out error messages
Reply With Quote
Old 22nd August 2016
bsd-keith bsd-keith is offline
Real Name: Keith
Open Source Software user
 
Join Date: Jun 2014
Location: Surrey/Hants Border, England
Posts: 138
Default

(Thanks for your time shep.)

Put nbsd.km.net into /etc/myname.

Tried to bring it up with /etc/network start
Code:
Starting network.
Hostname: nbsd.km.net
IPv6 mode: host
Configuring network interfaces: rum0.
Adding interface aliases:.
Waiting for DAD completion for statically configured addresses...
still no joy.

edit: Rebooted just in case it made any difference - but still no network with/in ifconfig

edit2: Will check back in the morning.
__________________
Linux since 1999, & now an OpenBSD user.

Last edited by bsd-keith; 22nd August 2016 at 07:47 PM.
Reply With Quote
Old 22nd August 2016
shep shep is offline
Rc.conf Instructor
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,050
Default

Are you getting an IP address lease. If not, I think you can manually request a dhcp lease via dhcpcd
# dhcpcd rum0

If that does not work, here are the differences between your posted configs and what I have:

Code:
#wlan
dhcpcd_flags="-q -b"
wpa_supplicant=YES
wpa_supplicant_flags="-B -i rum0 -c /etc/wpa_supplicant.conf"
ifconfig_rum0="dhcp"
#dhclient=YES
I have my hostname set in /etc/rc.conf and do not have the line ifconfig_rum0. I also do not have an /etc/myname file.

Code:
#wlan
hostname=nbsd.km.net
dhcpcd_flags="-q -b"
wpa_supplicant=YES
wpa_supplicant_flags="-B -i rum0 -c /etc/wpa_supplicant.conf"
#dhclient=YES
I'm wondering if you are getting an I.P. address via dhcp?
It should generate entries in /etc/resolv.conf
Code:
Eyore# cat /etc/resolv.conf
# Generated by resolvconf
domain home.yak
nameserver 205.171.3.65
nameserver 96.90.175.167
nameserver 104.238.153.178
Having several different ways of configuring a network and no documentation about wireless configuration in the handbook always makes me appreciate OpenBSD

Last edited by shep; 23rd August 2016 at 01:58 AM.
Reply With Quote
Old 23rd August 2016
bsd-keith bsd-keith is offline
Real Name: Keith
Open Source Software user
 
Join Date: Jun 2014
Location: Surrey/Hants Border, England
Posts: 138
Default

I don't have or get a resolv.conf

I downloaded another install.img, md5 checked it, reinstalled, wrote all the files again, rebooted, & it still won't pick up any leases.

Thanks for your time trying to help, shep - but I'm going to assign NetBSD to the bit bucket, & just go back to AntiX & OpenBSD.

Someone on the NetBSD team needs to get wifi sorted out & working properly, & create a usable documentation for it.
__________________
Linux since 1999, & now an OpenBSD user.
Reply With Quote
Old 24th August 2016
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 759
Default

Quote:
Originally Posted by bsd-keith View Post
I'm going to assign NetBSD to the bit bucket,
I'm sorry to hear you had to give up, but there can be limited time to try these things at one time. Unfortunately I was unable to respond at any length until now. Maybe the following along with shep's information can help in the future, or for someone else.

My approach to this problem would be to get wireless working, step-by-step, from the command line first. Only once everything succeeded that way would I possibly try to configure it automatically via the configuration files. This way you can beat on each step repeatedly and in isolation until it works, without trying to build on it. In fact, I haven't ever set up the config files to have the system do things automatically.

So here is a bare bones summary of what little I know. First check the dmesg to make sure the wireless device is configured. I see you've done that. My examples will use rtwn0 which applies on my laptop. All commands are run as root.

Code:
# ifconfig -a
...
rtwn0: flags=0x8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
        ssid ""
        powersave off
        address: 00:de:ad:be:ef:00
        media: IEEE802.11 autoselect
        status: no network
...
Look for Access Points (APs); the interface must be up to scan:

Code:
# ifconfig rtwn0 up
# ifconfig rtwn0 list scan
SSID                              BSSID              CHAN RATE  S:N     INT CAPS
SomeAccessPoint                    00:50:07:e3:84:0    1   54M 172:0    100 EP   RSN WME
...
OPTIONAL: You can get a lot of info about potential peers from wlanctl(8)
Code:
# wlanctl rtwn0
...(tons of output)...
WPA Supplicant: Create suitable configuration files for the APs you will use.

Some sample configuration files:

Code:
OPEN AP
-------
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel

network={
        ssid="Open AP SSID"
        scan_ssid=1
        key_mgmt=NONE
}

WEP AP
------
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel

network={
        ssid="WEP AP SSID"
        scan_ssid=1
        key_mgmt=NONE
        wep_tx_keyidx=0
        wep_key0=1234567890
}

WPA2 AP
-------
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel

network={
        ssid="WPA AP SSID"
        scan_ssid=1
        key_mgmt=WPA-PSK
        psk="passphrase"
        #  ** OR **
        psk=64 hex digits without quotes
}
Run wpa_supplicant:

Code:
# wpa_supplicant -Bd -c /path/to/wpa-supplicant.conf -i rtwn0
Adding "-f file" will send debugging messages (from "-d") to file.

Check if the network is up:

Code:
# ifconfig rtwn0

rtwn0: flags=0x8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        ssid "YourAP" nwkey 65536:"",0xb56f5d0192837465d086b54666dc606f5,"",""
        powersave off
        bssid 23:f7:34:23:de:34 chan 1
        address: 00:de:ad:be:ef:00
        media: IEEE802.11 autoselect (OFDM54 mode 11g)
        status: active
        inet6 fe80::d2df:9aff:fe7e:4461%rtwn0 prefixlen 64 scopeid 0x2
OPTIONAL: You can now check for network activity without even having an IP address. This can confirm that "things are working so far".

Code:
# tcpdump -ni rtwn0

tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on rtwn0, link-type EN10MB (Ethernet), capture size 262144 bytes
19:34:00.263402 ARP, Request who-has 192.168.1.134 (ff:ff:ff:ff:ff:ff) tell 192.168.1.23, length 28
19:34:00.263800 ARP, Request who-has 192.168.1.133 (ff:ff:ff:ff:ff:ff) tell 192.168.1.23, length 28
...
IP configuration: When I first started using wireless, I looked at both dhcpcd and dhclient. I found the latter much easier to understand and have used it exclusively since. It's usually this simple:

Code:
# dhclient -v [-1] rtwn0

Internet Systems Consortium DHCP Client 4.3.3
Copyright 2004-2015 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on BPF/rtwn0/00:de:ad:be:ef:00
Sending on   BPF/rtwn0/00:de:ad:be:ef:00
Sending on   Socket/fallback
DHCPDISCOVER on rtwn0 to 255.255.255.255 port 67 interval 6
DHCPREQUEST on rtwn0 to 255.255.255.255 port 67
DHCPOFFER from 192.168.1.3
DHCPACK from 192.168.1.3
bound to 192.168.1.17 -- renewal in 37764 seconds.
Another ifconfig should now show you have an IP address:

Code:
# ifconfig rtwn0
rtwn0: flags=0x8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        ssid "YourAP" nwkey 65536:"",0xb56f5d0192837465d086b54666dc606f5,"",""
        powersave off
        bssid 23:f7:34:23:de:34 chan 1
        address: 00:de:ad:be:ef:00
        media: IEEE802.11 autoselect (OFDM54 mode 11g)
        status: active
        inet 192.168.1.17 netmask 0xffffff00 broadcast 192.168.1.255
        inet6 fe80::d2df:9aff:fe7e:4461%rtwn0 prefixlen 64 scopeid 0x2
I think your /etc/resolv.conf will be updatted here too. You might also want to check that routing is sane:

Code:
# route -n  show -inet
To shut it all down you can kill dhclient and wpa_supplicant (you type what is in blue):

Code:
# pkill dhclient

# wpa_cli
wpa_cli v2.4
Copyright (c) 2004-2015, Jouni Malinen <j@w1.fi> and contributors

This software may be distributed under the terms of the BSD license.
See README for more details.


Selected interface 'rtwn0'

Interactive mode

> term
19:37:39.515: OK

  19:37:39.517: CTRL-EVENT-DISCONNECTED bssid=23:f7:34:23:de:34 reason=3 locally_generated=1
  19:37:39.517: CTRL-EVENT-TERMINATING
Connection to wpa_supplicant lost - trying to reconnect
> quit
ADDED #1: There is a politer way to terminate dhclient:
Code:
# dhclient -r rtwn0
As I said, I've never put the wireless setup into the start-up configuration files, so might not be the best person to help with that.

Hope that helps otherwise.

ADDED #2: From the NetBSD Wiki, how to use wpa supplicant.

Last edited by IdOp; 24th August 2016 at 11:22 PM.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie - need help configuring wireless connection... bobmarss OpenBSD General 4 3rd August 2012 03:05 AM
OpenBSD 4.5 and wireless connection sd1965 OpenBSD Installation and Upgrading 5 17th July 2011 02:57 AM
Wireless Network Loses Connection JMJ_coder NetBSD General 5 17th February 2009 09:14 PM
Configuring a wireless access point Serge FreeBSD General 6 6th June 2008 04:07 PM
KDE app for easy Wireless connection coppermine FreeBSD Ports and Packages 4 17th May 2008 07:33 PM


All times are GMT. The time now is 02:04 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick