Answer the question
In order to leave comments, you need to log in
How to make access to external ip from local network?
I have a DIR-615 router at home connected via cable to the Internet, with a static ip. A desktop computer with ubuntu 16.04 is connected to the Internet via wi-fi through this router. A web server with a website (test.ru) is deployed on the computer. When I access the site from the external Internet, everything works - the site opens. When I access the site from the same local network (via the same wifi connection) the site doesn't load.
I found a solution to the problem on the Internet - nat loopback. My router does not have such a function, so they suggest either flashing the router to an alternative firmware, or setting up loopback via iptables. I connected to via telnet to the router and entered the commands:
iptables -t nat -A PREROUTING -d <мой внешний ip> -m tcp -p tcp --dport 80 -j DNAT --to-destination 192.168.0.26:80
iptables -t nat -A POSTROUTING -d 192.168.0.26 -p tcp --dport 80 -j SNAT --to-source <мой внешний ip>
iptables -t nat -L -n -v
: Answer the question
In order to leave comments, you need to log in
It's easier to steer through splitdns. Those. make it so that for local machines on test.ru DNS gives a local address. To do this, you need to either train Dir 615 for this (if it is specified as a DNS server) or raise a DNS server on a computer with a web server, register the test.ru zone on it with local addresses and specify it as the first one when distributing via DHCP (if it is used) or in the network connection settings of computers. The computer hosting the web server must also have a local DNS address. If there are not many computers, you can write the local test.ru to them in hosts.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question