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 1 Week Ago
chigurh chigurh is offline
New User
 
Join Date: Jul 2014
Posts: 3
Thanked 0 Times in 0 Posts
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; 1 Week Ago at 07:33 AM.
Reply With Quote
  #2   (View Single Post)  
Old 1 Week Ago
TronDD TronDD is offline
Port Guard
 
Join Date: Sep 2014
Posts: 28
Thanked 0 Times in 0 Posts
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 1 Week Ago
chigurh chigurh is offline
New User
 
Join Date: Jul 2014
Posts: 3
Thanked 0 Times in 0 Posts
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 1 Week Ago
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 4,064
Thanked 214 Times in 189 Posts
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; 1 Week Ago at 06:01 PM. Reason: clarity
Reply With Quote
  #5   (View Single Post)  
Old 1 Week Ago
chigurh chigurh is offline
New User
 
Join Date: Jul 2014
Posts: 3
Thanked 0 Times in 0 Posts
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; 1 Week Ago at 07:00 PM.
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 02:00 PM.


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