So there was a deal on where you could get a simcard with unlimited data for $25 NZD a month with no restrictions on hotspotting. This is considerably cheaper than any broadband plan. So I bought a simcard and made a setup where I'm using an old 2016 iPhone SE which is plugged into an HP T610 thin client running Debian. I have the built in ethernet interface set up as the network gateway for my LAN, and the iphone is the connection to the WAN.
The problem is, that whenever I try to install pihole, no matter which interface I select, it always just seems to bind to the IP address provided by my iphone. This isn't a static address though so I really want it to bind to the IP address of the ethernet interface which is static. I'm not really sure how to fix this. I've spent hours and hours trying to sort it, I thought I could maybe create a sort of dummy interface for the pihole to bind to, but it still seems to bind to the iphone IP address, maybe I'm creating the dummy or virtual interface wrong? I have noticed that even if I selected the VLAN interface just now, the installer script seems to attach itself to the main ethernet interface and use the same wrong IP address.
Expected Behaviour:
Operating System: Debian 12 LXDE
Hardware: HP T610 Thin Client, 4 GB RAM
iPhone SE 2016 via USB for WAN connection.
Ethernet controller: Broadcom BCM57780
I would expect to be able to install Pi-hole and select the Ethernet controller during the installation as the interface the pi-hole would bind to, and it would take up that IP address.
Actual Behaviour:
The Pi-hole is taking up the IP address provided to the machine from the USB hotspot. This isn't a static IP and I would rather use an IP address on the other side of the server, on the Ethernet card. I've tried making some kind of dummy or virtual interface for the pihole to use, but it didn't seem to work either.
I'm using network manager to set up the routing between the iPhone and the LAN. The Ethernet port is acting as the server and is running DHCP to offer IP addresses to downstream machines, although I do have it plugged into another router currently as it's got more ports. I can plug it into a switch if required though.
What do yo mean exactly with: "bind to the iphone IP address"?
FYI, OOTB the pihole-FTL daemon binds to all IP addresses (IPv4 0.0.0.0 & IPv6 ::)
$ sudo ss -nltup sport = 53
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
udp UNCONN 0 0 0.0.0.0:53 0.0.0.0:* users:(("pihole-FTL",pid=7965,fd=4))
udp UNCONN 0 0 *:53 *:* users:(("pihole-FTL",pid=7965,fd=6))
tcp LISTEN 0 32 0.0.0.0:53 0.0.0.0:* users:(("pihole-FTL",pid=7965,fd=5))
tcp LISTEN 0 32 [::]:53 [::]:* users:(("pihole-FTL",pid=7965,fd=7))
And replies to DNS queries or not depending on whats configured for below:
$ pihole admin interface -h
Usage: pihole -a -i [interface]
Example: 'pihole -a -i local'
Specify dnsmasq's network interface listening behavior
Interfaces:
local Only respond to queries from devices that
are at most one hop away (local devices)
single Respond only on interface eth0
bind Bind only on interface eth0
all Listen on all interfaces, permit all origins
The IP address which the pihole is attaching to is the dhcp address given to the machine via the iphone. Its not possible to as far as I know to get the iphone to give a static address to its clients. The pihole is attaching to the wrong network, I would like to have it on the network which is managed by the machine, not the one managed by the iphone.
Am not sure I understand "attaching" correctly but as mentioned before, the pihole-FTL daemon is listening on all IP's OOTB.
Which means network interfaces with IP's can come and go and the pihole-FTL daemon will listen on all of them and will answer depending on that DNSMASQ_LISTENING= setting.
You can test on a Windows, MacOS or Linux client in a CMD/terminal window with below command:
nslookup <DOMAIN_TO_LOOKUP> <PIHOLE_IP>
At the same time you can tail/follow the logs live on the Pi-hole host to see if the lookup registers with below one:
pihole tail
About a dynamic (via DHCP) or static IP (manually configured on the host itself), you can always change a dynamic IP into a static one with NetworkManager.
Is there a particular aspect of Pi-hole thats not working and can you elaborate a bit more about that?
Do you have examples, error codes, code output, logs etc?