4

I am trying to set up 2 wireless access points from linux device (Debian Jessy). Both AP's should work simultaneously & share Internet connection (as shown below).

    _____       ___________ 
    |   | eth0 |           | wlan0(AccessPoint 2.5G) 
    |box|-----< Eth       USB1>WLAN0_Stick <<<<<<  Smartphone
    |___|      | Debian    | 
               | Device    | wlan1(AccessPoint 5G)
               |          USB2>WLAN1_Stick <<<<<<  PC/Laptop
               |___________|
My initial config (hostapd & dnsmasq) for single wlan0 (AccessPoint 2.5G)

/etc/hostapd.conf

    # Define interface
    interface=wlan0
    # Select driver
    driver=nl80211
    # Set access point name
    ssid=AP-wifi-2G
    # Set access point harware mode to 802.11g
    hw_mode=g
    # Set WIFI channel (can be easily changed)
    channel=6
    # Enable WPA2 only (1 for WPA, 2 for WPA2, 3 for WPA + WPA2)
    wpa=2
    wpa_passphrase=wifi123456
/etc/dnsmasq.conf
    # Bind to only one interface
    bind-interfaces
    # Choose interface for binding
    interface=wlan0
    # Specify range of IP addresses for DHCP leasses
    dhcp-range=192.168.150.2,192.168.150.10
In order to initialize AP1 I use following bash-script

start.sh

    !/bin/bash
    # Start
    # Configure IP address for WLAN
    sudo ifconfig wlan0 192.168.150.1
    # Start DHCP/DNS server
    sudo service dnsmasq restart
    # Enable routing
    sudo sysctl net.ipv4.ip_forward=1
    # Enable NAT
    sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
    # Run access point daemon
    sudo hostapd /etc/hostapd.conf
    # Stop
    # Disable NAT
    sudo iptables -D POSTROUTING -t nat -o eth0 -j MASQUERADE
    # Disable routing
    sudo sysctl net.ipv4.ip_forward=0
    # Disable DHCP/DNS server
    sudo service dnsmasq stop

This config works fine for single AP (wlan0, AccessPoint 2.5G) I added the 2nd config /etc/hostapd_5G.conf for wlan1 similar as /etc/hostapd.conf & changed dnsmasq.conf & start.sh (wlan0->wlan1 for testing) - it also worked good in 5G.

But I need to run wlan0 AP & wlan1 AP simultaneously. I think I need to modify dnsmasq.conf for second interface. But I don't know how to do this.

Anyone please help with simultaneous configuration (wlan0 AP & wlan1 AP).

0

I think you will need to bridge the wlan0 and wlan1 somehow. You can see OpenWRT does that. Have a look at bridge-utils package.

Adding this to /etc/network/interfaces may help:

auto wifi0
iface wifi0 inet static
    bridge_ports wlan0 wlan1
    address 192.168.1.1
    netmask 255.255.255.0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.