Hullo, I apologize if this is an inappropriate place to ask this question. I have an issue that has been plaguing me for days and I have no idea how to fix it, so I figure someone here would have an idea on what to do.
For the past few days I’ve been attempting to get a basic configuration set up on my recently-acquired Raspberry Pi 5 that will allow me to host a wireless access point to devices in my household, with Pi-hole integrated within. Currently I have an Xfinity router that every device is connected to (I live in a shared household), with a “reserved IP” designated for the Pi (10.0.0.2
) which is also connected to it. I assume this is practically the same thing as a static IP. Since other devices use the main router I can’t turn off its DHCP for Pi-hole if that’s required.
I am currently trying to use hostapd with Pi-hole being used in place of dnsmasq. As usual, I have Ethernet connected to the router via end0
, and I have the wireless radio at wlan0
.
Every attempt I’ve made to get this working thus far has invariably resulted in failure. The closest I’ve gotten is a network that is discoverable and connectable, but that strangely boots out any device that attempts to connect to it. I don’t see this getting logged, so I don’t know what it is, and I can only assume it has something to do with a DHCP misconfiguration (or the lack thereof). I’ve only been testing this on my phone as my main PC uses Ethernet. On said phone (Android, if it matters), I tap on the network, enter the password (which I am aware is currently world-readable at the moment; it’s something I’ll fix after I get this setup working), and attempt to establish a connection, but instantly the connection is severed and I start auto-connecting to my router’s Wi-Fi instead. Again, this is not logged anywhere, including logcat, so I don’t definitively know what the problem is.
Let me outline precisely what I want the outcome of this to be: my Pi, acting as its own Wi-Fi network that devices can connect to, that blocks ads &c. with Pi-hole, and that is able to connect to the Internet through my router. I’m only slightly knowledgeable on networking, so much of this has been stumbling around in the dark. I’m typically averse to posting on forums, but I’m getting restless after close to four days straight of attempting to troubleshoot this.
My configuration for the machine is at this location. r5e.containers.pihole
is just a wrapper around a Docker container. If it’s at all relevant, I do intend to put other services (Docker containers, probably a pastebin at least) on the Pi, which I’d like for devices connected to both it and the regular upstream router to be able to access.
virtualisation.docker.enable = true;
r5e.containers = {
pihole = {
enable = true;
dhcp.enable = true;
listenPortHTTP = 8080;
listenPortHTTPS = 8443;
openFirewall = true;
};
};
services = {
hostapd = {
enable = true;
radios.wlan0 = {
band = "2g";
channel = 7;
countryCode = "US";
networks.wlan0 = {
authentication = {
mode = "wpa2-sha256";
wpaPassword = "techcat8";
};
logLevel = 1;
ssid = "near";
};
settings = {
ht_capab = lib.mkForce "[HT40][SHORT-GI-20]";
};
};
};
};
networking = {
# bridges.br0 = {
# interfaces = [ "end0" "wlan0" ];
# };
firewall = {
allowedTCPPorts = [ 22 ];
extraCommands = ''
iptables -t nat -A POSTROUTING -o end0 -j MASQUERADE
'';
};
hostName = "near";
interfaces = {
# br0 = {
# ipv4.addresses = [
# {
# address = "10.0.0.2";
# prefixLength = 24;
# }
# ];
# };
end0.useDHCP = true;
wlan0.useDHCP = true;
};
networkmanager.unmanaged = [ "interface-name:wlan*" ];
useDHCP = false;
wireless.enable = true;
};