DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

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

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 19th February 2015
chigurh chigurh is offline
Port Guard
 
Join Date: Jul 2014
Posts: 28
Default OpenBSD Router & Wireless AP setup

I use OpenBSD-5.6 as a router and a desktop. Recently, I acquired TP-Link ATHEROS USB2.0 WLAN device and configured it as a wireless AP as mentioned in HOSTNAME.IF(5)

I wish to connect my cellphones and tablet to AP. I have two vether devices, one for routing and other for qemu tap network. I added athn0 to bridge interface but it does not work.

Ifconfig -
Code:
$ ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 32768
        priority: 0
        groups: lo
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4
        inet 127.0.0.1 netmask 0xff000000
re0: flags=28b43<UP,BROADCAST,RUNNING,PROMISC,ALLMULTI,SIMPLEX,MULTICAST,NOINET6> mtu 1500
        lladdr 94:de:80:6c:e5:e1
        priority: 0
        groups: egress
        media: Ethernet autoselect (100baseTX full-duplex,rxpause,txpause)
        status: active
        inet 10.20.30.103 netmask 0xffffff00 broadcast 10.20.30.255
re1: flags=28b43<UP,BROADCAST,RUNNING,PROMISC,ALLMULTI,SIMPLEX,MULTICAST,NOINET6> mtu 1500
        lladdr 94:de:80:6c:e5:e3
        priority: 0
        media: Ethernet autoselect (100baseTX full-duplex,rxpause,txpause)
        status: active
enc0: flags=20000<NOINET6>
        priority: 0
        groups: enc
        status: active
athn0: flags=28943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST,NOINET6> mtu 1500
        lladdr e8:de:27:20:1d:24
        priority: 4
        groups: wlan
        media: IEEE802.11 autoselect mode 11b hostap
        status: active
        ieee80211: nwid OpenBSD chan 2 bssid e8:de:27:20:1d:24 wpakey <not displayed> wpaprotos wpa1,wpa2 wpaakms psk wpaciphers tkip,ccmp wpagroupcipher tkip
vether0: flags=28943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST,NOINET6> mtu 1500
        lladdr fe:e1:ba:d0:4c:c6
        priority: 0
        groups: vether
        media: Ethernet autoselect
        status: active
        inet 172.16.0.1 netmask 0xffffff00 broadcast 172.16.0.255
vether1: flags=28943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST,NOINET6> mtu 1500
        lladdr fe:e1:ba:d1:04:6b
        priority: 0
        groups: vether
        media: Ethernet autoselect
        status: active
        inet 10.0.2.0 netmask 0xff000000 broadcast 10.255.255.255
tun0: flags=29903<UP,BROADCAST,PROMISC,SIMPLEX,LINK0,MULTICAST,NOINET6> mtu 1500
        lladdr fe:e1:ba:d3:4d:1e
        priority: 0
        groups: tun
        status: no carrier
bridge0: flags=20041<UP,RUNNING,NOINET6>
        groups: bridge
        priority 32768 hellotime 2 fwddelay 15 maxage 20 holdcnt 6 proto rstp
        vether0 flags=3<LEARNING,DISCOVER>
                port 6 ifpriority 0 ifcost 0
        vether1 flags=3<LEARNING,DISCOVER>
                port 7 ifpriority 0 ifcost 0
        re1 flags=7<LEARNING,DISCOVER,BLOCKNONIP>
                port 2 ifpriority 0 ifcost 0
        tun0 flags=7<LEARNING,DISCOVER,BLOCKNONIP>
                port 9 ifpriority 0 ifcost 0
        athn0 flags=7<LEARNING,DISCOVER,BLOCKNONIP>
                port 5 ifpriority 0 ifcost 0
pflog0: flags=20141<UP,RUNNING,PROMISC,NOINET6> mtu 33144
        priority: 0
        groups: pflog
Hostnames -
Code:
$ cat /etc/hostname.athn0                                                                                                                                 
up media autoselect mediaopt hostap mode 11b chan 6 nwid OpenBSD wpakey XXXXXXXXXX

$ cat /etc/hostname.re0
dhcp -inet6

$ cat /etc/hostname.re1 
up -inet6

$ cat /etc/hostname.vether0
inet 172.16.0.1 255.255.255.0 172.16.0.255 -inet6

$ cat /etc/hostname.tun0                                                                                                                                         
link0 up 

$ cat /etc/hostname.vether1 
inet 10.0.2.0 255.0.0.0 NONE

$ cat /etc/hostname.bridge0     
add vether0
add vether1
add re1
blocknonip re1
add tun0
blocknonip tun0
add athn0
blocknonip athn0
up -inet6
Appropriate pf.conf -
Code:
# cat /etc/pf.conf
#       $OpenBSD: pf.conf,v 1.53 2014/01/25 10:28:36 dtucker Exp $
#
set limit states 100000
ext_if="re0"
wi_if="athn0"
int_if="vether0 re1 vether1 tun0 athn0"
..........
set block-policy return
set loginterface egress
set skip on lo

match in all scrub (no-df random-id max-mss 1440)
match out on egress inet from !(egress:network) to any nat-to (egress:0)
......
Routing tables -
Code:
$ netstat -rnf inet
Routing tables

Internet:
Destination        Gateway            Flags   Refs      Use   Mtu  Prio Iface
default            10.20.30.1         UGS        5    14559     -     8 re0  
10/8               link#7             UC         0        0     -     4 vether1
10.0.2.0           fe:e1:ba:d1:f1:81  UHLl       0        0     -     1 lo0  
10.20.30/24        link#1             UC         1        0     -     4 re0  
10.20.30.1         c0:4a:00:4a:96:7d  UHLc       2        1     -     4 re0  
10.20.30.103       94:de:80:6c:e5:e1  UHLl       0        0     -     1 lo0  
127/8              127.0.0.1          UGRS       0        0 32768     8 lo0  
127.0.0.1          127.0.0.1          UH         9    76238 32768     4 lo0  
172.16.0/24        link#6             UC         0        0     -     4 vether0
172.16.0.1         fe:e1:ba:d0:f4:4a  UHLl       2     2853     -     1 lo0  
224/4              link#1             UCS        0        0     -     8 re0
When I try to connect devices, it goes in scanning mode and then errors.

I see channel mismatch errors with netstat on athn0 -
Code:
$ netstat -W athn0
ieee80211 on athn0:
        ......
        0 input packets with invalid channel
        7932 input packets with mismatched channel
I have never tried Wireless on BSDs before and I do not know what to do here. Please help me connect my devices to AP.

Thanks!

Last edited by chigurh; 19th February 2015 at 07:33 AM.
Reply With Quote
  #2   (View Single Post)  
Old 19th February 2015
TronDD TronDD is offline
Package Pilot
 
Join Date: Sep 2014
Posts: 172
Default

I'll be interested to see if this can be solved by someone. I was never able to get my WiFi AP to work in a similar vether/bridge configuration. I had to remove the wireless interface from the bridge and assign it an IP. Then everything worked fine.

Try that to start with, to eliminate some of the complexity from your configuration.
Reply With Quote
  #3   (View Single Post)  
Old 19th February 2015
chigurh chigurh is offline
Port Guard
 
Join Date: Jul 2014
Posts: 28
Default

Quote:
Originally Posted by TronDD View Post
I'll be interested to see if this can be solved by someone. I was never able to get my WiFi AP to work in a similar vether/bridge configuration. I had to remove the wireless interface from the bridge and assign it an IP. Then everything worked fine.

Try that to start with, to eliminate some of the complexity from your configuration.
I attempted it already but did not work, for the sake of clarity I will post the details.

Code:
$ ifconfig
.............
athn0: flags=28843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,NOINET6> mtu 1500
        lladdr e8:de:27:20:1d:24
        priority: 4
        groups: wlan
        media: IEEE802.11 autoselect hostap (autoselect mode 11b hostap)
        status: active
        ieee80211: nwid OpenBSD chan 2 bssid e8:de:27:20:1d:24 wpakey <not displayed> wpaprotos wpa1,wpa2 wpaakms psk wpaciphers tkip,ccmp wpagroupcipher tkip
        inet 172.16.0.200 netmask 0xffff0000 broadcast 172.16.255.255
Code:
$ cat /etc/hostname.athn0                                                                                                                                        
inet 172.16.0.200
mediaopt hostap 
nwid OpenBSD 
wpakey XXXXXXXXXX
I have tried several things so far but it did not work.
Reply With Quote
  #4   (View Single Post)  
Old 19th February 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,256
Default

Hello, and welcome!

I have an athn(4) device that I have used as an AP once in a great while, and it has worked. There are two differences between my NIC and yours:
  1. Mine is PCI rather than USB
  2. My athn(4) NIC autoselects 802.11g
I don't think we could use my computer to recreate your problem. Same driver, but different media options and different bus.

IS this AP 802.11g capable?

Last edited by jggimi; 19th February 2015 at 06:01 PM. Reason: clarity
Reply With Quote
  #5   (View Single Post)  
Old 19th February 2015
chigurh chigurh is offline
Port Guard
 
Join Date: Jul 2014
Posts: 28
Default

Quote:
Originally Posted by jggimi View Post
Hello, and welcome!

I have an athn(4) device that I have used as an AP once in a great while, and it has worked. There are two differences between my NIC and yours:
  1. Mine is PCI rather than USB
  2. My athn(4) NIC autoselects 802.11g
I don't think we could use my computer to recreate your problem. Same driver, but different media options and different bus.

IS this AP 802.11g capable?
As per vendor documentation & features published the frequency synthesizer supports frequencies defined by IEEE 802.11b/g/n specifications.

More hardware detail -

Code:
$ lsusb -v
.......
Bus 000 Device 005: ID 0cf3:9271 Atheros Communications, Inc. AR9271 802.11n
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          255 Vendor Specific Class
  bDeviceSubClass       255 Vendor Specific Subclass
  bDeviceProtocol       255 Vendor Specific Protocol
  bMaxPacketSize0        64
  idVendor           0x0cf3 Atheros Communications, Inc.
  idProduct          0x9271 AR9271 802.11n
  bcdDevice            1.08
  iManufacturer          16 ATHEROS
  iProduct               32 USB2.0 WLAN
  iSerial                48 12345
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           60
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           6
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x04  EP 4 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x05  EP 5 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x06  EP 6 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass          255 Vendor Specific Class
  bDeviceSubClass       255 Vendor Specific Subclass
  bDeviceProtocol       255 Vendor Specific Protocol
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0000
  (Bus Powered)
The device autoselects 11b hostap mode.

I wish this somehow works so that I can remove ASUS AP; which is unreliable. I have a spare PCI WiFi card but I can not use that in this setup, planning to install dual port Intel gigabit PCI lan card there. My board, Gigabyte GA-C1007UN has a single PCI slot available.

Thanks!

Last edited by chigurh; 19th February 2015 at 07:00 PM.
Reply With Quote
  #6   (View Single Post)  
Old 2nd March 2015
chigurh chigurh is offline
Port Guard
 
Join Date: Jul 2014
Posts: 28
Default

For over a week I tried several things but creating a bridged interface with athn0 was impossible. It did not work with different subnet either.

I have now configured a spare ASUS router with openwrt firmware & setup a gateway pointing to OpenBSD router.
Reply With Quote
  #7   (View Single Post)  
Old 2nd March 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,256
Default

The usb athn(4) driver is currently undergoing some active development right now. This may not make the 5.7 window, as the release development cycle is in its final stage.
Reply With Quote
  #8   (View Single Post)  
Old 2nd March 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,256
Default

The work was just committed. It will be included in 5.7.
Reply With Quote
  #9   (View Single Post)  
Old 2nd March 2015
bsd-keith bsd-keith is offline
Real Name: Keith
Open Source Software user
 
Join Date: Jun 2014
Location: Surrey/Hants Border, England
Posts: 164
Default

That's good to know, as most of my laptop wifi cards are using that driver.
__________________
Linux since 1999, & also a BSD user.
Reply With Quote
Old 3rd March 2015
chigurh chigurh is offline
Port Guard
 
Join Date: Jul 2014
Posts: 28
Default

Quote:
Originally Posted by jggimi View Post
The work was just committed. It will be included in 5.7.
Great news, thanks. There really isn't much option or scope for selection with wireless hardware and it hurts.
Reply With Quote
Old 3rd March 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,256
Default

$ apropos wireless shows me a list of 28 WiFi drivers, 11 of them with USB attachment in the man page description. athn(4) has USB connectivity but doesn't mention it there; and there may be others among the 28 like that.

Here are the 11 that are specifically USB attachable. I have a urtwn(4) device, for use as a backup.
Code:
atu(4)	Atmel AT76C50x USB IEEE 802.11b wireless network device
otus(4)	Atheros USB IEEE 802.11a/b/g/n wireless network device
rsu(4)	Realtek RTL8188SU/RTL8192SU USB IEEE 802.11b/g/n wireless network device
rum(4)	Ralink Technology USB IEEE 802.11a/b/g wireless network device
run(4)	Ralink Technology USB IEEE 802.11a/b/g/n wireless network device
uath(4)	Atheros USB IEEE 802.11a/b/g wireless network device
upgt(4)	Conexant/Intersil PrismGT SoftMAC USB IEEE 802.11b/g wireless network device
ural(4)	Ralink Technology USB IEEE 802.11b/g wireless network device
urtw(4)	Realtek RTL8187L/RTL8187B USB IEEE 802.11b/g wireless network device
urtwn(4)	Realtek RTL8188CU/RTL8192CU USB IEEE 802.11b/g/n wireless network device
zyd(4)	ZyDAS ZD1211/ZD1211B USB IEEE 802.11b/g wireless network device

Last edited by jggimi; 3rd March 2015 at 01:33 PM. Reason: clarity
Reply With Quote
Old 3rd March 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,256
Default

Update -- after this set of patches for athn on USB, the athn(4) man page has this added to the BUGS section:
Quote:
Host AP mode does not work with USB devices.
These commits will improve athn on USB, but only for client functions
Reply With Quote
Old 4th March 2015
chigurh chigurh is offline
Port Guard
 
Join Date: Jul 2014
Posts: 28
Default

Quote:
Originally Posted by jggimi View Post
Update -- after this set of patches for athn on USB, the athn(4) man page has this added to the BUGS section:
These commits will improve athn on USB, but only for client functions
Alright, I will get a new device for Host AP mode.
Reply With Quote
Old 7th April 2015
aht0 aht0 is offline
Port Guard
 
Join Date: Nov 2014
Posts: 16
Default

Quote:
Originally Posted by chigurh View Post
I wish this somehow works so that I can remove ASUS AP; which is unreliable. I have a spare PCI WiFi card but I can not use that in this setup, planning to install dual port Intel gigabit PCI lan card there. My board, Gigabyte GA-C1007UN has a single PCI slot available.

Thanks!
Have you considered USB3/PCIe riser cable? It should do the trick and give you "extra" pci express slot. Bitcoin miners used to use those and market should be well supplied since the bitcoin-bubble is over.
sample
http://www.ebay.ie/itm/PCI-E-PCI-Exp...item20f9c75478

Quote:
Originally Posted by jggimi View Post
The usb athn(4) driver is currently undergoing some active development right now. This may not make the 5.7 window, as the release development cycle is in its final stage.
Would the new driver support 802.11na (5GHz band) and newer Atheros cards/chipsets like "AR9580" (Mikrotik r11e-5hnd)?
Reply With Quote
Old 7th April 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,256
Default

Quote:
Originally Posted by aht0 View Post
Would the new driver support 802.11na (5GHz band) and newer Atheros cards/chipsets like "AR9580" (Mikrotik r11e-5hnd)?
It's not a new driver, it's revision to an existing driver - specifically the USB attached athn(4) driver. (USB and PCI athn drivers share a name, man page, and functionality, but they are different source code modules.)

802.11a/b/g are supported. 802.11n requires significant revision to the the ieee80211(9) set of functions.
Reply With Quote
Reply

Tags
athn0, routing, wireless ap

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
Wireless Setup With AuthPF Help EverydayDiesel OpenBSD Security 3 2nd July 2014 11:38 PM
Help me setup my new router Sonya FreeBSD General 8 16th July 2013 11:33 AM
Question regarding wireless setup stealintv FreeBSD General 5 19th September 2008 07:36 PM
Connecting to wireless router TomAmundsen FreeBSD General 19 25th August 2008 10:14 PM
Wireless + wired = confused network setup davidgurvich FreeBSD General 3 27th May 2008 06:10 PM


All times are GMT. The time now is 01:32 AM.


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