Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Mar 2017 12:36:37 -0400
From:      Ernie Luzar <luzar722@gmail.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: WIFI as access point
Message-ID:  <58CABF15.3070800@gmail.com>
In-Reply-To: <CAKXfWbRj_ZxVpVSD7vbqgEroV=vKNka_vJbB5YGLkgwOGM=fKA@mail.gmail.com>
References:  <58C08444.8060600@gmail.com> <58C17FEB.1020905@FreeBSD.org> <58C96961.9010804@gmail.com> <CAKXfWbRj_ZxVpVSD7vbqgEroV=vKNka_vJbB5YGLkgwOGM=fKA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
>>
>> Hello List;
>> 
>> I have this wifi card
>> http://www.dlink.com/al/sq/products/dwa-556-xtreme-n-pci-express-desktop-adapter
>>
>> I recovered it from a decommissioned win7 box. On win7 this wifi card
>> could only be used to connect to a router access point.
>> 
>  This card is fully support by ath driver as "AR5418 Wireless Network
>  Adapter". Complete examples with various AP setup described in 
>  manual page for the ath driver.
> 

Thank you to all who replied.

This is for the archives. I have successfully gotten this wifi card to
work in "access point" mode. I am posting the solution for others who
may have the same problem.

/root >cat /etc/rc.conf
Snip
gateway_enable="YES"

ifconfig_em0="DHCP"
ifconfig_vge0="inet 10.0.10.2"

# Wifi in hostapt mode
wlans_ath0="wlan0"
create_args_wlan0="wlanmode hostap"
ifconfig_wlan0="inet 10.200.200.1 netmask 255.255.255.0 ssid FBSD_AP
mode 11ng channel 2"
hostapd_enable="YES"

The IP address you assign here is not just something you guess at.
It has to be the end point ip address defined in dhcp.

Using "mode 11ng channel 2" stopped the
"ath0: stuck beacon; resetting (bmiss count 4)" message.
It also gaves a connection speed of 150 Mbps

dhcpd_enable="YES"
dhcpd_conf="/usr/local/etc/dhcpd.conf"
dhcpd_ifaces="vge0 wlan0"
dhcpd_flags="-q"

The host dhcp server must be told to service both the wired LAN (vge0)
and the wifi LAN (wlan0) interfaces.

/root >cat /usr/local/etc/dhcpd.conf

# This is the WIFI subnet declaration.
# Max of 14 pc on WIFI network  10.200.200.1 - 10.200.200.14
# 10.200.200.1 wifi card ip address

subnet 10.200.200.0 netmask 255.255.255.240 {
range 10.200.200.2 10.200.200.14;
option routers 10.200.200.1;}


/root >cat /etc/hostapd.conf
# Note1 There can not be any white space after wlan0
interface=wlan0
debug=2
ctrl_interface=/var/run/hostapd
ctrl_interface_group=wheel
ssid=FBSD_AP
wpa=2
wpa_passphrase=test

# Note2 "WPA-PSK" & "TKIP CCMP"  are upper case letters
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP



Your Firewall has to be configured to perform NAT on the IP address
block you defined in dhcp.

Rebooting the system synced things together better than just restarting
the network using /etc/rc.d/netif/restart. Rebooting made problems I was
having just vanish.

If you try to have another PC do a wifi connect at this point, it will
get a connection with your Freebsd wifi access point, but no internet
access. I was stuck at this point for a long time.

I finally added a firewall rule to log all traffic on the wlan0
interface. That's when I saw the igmp multcast packets going to ip
address 224.0.0.22. This behavior is not documented any where.

Adding the following rule to my IPF firewall got my wifi network access 
point accepting client wifi connections and providing public internet 
access with 150Mbps connection speed.


IPF firewall rule
# Allow out access for WIFI check for public internet access.
pass out quick on em0 proto igmp from any to 224.0.0.22 keep state

You can use this command to see the wifi access point connections.

ifconfig wlan0 list sta








Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?58CABF15.3070800>