Port forwarding in D-LINK DIR-524 router

3

1

I have Tomcat installed and I want to access it via internet. I can access it locally via localhost:8080/appname, but not from internet via http://externalip:8080/appname.

I have configured my D-LINK DIR-524 router to pass-through port 8080 as shown below. I have also turned off Windows Firewall as well as my antivirus, but still the same problem.

Any ideas?

image

rocking

Posted 2014-01-25T20:24:56.460

Reputation: 97

1your configuration looks fine, make sure windows 7 firewall is off, or you enable your software on win7 firewall to allow access to those ports. you can google this. – Sickest – 2014-01-25T20:34:39.840

@Sickest Thanks for replying.I will check and let you know – rocking – 2014-01-25T20:37:16.470

@Sickest I have turned windows firwall off but still its not working.Can you please tell me the reason? – rocking – 2014-01-26T11:23:03.853

Try doing a test if those ports are actually open http://www.yougetsignal.com/tools/open-ports/

– Sickest – 2014-01-28T08:43:35.940

@Sickest Yes I have tried this but it showing port is closed – rocking – 2014-02-02T07:15:43.783

Can verify that the service is running on the specified port on the IP address assigned to your ethernet interface? It may be that TomCat is not listening for traffic on the ethernet interface instead just the localhost interface. – ianc1215 – 2014-02-02T08:04:36.253

@Solignis Sorry I did not understand you – rocking – 2014-02-02T08:08:12.637

1Many routers prevent loopback connections as a security feature. I suggest trying this from outside of your network to see if you are getting the same results. And why have you tagged your post as "wireless-networking"? – harrymc – 2014-02-02T10:33:47.483

@harrymc Can you please tell me how to do from outside the network? – rocking – 2014-02-02T13:46:54.040

2Just access it from anywhere else than from your place : work or a friend's. – harrymc – 2014-02-02T15:47:42.437

@rocking Sorry it was late and I was not translating well. Refer to the answer by Vandadis. That is pretty much what I was saying. – ianc1215 – 2014-02-02T19:29:56.050

Some ISPs tend to block traffic on certain ports, 8080 being among them. Change your app's port to something else, make sure port forwarding (you're currently forwarding a range of 1000 ports, that's a bit too much if you ask me) is configured appropriately and try again. As usual, disable your firewall for testing purposes. – JC2k8 – 2014-02-03T07:14:00.083

@rocking Do you have any component before the D-Link router? A modem, another router, a hub? Anything at all? – MariusMatutiae – 2014-02-03T21:59:52.517

@harrymc sorry for late reply,I have tried to access from other computers,its not working.If you want then I can give you my external ip – rocking – 2014-02-05T16:06:24.023

@JC2k8 Thanks for the reply.I will try your way and let you know – rocking – 2014-02-05T16:07:26.060

@MariusMatutiae I think there is a switch before my router.But this switch is provided by the service provider.Many users are connected with the same switch and I think all have different external IP.A ISP should give different IP's to all users – rocking – 2014-02-05T16:09:02.220

@Solignis I tried with Vandadis but its not working – rocking – 2014-02-05T16:09:36.630

OK for your IP - I will check what happens with port 8080. Please write the IP in a slightly encoded manner. – harrymc – 2014-02-05T16:14:19.137

@harrymc sorry I do not know how to write in encoded manner.Can you please tell me how to do? – rocking – 2014-02-06T16:02:25.450

Just don't write too clear like: 123 dot 456 dot 789 dot 012. – harrymc – 2014-02-06T16:29:48.530

@harrymc My boutny will expire in 1 hour,can I get answer from you? – rocking – 2014-02-09T06:06:56.337

Done, as requested. – harrymc – 2014-02-09T07:23:44.577

What is the router's WAN IP? Look in the router configuration itself. If it doesn't match your public IP, and I suspect it won't, then it definitely won't work. – David Schwartz – 2014-02-12T05:45:15.617

Answers

1

Some routers prevent loopback connections as a security feature. Most consumer-grade routers don't have any prohibition against it, it just doesn't work.

The reason it doesn't work is that the router implements request-answer algorithms, so is not programmed to handle the case where the answer is actually another request. In other words, the router implements the algorithm of request-answer rather than request-request-answer-answer.

I suggest trying this from outside of your network to see if you are getting the same results.

harrymc

Posted 2014-01-25T20:24:56.460

Reputation: 306 093

Thanks for the answer,I tried outside the netowork.For example http://www.yougetsignal.com/tools/open-ports/ this shows port 80 is closed.I have changed the tomcat port from 8080 to 80 and even tried vanadis also. My router is DIR -524 not DI-524

– rocking – 2014-02-09T08:17:59.650

This might be either your ISP or the router. The only way to know is to try another router. – harrymc – 2014-02-09T08:54:35.223

Thanks again for replying.Is there any way to know whether requesting is coming to my router.For example if from your location if you are trying to conenect to my router then can I know that my router has accepted your request – rocking – 2014-02-09T09:34:50.743

The only way is by turning on the logfile in the router (if it has one) or putting a hardware sniffer between the router and the Internet (better to spend the money on a new router). Your router model is not listed as supported by more evolved firmware such as DD-WRT. I normally use ShieldsUP! to test ports as it returns more info.

– harrymc – 2014-02-09T13:15:19.573

Thanks for all the information.My bounty is expired so I can not reward you with my boutny but I can upvote your answer.And so I am upvoting some of your answers – rocking – 2014-02-09T13:22:59.683

You bounty is not expired during the grace period. – harrymc – 2014-02-09T15:30:44.393

I am really sorry because my bounty is not given to you.I did not knew there is a grace period also.Sorry again I could not reward you.But no worry,I will upvote some of your answer as i did before – rocking – 2014-02-11T03:51:54.833

0

Open tomcat/conf/server.xml and search for your Connector. Should be something similar like

  <Connector 
    port="8080" 
    protocol="HTTP/1.1" 
    address="127.0.0.1"
    connectionTimeout="20000" 
  />

Try changing the address to your external ip and then restart the Tomcat-Service.

Vanadis

Posted 2014-01-25T20:24:56.460

Reputation: 590

Thanks for the answer.In my server.xml connector looks like <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> and after I saw your answer I did like <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" address="externalip" redirectPort="8443" /> Now I can not start tomcat even from local host also – rocking – 2014-02-02T14:06:08.870

If you leave the address stanza out, Tomcat will bind to all available addresses (this is what you want). After removing the address= and restarting Tomcat, run netstat -an | findstr 8080 and you should see a line like this 0.0.0.0:8080. If you don't, that's probably the reason you cannot access the page. – NickW – 2014-02-05T14:22:04.910