Wireless Access Point FreeBSD

From Teknologisk videncenter
Jump to: navigation, search

Cisco AIR-PI21AG-E-K9 adapter installed. FreeBSD installs right driver

RC.CONF

ifconfig_em0="dhcp"
gateway_enable="YES"
dhcpd_enable="YES"
ipnat_enable="YES" # Start ipnat function
ipnat_rules="/etc/ipnat.rules" # rules definition file for ipnat

ifconfig before script

[root@ /etc]# ifconfig
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=219b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MAGIC>
        ether 70:f3:95:08:46:c7
        inet 192.168.139.51 netmask 0xffffff00 broadcast 192.168.139.255
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
ath0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 2290
        ether 00:40:96:b2:b3:75
        media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
        status: no carrier
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=3<RXCSUM,TXCSUM>
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
        inet6 ::1 prefixlen 128
        inet 127.0.0.1 netmask 0xff000000
        nd6 options=3<PERFORMNUD,ACCEPT_RTADV>

Script

Running the script below

#from man ath
#Se http://www.freebsd.org/doc/handbook/network-wireless.html
ifconfig wlan0 create wlandev ath0 wlanmode hostap
ifconfig wlan0 inet 10.168.139.1 netmask 0xffffff00 ssid FreeBSD weptxkey 1 wepmode on wepkey 1:0x1234567890 mode 11g
sysctl net.inet.ip.forwarding=1

ifconfig after script

em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=219b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MAGIC>
        ether 70:f3:95:08:46:c7
        inet 192.168.139.51 netmask 0xffffff00 broadcast 192.168.139.255
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 2290
        ether 00:40:96:b2:b3:75
        media: IEEE 802.11 Wireless Ethernet autoselect mode 11g <hostap>
        status: running
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=3<RXCSUM,TXCSUM>
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
        inet6 ::1 prefixlen 128
        inet 127.0.0.1 netmask 0xff000000
        nd6 options=3<PERFORMNUD,ACCEPT_RTADV>
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 00:40:96:b2:b3:75
        inet 10.168.139.1 netmask 0xffffff00 broadcast 10.168.139.255
        media: IEEE 802.11 Wireless Ethernet autoselect mode 11g <hostap>
        status: running
        ssid FreeBSD channel 7 (2442 MHz 11g) bssid 00:40:96:b2:b3:75
        regdomain 55 indoor ecm authmode OPEN privacy ON deftxkey 1
        wepkey 1:40-bit txpower 20 scanvalid 60 protmode CTS wme burst
        dtimperiod 1 -dfs