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)


    # Define interface
    # Select driver
    # Set access point name
    # Set access point harware mode to 802.11g
    # Set WIFI channel (can be easily changed)
    # Enable WPA2 only (1 for WPA, 2 for WPA2, 3 for WPA + WPA2)
    # Bind to only one interface
    # Choose interface for binding
    # Specify range of IP addresses for DHCP leasses
In order to initialize AP1 I use following bash-script


    # Start
    # Configure IP address for WLAN
    sudo ifconfig wlan0
    # 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).


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

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.