I’m running a Pihole on a raspberry pi 4 with raspbian buster. I’ve got an additional usb ethernet adapter connected and want to use it to separate my small home network from the shared internet connection I’m using with my neighbors.
I know i could just use a bog standard router with a wan port, but the pihole is running anyways and should have plenty capacity for that.
From my reading up to now this is how I tried configuring it:
- sysctl net.ipv4.ip_forward is set to 1
- pihole dhcp is set to give out IPs on eth0 from 192.168.1.2 to 192.168.1.255 and gateway set to 192.168.1.1
- eth0 is set to static ip 192.168.1.1, gateway 192.168.1.1 and dns on 127.0.0.1
- eth1 is set to dhcp and is “configured” by the isp router
- iptables config:
sudo iptables -A FORWARD -i eth1 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT
sudo iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
with only eth1 (link to isp router) connected the rasperry pi has no problems connecting to the internet. As soon as eth0 is connected nothing works anymore. No dns requests get resolved on it or any devices on my network. Yet I can see all dns requests in piholes query log. When I try to connect to a website by ip theres also no connection.
What am I doing wrong?