M
M
maxtrelle2015-01-22 11:23:08
linux
maxtrelle, 2015-01-22 11:23:08

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

3 answer(s)
M
maxtrelle, 2015-01-22
@maxtrelle

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

S
Sergey Petrikov, 2015-01-22
@RicoX

Forward the required ports.
www.opennet.ru/base/net/nat_redirect.txt.html

O
obeliks_mr, 2015-04-29
@obeliks_mr

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 question

Ask a Question

731 491 924 answers to any question