sdelrio / rpi-hostap

Transform your PI into a Wireless Router (DHCP and WPA2 already insisde)
76 stars 65 forks source link

Share wifi from one wireless device to another #12

Closed aaronik closed 4 years ago

aaronik commented 5 years ago

Hello,

First of all, thank you for making this! I'm using it as a primary routing utility for my raspberry pi.

What I want to do is get wifi from one wifi device (which happens to be a big antenna) and then broadcast it as a local network. My big antenna is wlan1 and the interface I want to create the AP on is wlan0. If I have to disable wpa_supplicant, though, I can't connect to WPA networks using wlan1.

Is there any way to reconcile this? To still connect to a WPA network and run this container?

Thanks!

sdelrio commented 5 years ago

If you do, you will have to do it apart from this docker probably but can reutilize some configuration or use this one as a base.

The idea is to get wlan1 as client mode and wlan0 as AP mode (host_ap), then create a bridge (br0) where you will join both of them. That way the traffic you get from wlan1 will be sent to wlan0.

With this you have one problem (not a big one but one you have to see). All devices connected through wlan0 will be seen from wlan1 as the same MAC addresses, and some DHCP servers won't allow you to have more than 1 IP address/MAC, so I would recommend to use fixed IP address on devices connected to wlan 0.

Another way could be not using bridge mode and use routing or NAT (use wlan0 as WAN and wlan1 as LAN) configuring different network. Is like this doing a router but with wifi instead a eth port.