I
I
instantia2015-05-05 06:08:53
linux
instantia, 2015-05-05 06:08:53

Ports are not forwarded from the outside through the router. Why are they filtered?

The router (ASUS RT-N10PV2) goes through a white ip from the provider. The web interface hung up on 8081 port.
There is a linux server on the local network. nginx port 80, apache port 8080, dns port 53.
In the settings of the routers, I turned on the forwarding of these ports.

HTTP Server	        80	     192.168.1.11	   80	       BOTH

Where 192.168.1.11 is the local ip of the server.
But from the outside it still gives out that the port is closed. and 8081 is open. Prior to this, the router's web interface was on port 80 and this port was also open.
Starting Nmap 6.47 ( http://nmap.org ) at 2015-05-05 02:46 Coordinated Universal Time
Nmap scan report for 161.*.189.89.sta.211.ru (89.189.*.161)
Host is up (0.11s latency).
Not shown: 94 closed ports
PORT STATE SERVICE
22/tcp filtered ssh
23/tcp open telnet
53/tcp filtered domain
80/tcp filtered http
8080/tcp filtered http-proxy
8081/tcp open blackice-icecap
 
Nmap done: 1 IP address (1 host up) scanned in 3.29 seconds

- nmap output.
Why are these ports being filtered? Firewall is disabled. iptables doesn't interfere. the server issues that the given ports are listened.
Is this the provider's trick? But why then the 80th port was open when the router interface hung on it.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
I
instantia, 2015-05-06
@instantia

Problem solved. . Blame vagrant. More precisely, its setting of gateways. Everything is fine with the vagrant config.
Packets go in one direction through the second adapter - directly, and in the other they go through NAT and their address changes. That is why they are rejected by the router.

Apparently, both adapters on the server look at the same network. At the same time, packets going through one are masqueraded - but not through the other. At the same time, there can be only one default route (if you configure the server without frills). If a packet gets to the server through one adapter - and returns through another - then it will return with the wrong IP.
As a result, only one of the two adapters can fully work.

I just simply changed the gateway.
sudo route del default gw 10.0.2.2 dev eth0 
sudo route add default gw 192.168.1.1 dev eth1

Created a separate gateway.sh script .
And I call it immediately after turning on the machine.
config.vm.provision :shell, :path => "gateway.sh", run: "always"

C
Cyril, 2015-05-05
@service_man

There was at one time a similar glitch with D-lnik, I don’t remember which model. It turned out that the bug is in the router itself. The web interface worked fine on 80, but forwarding did not (only on port 80.) I decided to update the firmware of the router.

S
solarex, 2015-05-05
@solalex

N10P is still g ... on native firmware
Install asuswrt-merlin https://github.com/AndreyPopovNew/asuswrt-merlin-r...

L
lexalex, 2015-05-05
@lexalex

Show router and server firewall rules

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question