ag123 Posted October 3 Posted October 3 The original discussion thread is this Reposting this below just in case it may be useful ---- how i set it up https://gist.github.com/ag88/de02933ba65500376d1ff48e504b1bf3 --- Imho for WiFi purposes nmcli (network manager cli) is not very different from hostapd, just that hostapd possibly has more configuration options. To setup an access point, there are quite a few pieces of network configuration that needs to be setup: The WiFi AP itself (e.g. using network manager or hostapd) if you are able to connect and verify that in the log, that is probably solved. e.g. journalctl -u NetworkManager or for hostapd journalctl -u hostapd hostapd tends to have log entries for every host that connects, I'm not sure about NetworkManager. DHCP (issuing IP address to connected hosts) this is particularly true for IPv4 hosts on dynamic IP. DHCP would likely also need to distribute the DNS server, so configure that if it isn't done. e.g. https://ubuntu.com/server/docs/how-to-install-and-configure-isc-dhcp-server For IPv6 you may need to setup radvd (router advertisement daemon) https://en.wikipedia.org/wiki/Radvd so that the connected hosts can setup their own IPv6 address quite often IPV6 requires its own /64 address range / network (* note below dnsmasq does this as well) e.g. apt install radvd https://wiki.archlinux.org/title/IPv6#For_gateways Configure the WiFi AP as a router or bridge. Router: note that if you are using hostapd and not using a network bridge and there are no DHCP servers, you would need to configure the wlan0 interface with an ip address and network using say ip commands e.g. (ref: https://wiki.debian.org/NetworkConfiguration) /etc/network/interfaces source /etc/network/interfaces.d/* # Network is managed by Network manager auto lo iface lo inet loopback # added the following auto wlan0 iface wlan0 inet static address 192.168.1.1 netmask 255.255.255.0 To run it as a router, you would need to do DHCP (and RADV) for your WiFi hosts as above For such reasons, I tend to use isc-dhcp-daemon so that I can configure the dhcpd precisely as I needed. But I'd guess it may be possible with Network manager. (* note below dnsmasq does this as well) e.g. https://ubuntu.com/server/docs/how-to-install-and-configure-isc-dhcp-server apt install isc-dhcp-server Configure routing and/or IP NAT (e.g. IP masquerading). I've tried IP NAT and that sometimes it is easier as up stream normally only a single IP address is needed. Routing would need a subnet to be setup, that is normally ok but that you would need to configure your main gateway router as well for the overall network setup so that it knows where/how to forward packets. many consumer getway/routers simply used NAT, that is ok as well. But that your main gateway/router may need a static route to say that for that subnet, send it to your OPi Zero 3 Wifi AP. Bridging: To run it as a bridge you would need to setup the zero 3 WiFi AP as a bridge. This can be done using nmcli (network manager). In fact, this is my own personal preference for a small network. e.g. https://www.cyberciti.biz/faq/how-to-add-network-bridge-with-nmcli-networkmanager-on-linux/ https://gist.github.com/ag88/de02933ba65500376d1ff48e504b1bf3 DHCP (and RADV) can be done from the main gateway/router so long as the bridged packets reaches the WiFi hosts. Similarly, the DNS server likely needs to be distributed this way as well I've not done it completely from within nmcli for this setup as I used hostapd for the WiFi AP. But that I used nmcli (network manager) for the bridge. But that those notes above remains similar whether you used network manager or hostapd. take note that with hostapd for WiFi AP, you probably need to un-manage the Wifi interface in Network Manager configs so that it doesn't conflict with hostapd. https://gist.github.com/ag88/de02933ba65500376d1ff48e504b1bf3 oh and when messing with network interfaces use a debug usb-uart serial dongle or you may get 'locked out' from your zero 3 Apparently, dnsmasq does all three: DNS, DHCP, RADV https://thekelleys.org.uk/dnsmasq/doc.html but that there may be some configurations that are needed for it to work correctly https://docs.fedoraproject.org/en-US/fedora-server/administration/dnsmasq/ https://wiki.archlinux.org/title/Dnsmasq 0 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.