Answer the question
In order to leave comments, you need to log in
How to open access from the Internet and local network to a local web server?
On ubuntu server 12.04 the Internet is connected and the local network is distributed.
eth0 - the Internet is connected to it (dedicated ip address)
eth1 - the local network is connected to it (gateway 10.0.0.12)
How to open access from the Internet and the local network to the local web server?
Answer the question
In order to leave comments, you need to log in
Solution:
nano /etc/nat
# Allow incoming connections to 80
iptables -A FORWARD -i eth0 -p tcp --dport 80 -j ACCEPT
# Forwarding 80
iptables -t nat -A PREROUTING -p tcp -d $EXT --dport 80 -j DNAT --to-destination $IPlocal
iptables -t nat -A POSTROUTING -p tcp --dst $IPlocal --dport 80 -j SNAT --to-source $EXT
$EXT - external
$IPlocal - internal web IP server
nano /etc/network/interfaces
add:
post-up /etc/nat
Thank you all
Forward the required ports.
www.opennet.ru/base/net/nat_redirect.txt.html
Tell me how to get access from the local network to the web server through an external IP?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question