Yes it is possible to create one or 2 APs using 2 wifi card and one ethernet interface
Install the hostapd
package and the create_ap
tool :
sudo apt install hostapd
git clone https://github.com/oblique/create_ap
cd create_ap
sudo make install
Create the first AP : AP1
create_ap wlan0 eth0 MyAP1 MyPassPhrase1
Create the second AP : AP2
create_ap wlan1 eth0 MyAP2 MyPassPhrase2
You can specify the driver --driver ath5k
as motioned by the create_ap developper's.
Next step you should edit your /etc/dnsmasq.conf
to bind a MAC address to a specific IP address. Add the following line
#The `wlan0`:
dhcp-host:XX:XX:XX:XX:XX,10.0.1.1
#The dhcp range :
interface=wlan0
except-interface=wlan1
dhcp-range=10.0.1.100,10.0.1.120
#The `wlan1`:
dhcp-host:XX:XX:XX:XX:XX,10.0.2.1
#The dhcp range :
interface=wlan1
except-interface=wlan0
dhcp-range=10.0.2.100,10.0.2.120
Change the XX:XX:XX:XX:XX
with the MAC adress of your wlan0
and wlan1
This is as simple as it could be. You do not need any bridging.
Just MASQUERADE your local network on RPi:
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
Enable forwarding of traffic:
echo 1 > /proc/sys/net/ipv4/ip_forward
RPi will not work as invisible bump-on-the-wire but will need a network setup between
it and your private router – which will use ip address of RPi's eth0 as gateway.
So it will look like this:
(RPi wlan0) -- MASQUERADE -- (RPi eth0;192.168.99.254/24) → (WAN on Private Router,192.168.99.1/24)
Cheers,
Best Answer
This is not possible.
"Note that a bridge cannot be established over Wi-Fi networks operating in Ad-Hoc or Infrastructure modes. This is due to the IEEE 802.11 standard that specifies the use of 3-address frames in Wi-Fi for the efficient use of airtime."
Source: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Networking_Guide/ch-Configure_Network_Bridging.html