Multiple SSID hostapd centos 6.4

Kf Lee kflee2000
Tue Nov 19 16:12:57 PST 2013


 HI,

I managed to get the multiple SSIDs working on my Linuxmint 15. Thank
to Jan to gave me the first advice to understand the basic and I just
apply the basic to this multiple SSIDs issue. In the example below,
all five SSISs work fine, I can connect using my phone and see skype
green tick appear as well as browse website.

One thing I noted is that the time allowed for typing pass phrase is
rather short, and some time it automatically connect to another
existing known ap before I finish enter the pass phrase.  I am not
sure this is the problem on phone side or on server side. I just setup
pass phrase before try to connect.

The steps are as follow:

1) /etc/network/interfaces

 auto lo
 iface lo inet loopback

 iface eth0 inet static
 address 192.168.1.111
 netmask 255.255.255.0
 gateway 192.168.1.5

 auto eth0

 auto wlan0
 allow-hotplug wlan0
 iface wlan0 inet static
   address 10.0.0.1
   netmask 255.255.255.0

 auto wlan0_0
 allow-hotplug wlan0_0
 iface wlan0_0 inet static
   address 10.0.1.1
   netmask 255.255.255.0

 auto wlan0_1
 allow-hotplug wlan0_1
 iface wlan0_1 inet static
   address 10.0.2.1
   netmask 255.255.255.0

 auto wlan0_2
 allow-hotplug wlan0_2
 iface wlan0_2 inet static
   address 10.0.3.1
   netmask 255.255.255.0

2) /etc/dhcp/dhcpd.conf

 ddns-update-style none;
 ignore client-updates;
 authoritative;

 subnet 10.0.0.0 netmask 255.255.255.0 {
     interface wlan0;
     option routers 10.0.0.1;
     option subnet-mask 255.255.255.0;
     option broadcast-address 10.0.0.255;
     option domain-name-servers 211.154.135.158;
     option time-offset 0;
     default-lease-time 172800;
     max-lease-time 182800;
     range 10.0.0.10 10.0.0.30;
 }

     option broadcast-address 10.0.1.255;
     option domain-name-servers 211.154.135.158;
     option time-offset 0;
     default-lease-time 172800;
     max-lease-time 182800;
     range 10.0.1.40 10.0.1.50;
 }

 subnet 10.0.2.0 netmask 255.255.255.0 {

     interface wlan0_1;
     option routers 10.0.2.1;
     option subnet-mask 255.255.255.0;
     option broadcast-address 10.0.2.255;
     option domain-name-servers 211.154.135.158;
     option time-offset 0;
     default-lease-time 172800;
     max-lease-time 182800;
     range 10.0.2.90 10.0.2.120;
 }

 subnet 10.0.3.0 netmask 255.255.255.0 {
     interface wlan0_2;
     option routers 10.0.3.1;
     option subnet-mask 255.255.255.0;
     option broadcast-address 10.0.3.255;
     option domain-name-servers 211.154.135.158;
     option time-offset 0;
     default-lease-time 172800;
     max-lease-time 182800;
     range 10.0.3.130 10.0.3.160;
 }


3) /etc/hostapd/hostapd.conf

interface=wlan0
 driver=nl80211
 #bssid=02:dd:90:44:50:f0
 ctrl_interface=/var/run/hostapd
 ctrl_interface_group=0
 ssid=TEST19A
 hw_mode=g
 channel=8
 wpa=2
 wpa_passphrase=aabb327119
 wpa_key_mgmt=WPA-PSK
 wpa_pairwise=CCMP
 rsn_pairwise=CCMP
 beacon_int=100
 auth_algs=3
 wmm_enabled=1

 bss=wlan0_0
 ssid=TEST19A0
 hw_mode=g
 channel=8
 wpa=2
 wpa_passphrase=0000327119
 wpa_key_mgmt=WPA-PSK
 rsn_pairwise=CCMP
 beacon_int=100
 auth_algs=3
 wmm_enabled=1

bss=wlan0_1
 ssid=TEST19A1
 hw_mode=g
 channel=8
 wpa=2
 wpa_passphrase=1111327119
 wpa_key_mgmt=WPA-PSK
 rsn_pairwise=CCMP
 beacon_int=100
 auth_algs=3
 wmm_enabled=1

 bss=wlan0_2
 ssid=TEST19A2
 hw_mode=g
 channel=8
 wpa=2
 wpa_passphrase=2222327119
 wpa_key_mgmt=WPA-PSK
 rsn_pairwise=CCMP
 beacon_int=100
 auth_algs=3
 wmm_enabled=1


4) setup IPTABLES

 sysctl -w net.ipv4.ip_forward=1
 echo 1 > /proc/sys/net/ipv4/ip_forward

 iptables --flush
 iptables --table nat --flush
 iptables --delete-chain
 iptables --table nat --delete-chain
 iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
 iptables -A FORWARD -o eth0 -i wlan0 -s 10.0.0.0/24 -m conntrack
--ctstate NEW -j     ACCEPT
 iptables -A FORWARD -o eth0 -i wlan0_0 -s 10.0.1.0/24 -m conntrack
--ctstate NEW -j   ACCEPT
 iptables -A FORWARD -o eth0 -i wlan0_1 -s 10.0.2.0/24 -m conntrack
--ctstate NEW -j   ACCEPT
 iptables -A FORWARD -o eth0 -i wlan0_2 -s 10.0.3.0/24 -m conntrack
--ctstate NEW -j   ACCEPT
 iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
 iptables --append FORWARD --in-interface wlan0 -j ACCEPT
 iptables --append FORWARD --in-interface wlan0_0 -j ACCEPT
 iptables --append FORWARD --in-interface wlan0_1 -j ACCEPT
 iptables --append FORWARD --in-interface wlan0_2 -j ACCEPT

 iptables-save
 iptables -L

I hope this will be helpful for your Linux.

rgds,
kfl.

On Tue, Nov 19, 2013 at 10:22 PM, Jonathan Bither <jonbither at gmail.com> wrote:
> On 11/18/2013 07:46 PM, Frank Posito wrote:
>>
>> Hello,
>>
>> I am trying to setup mutiple SSID with the goal of having VLAN tagging
>> on each SSID
>>
>> I am using hostapd v2.0 on Centos6.4
>> The chipset is Atheros AR9271 (WNA1100)
>>
>>
>>
>> My wireless MAC address is  20:E5:2A:E8:DB:77 and i changed it to
>> 02:E5:2A:E8:DB:30
>>
>> I tried to follow
>> http://wiki.stocksy.co.uk/wiki/Multiple_SSIDs_with_hostapd (even if
>> ti's for Ubuntu)
>>
>> To keep it simple for now. This is my configuration file
>> ----
>> interface=wlan0
>> bssid=02:E5:2A:E8:DB:30
>> driver=nl80211
>>
>> ssid=ssid1
>> channel=1
>>
>> bss=wlan0_0
>> ssid=ssid2
>>
>> bss=wlan0_1
>> ssid=ssid3
>>
>> bss=wlan0_2
>> ssid=ssid4
>> ----
>>
>> The problem seems to appear when it's trying to create wlan0_0
>>
>> Could not set interface wlan0_0 flags (UP): Device or resource busy
>> nl80211: Remove interface ifindex=16
>> Failed to add BSS (BSSID=02:e5:2a:e8:db:31)
>> wlan0: Unable to setup interface.
>> wlan0: Flushing old station entries
>> wlan0: Deauthenticate all stations
>> nl80211: CMD_FRAME freq=2412 wait=0 no_cck=0 no_ack=0 offchanok=0
>> nl80211: Frame TX command accepted; cookie 0xffff8800372d1180
>>
>>
>> Could you give me a hint on the problem ?
>>
>> Thanks,
>> Frank
>> _______________________________________________
>> HostAP mailing list
>> HostAP at lists.shmoo.com
>> http://lists.shmoo.com/mailman/listinfo/hostap
>>
> That link TBH isn't really beneficial for a CentOS/RHEL setup. I run a very
> similar setup, however I don't recall actually using the distro kernel. I
> use elrepo and crda/iw/hostapd from GIT. I also remember having to create a
> dummy ifcfg-wlan0 for some reason or another.
>
> [jonathan at jonbither ~]$ cat /etc/sysconfig/network-scripts/ifcfg-wlan0
> DEVICE="wlan0"
> HWADDR="E0:B9:A5:9B:C2:94"
> NM_CONTROLLED="no"
> ONBOOT="yes"
> TYPE="Ethernet"
> UUID="73d3ed28-9f14-4bd3-9a44-c7feb144cb1c"
> BOOTPROTO="none"
>
> Here is my /etc/init.d/hostapd
>
> [jonathan at jonbither ~]$ cat /etc/init.d/hostapd
> #!/bin/sh
> #
> # start/stop the hostapd server
> #
> # chkconfig: 2345 99 10
> # description: hostap daemon
> # processname: hostapd
> # config: /etc/hostapd.conf
> # pidfile: /var/run/hostapd.pid
> #
> PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin
> export PATH
>
> # Source function library.
> . /etc/rc.d/init.d/functions
>
> stop()
> {
>  echo -n "Stopping hostapd daemon: "
>         killproc hostapd
>         echo
>         rm -f /var/lock/subsys/hostapd
>
> }
>
> start()
> {
>         echo -n "Starting hostapd daemon: "
>         daemon /usr/local/bin/hostapd /etc/hostapd/hostapd.conf -P
> /var/run/hostapd.pid -B
>         echo
>         touch /var/lock/subsys/hostapd
> }
>
> # See how we were called.
> case "$1" in
>     start)
>         start
>         ;;
>     stop)
>         stop
>         ;;
>     status)
>         status hostapd
>         ;;
>     restart)
>         stop
>         start
>         ;;
>     *)
>         echo "Usage: hostapd {start|stop|status|restart}"
>         exit 1
> esac
>
> exit 0
>
>
> Hope it helps.
>
> _______________________________________________
> HostAP mailing list
> HostAP at lists.shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap



-- 
-----------------------------------------------------------------------------------------------------------



More information about the Hostap mailing list