2

I have just received static IP address from my ISP and I am trying to setup small experimental server on my home laptop which has Ubuntu installed.

I have setup Ubuntu to use internal static IP address 192.168.1.11.

Ubuntu static ip config

I have forwarded the port number from my router to redirect all requests on port 80 to 192.168.1.11.

Below is my router (D-Link DSL-2750U) configuration:

Router configuration

I have started the small java webserver on port K on my Ubuntu box. But I am not able to access webserver from external network using my static IP which is provided by my ISP as 117.218.XXX.XXX and not 192.168.1.11. Am I missing anything?


UPDATE: As per suggestion from Giacomo1968 I have updated the remote ip address of router to public IP address of 117.218.XXX.XXX.

After making above configuration I could actually visit my server from browser. But browser was opening router configuration page instead of redirecting the request to Ubuntu box. So now I changed the default port of User Access Control for D link router.

Now the request is getting timed out. Below is the output of curl

curl http://117.218.XXX.XXX
curl: (7) couldn't connect to host

So I tried disabling the firewall on Ubuntu box using "sudo ufw disable" But issue persist.

I am not sure configuration changes required on Dlink , Below is the config page of Dlink firewall

enter image description here

Can someone please help me with it.

2 Answers 2

1

According to the screenshots you are showing, you have port forwarding oddly set on your WAN connection as follows:

  • External Port Start/End: 80/80
  • Protocol: TCP
  • Internal Port Start/End: 80/80
  • Server IP Address: 192.168.1.11
  • Schedule Rule: Always
  • Remote IP: 192.168.1.11

The way you have that setup basically tells the router to just route all traffic from 192.168.1.11 on port 80 to 192.168.1.11 on port 80 which makes no sense. The “Remote IP:” should be set to your external IP address of 117.218.XXX.XXX like this:

  • Remote IP: 117.218.XXX.XXX

With that in place that tells the router to route all traffic from 117.218.XXX.XXX on port 80 to 192.168.1.11 on port 80.

That said, if the router itself uses port 80 for the D-Link management page, then you need to see if you can change the port that management page uses. Otherwise all you are doing with that ruleset is exposing your D-Link management page to anyone/anything that can reach that 117.218.XXX.XXX. As to how to do that? Each router has different ways to handle that and some routers just don’t provide end users with that option since ISP’s generally don’t want end-users to easily run web servers off of their ISP-provided Internet connection.

If you cannot change the D-Link management page port to be something other than port 80 the next best thing is to just change your web server’s port to be something else, like 8000 or 8080. Of course you now need to adjust your port forwarding rules to match the new port, but it might be the best/simplest solution to this issue.

1
  • I was able to change that port , but now the request is getting timed out, I am able to ping the server but could not connect to port 80. Looks like some more configuration required on router to make it forward the request to ubuntu box.
    – Xinus
    Commented Mar 8, 2015 at 6:07
1

192.168.1.11 is your local area network (LAN) private static IP address, not your public (external) IP address.

You can find your public IP address by performing this Google search.

Update, per comment:

There are multiple possible explanations for being unable to connect through the external IP address:

  1. The firewall on the Ubuntu server
  2. The firewall on the D-Link router
  3. The ISP has blocked outbound port 80
  4. The port forwarding configuration has not been set up correctly in the D-Link router

Possible Solutions

1. The firewall on the Ubuntu server

Turn off the built-in Ubuntu firewall, ufw:

sudo ufw disable

If ufw does not seem to be causing the issue, a netfilter rule might be preventing your outbound connections from succeeding. The outbound rules can be found with this command:

iptables -nvL OUTPUT

2. The firewall on the D-Link router

You'll need to consult your router documentation to see how this may work.

3. The ISP has blocked outbound port 80

Contact your Internet service provider to see if this is happening.

4. The port forwarding configuration has not been set up correctly in the D-Link router

A guide matching your router could help you configure port forwarding: http://portforward.com/english/routers/port_forwarding/Dlink/DSL-2750U/Apache.htm

2
  • I am using public static ip to access the webserver and not internal static ip address. This is just the local configuration so that router will be able to forward the any request on port 80 to my ubuntu box.
    – Xinus
    Commented Mar 8, 2015 at 3:40
  • I have updated the remote ip address to public ip, Now I could actually visit my static ip address from browser but its showing me the router configuration page. How do I configure router config page to use different port than port 80?
    – Xinus
    Commented Mar 8, 2015 at 4:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .