pdc
Regular Contributor
I am in the process of moving from a Diversion setup on the router to a Raspberry-pi based pi-hole setup. (If you're wondering why, my goal is to allow family members to access/view/update whitelists using a general web UI).
In conjunction with this I'd like to run a pixelserv-tls on the Raspberry Pi as well. I understand it is sort of abandonedware at this point, but I'd like to get this working before I decide whether to continue using it or not. I have pixelserv-tls running on the pi okay (https://github.com/jumpsmm7/pixelserv-tls_2.3.1-1_armhf.deb if you are curious).
Now for the challenges. The Raspberry pi already has a web server for a variety of services, so I can't just use port 80/443. Instead I'd like to use an approach with a separate IP address, similar to Diversion.
First I created a new IP address for the raspberry pi using
So now the pi has two IP addresses on eth0, but this has caused a number of issues, since it seems the web server (nginx) is claiming ports on both interfaces, as are other services (e.g. nmbd/smbd).
Now, I can run the pixelserv to listen on the second IP address using different ports (e.g. 33080/33443). Using this approach I can get e.g. servstats output, but only if I use the different ports, ports 80/443 are still being claimed by the web server.
Based on some research I've done, I thought I could use iptables to redirect traffic from xx.xx.xx.4 port 80/443 to the different ports (bypassing the web server). I ran these commands on the router :
However, this does not seem to be working, if I browse to xx.xx.xx.4 port 80 or 443, I still get the web server and not the pixelserv. Likewise if I run the iptables command on the raspberry pi on eth0.
I am starting to wonder if iptables is really the right answer for an address within the router intra-net.
What I need is some way that the pixelserv can handle its own IP address (and ports 80, 443) without interference from the "main" raspi IP address.
Any advice or suggestions?
Thanks!
In conjunction with this I'd like to run a pixelserv-tls on the Raspberry Pi as well. I understand it is sort of abandonedware at this point, but I'd like to get this working before I decide whether to continue using it or not. I have pixelserv-tls running on the pi okay (https://github.com/jumpsmm7/pixelserv-tls_2.3.1-1_armhf.deb if you are curious).
Now for the challenges. The Raspberry pi already has a web server for a variety of services, so I can't just use port 80/443. Instead I'd like to use an approach with a separate IP address, similar to Diversion.
First I created a new IP address for the raspberry pi using
ifconfig eth0 xx.xx.xx.4/24 up
where xx.xx.xx is my local network (the pi is xx.xx.xx.3). I ran ifconfig on the pi, not the router, if that matters.So now the pi has two IP addresses on eth0, but this has caused a number of issues, since it seems the web server (nginx) is claiming ports on both interfaces, as are other services (e.g. nmbd/smbd).
Now, I can run the pixelserv to listen on the second IP address using different ports (e.g. 33080/33443). Using this approach I can get e.g. servstats output, but only if I use the different ports, ports 80/443 are still being claimed by the web server.
Based on some research I've done, I thought I could use iptables to redirect traffic from xx.xx.xx.4 port 80/443 to the different ports (bypassing the web server). I ran these commands on the router :
Code:
iptables -t nat -A PREROUTING -i br0 -p tcp -d xx.xx.xx.4 --dport 80 -j REDIRECT --to-port 33080
iptables -t nat -A PREROUTING -i br0 -p tcp -d xx.xx.xx.4 --dport 443 -j REDIRECT --to-port 33443
However, this does not seem to be working, if I browse to xx.xx.xx.4 port 80 or 443, I still get the web server and not the pixelserv. Likewise if I run the iptables command on the raspberry pi on eth0.
I am starting to wonder if iptables is really the right answer for an address within the router intra-net.
What I need is some way that the pixelserv can handle its own IP address (and ports 80, 443) without interference from the "main" raspi IP address.
Any advice or suggestions?
Thanks!