Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a Router and four computer connected as the local network.

IPs:

Router(192.168.8.1)(internet ip:125.119.203.127)
      server1(192.168.8.3)
      my computer(192.168.8.8)
      ......

The server1 runs on the RedHat Linux which is set to use the port-redirect, to redirect port 80 to 8081. While the tomcat in this server use the port 8081.

[root@server1 bin]# iptables -t nat -vnL
Chain PREROUTING (policy ACCEPT 3169 packets, 274K bytes)
 pkts bytes target     prot opt in     out     source               destination
    4   208 REDIRECT   tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:222 redir ports 22
  221 14971 REDIRECT   tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:80 redir ports 8081

Chain POSTROUTING (policy ACCEPT 2253 packets, 141K bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain OUTPUT (policy ACCEPT 2252 packets, 140K bytes)
 pkts bytes target     prot opt in     out     source               destination

Now in my computer, I can access the site in the local network use browser:

http://192.168.8.3
http://192.168.8.3:8081

The Router is configurated to redirect the port 80 to port 80 on 192.168.8.3

But I can not access the site using the internet address:

http://125.119.203.127

Normally, this request should be dispatched to server1 192.168.8.3:80, then server1 will redirect to port 8081.

Then I change the configuration of the Router, to redirect the port 80 to port 80 on my computer.

Then I can access: http://125.119.203.127

So what is the problem?

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

From outside the network use namp to check whether port 8081 is available externally

$ nmap -PN external_ip

This command will show all listening services externally. Since you can access the site using internally http://<internal_ip>:8081, the issue is with the router.

As you have mentioned that "The Router is configurated to redirect the port 80 to port 80 on ", what configuration is done to forward port 8081 from the router to the internal server?

I think you need to forward port 8081 from the router to port 80 to the internal server.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.