I need to port forward to the internal port 8080 (TomCat embedded default port number) and my situation is the following:
I do not have a access to my router, my ISP changed it's password, so they offered me a second one that I connected via an Ethernet cable to one of the LAN ports of the first one.
On that second router I reserved a static IP for my machine and port forwarded external port 80 to internal port 8080 (I tested other ports as well).
So I ran nmap on my localhost and got:
[jedson@archlinux]: ~ %> nmap -reason -vvv localhost [0]
Starting Nmap 7.70 ( https://nmap.org ) at 2019-07-10 19:49 -03
Warning: Hostname localhost resolves to 2 IPs. Using 127.0.0.1.
Initiating Ping Scan at 19:49
Scanning localhost (127.0.0.1) [2 ports]
Completed Ping Scan at 19:49, 0.00s elapsed (1 total hosts)
Initiating Parallel DNS resolution of 1 host. at 19:49
Completed Parallel DNS resolution of 1 host. at 19:49, 0.01s elapsed
DNS resolution of 1 IPs took 0.01s. Mode: Async [#: 1, OK: 1, NX: 0, DR: 0, SF: 0, TR: 1, CN: 0]
Initiating Connect Scan at 19:49
Scanning localhost (127.0.0.1) [1000 ports]
Discovered open port 8080/tcp on 127.0.0.1
Discovered open port 5432/tcp on 127.0.0.1
Completed Connect Scan at 19:49, 0.02s elapsed (1000 total ports)
Nmap scan report for localhost (127.0.0.1)
Host is up, received conn-refused (0.00011s latency).
Other addresses for localhost (not scanned): ::1
Scanned at 2019-07-10 19:49:35 -03 for 0s
Not shown: 998 closed ports
Reason: 998 conn-refused
PORT STATE SERVICE REASON
5432/tcp open postgresql syn-ack
8080/tcp open http-proxy syn-ack
Read data files from: /usr/bin/../share/nmap
Nmap done: 1 IP address (1 host up) scanned in 0.06 seconds
The internal port 8080 is open as it should.
But, when I use my IP and check for the open ports I get:
[jedson@archlinux]: ~ %> nmap -reason -vvv X.X.X.X
Starting Nmap 7.70 ( https://nmap.org ) at 2019-07-10 19:56 -03
Initiating Ping Scan at 19:56
Scanning X.X.X.X [2 ports]
Completed Ping Scan at 19:56, 0.01s elapsed (1 total hosts)
Initiating Parallel DNS resolution of 1 host. at 19:56
Completed Parallel DNS resolution of 1 host. at 19:56, 0.04s elapsed
DNS resolution of 1 IPs took 0.04s. Mode: Async [#: 1, OK: 1, NX: 0, DR: 0, SF: 0, TR: 1, CN: 0]
Initiating Connect Scan at 19:56
Scanning X-X-X-X.cgnat.clickinternetfoz.com.br (X.X.X.X) [1000 ports]
Discovered open port 2222/tcp on X.X.X.X
Discovered open port 2000/tcp on X.X.X.X
Completed Connect Scan at 19:56, 0.19s elapsed (1000 total ports)
Nmap scan report for X-X-X-X.cgnat.clickinternetfoz.com.br (X.X.X.X)
Host is up, received conn-refused (0.017s latency).
Scanned at 2019-07-10 19:56:03 -03 for 0s
Not shown: 998 closed ports
Reason: 998 conn-refused
PORT STATE SERVICE REASON
2000/tcp open cisco-sccp syn-ack
2222/tcp open EtherNetIP-1 syn-ack
Read data files from: /usr/bin/../share/nmap
Nmap done: 1 IP address (1 host up) scanned in 0.30 seconds
(Where all X.X.X.X are instances of my IP address)
Only ports 2000 and 2222 appear. Also, ClickInternet Foz is my ISP, so I figure those are their open ports.
But still, I would like to know if there's any hope for me in fixing it, if it's a trivial mistake or if I should try another way.
Routers model:
First: TL-WR840N
Second: TL-WR741N