gigahacker
New Member
I have two web servers (both port 80). One is on a public IP the other is behind a firewall that is only available via VPN. I need to make both available to the public. The VPN is working as expected. I THINK I have both firewalls disabled for now. I am using IPTABLES and DNAT but it is not working.
[public server]
pubic static IP
VPS
running ALLSTAR with a webserver on port 80
No Firewall installed
Web Server on Port 80
Web DNAT on port 8181
zero tier installed
[private server]
Dynamic IP
Cell MODEM with a CG-NAT system that does NOT allow incoming traffic
running XLX server with a webserver on port 80
zero tier installed
No Firewall installed
Web Server on Port 80 - routed to port 8181 on Public Server
I want to from the internet to use both websites
The Public server will use the default port 80
The Private server is access via the public server on port 8181
This is what I have for code:
[public server]
sudo sysctl net.ipv4.ip_forward=1
sudo iptables -t nat -A PREROUTING -p tcp --dport 8181 -j DNAT --to-destination 172.22.220.231:80
[private server]
sudo sysctl net.ipv4.ip_forward=1
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 172.22.158.218:8181
If I use:
sudo iptables -L -v -n -t nat
I do see traffic on both prerouting rules but it never comes back to my browser.
[public server]
pubic static IP
VPS
running ALLSTAR with a webserver on port 80
No Firewall installed
Web Server on Port 80
Web DNAT on port 8181
zero tier installed
[private server]
Dynamic IP
Cell MODEM with a CG-NAT system that does NOT allow incoming traffic
running XLX server with a webserver on port 80
zero tier installed
No Firewall installed
Web Server on Port 80 - routed to port 8181 on Public Server
I want to from the internet to use both websites
The Public server will use the default port 80
The Private server is access via the public server on port 8181
This is what I have for code:
[public server]
sudo sysctl net.ipv4.ip_forward=1
sudo iptables -t nat -A PREROUTING -p tcp --dport 8181 -j DNAT --to-destination 172.22.220.231:80
[private server]
sudo sysctl net.ipv4.ip_forward=1
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 172.22.158.218:8181
If I use:
sudo iptables -L -v -n -t nat
I do see traffic on both prerouting rules but it never comes back to my browser.