我正在尝试从linux设备(Debian )设置2个无线接入点。两个AP应该同时工作&共享Internet连接(如下图所示)。
_____ ___________
| | eth0 | | wlan0(AccessPoint 2.5G)
|box|-----< Eth USB1>WLAN0_Stick <<<<<< Smartphone
|___| | Debian |
| Device | wlan1(AccessPoint 5G)
| USB2>WLAN1_Stick <<<<<< PC/Laptop
|___________|我对单wlan0 (AccessPoint 2.5G)的初始配置(hostapd & dnsmasq)
/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为了初始化AP1,我使用以下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这个配置对于单个AP (wlan0,AccessPoint 2.5G)很好--我为wlan1添加了第二个配置/etc/hostapd_5G.conf,类似于/etc/hostapd.conf & changed dnsmasq.conf & start.sh (wlan1 0->wlan1 1用于测试)--它在5G中也运行良好。
但是我需要同时运行wlan0 AP和wlan1 AP。我认为我需要为第二个接口修改dnsmasq.conf。但我不知道该怎么做。
任何人请帮助同时配置(wlan0 AP和wlan1 AP)。
发布于 2018-07-18 18:12:22
我认为您需要以某种方式将wlan0和wlan1连接起来。你可以看到OpenWRT这样做。请看一下bridge-utils包。
将其添加到/etc/网络/接口中可能会有所帮助:
auto wifi0
iface wifi0 inet static
bridge_ports wlan0 wlan1
address 192.168.1.1
netmask 255.255.255.0https://unix.stackexchange.com/questions/370367
复制相似问题