Solved My static IP is assigned to my router by ISP.

October 23, 2016 at 04:06:16
Specs: Windows 7
I need a static Ip so that i can access my server from the internet. However the ISP's in this country can only assign the static IP to my router. How can I set it up so that the router fowards requests from the internet to my server directly. e.g when i turn server on the IP should ping. Whe i turn server off IP should not ping.

See More: My static IP is assigned to my router by ISP.

Report •

#1
October 23, 2016 at 08:07:14
✔ Best Answer
I guess my first question would have to be, what country are you in?

This info may help a lot as one of our members may live there and have direct knowledge of the local ISP's.

I think you may be a little confused how this will work. First of all, the IP should be assigned to your router, not the server. That is, it should be if you wish your server to also be a member of your LAN. If you don't care, then you could simply connect the server directly to your modem and assign the static IP to the server. However, if you have any other computers at home you wish to have accessing the internet, you would then need a second internet connection for them.

Your router provides your with a couple important services. Those are NAT and DHCP. The two allow you to have multiple computers connected to the internet while using only one external (internet) IP address. NAT (network address translation) handles that aspect of your LAN. DHCP simply provides your LAN clients with addresses so they can talk to each other and the internet, through the router's NAT.

For external connections to reach your server, you need to employ a "port forward" on the router. Lets say for example you have a web server. On your router you would forward port 80 (http) to the internal IP address of your web server. Once you have the forward created properly, any traffic for port 80 hitting your router's external (internet) address would automatically be redirected to your web server.

So you have 3 options as I see it.

1) Server connected to internet directly with no other electronic devices in your home able to access the internet
2) Server connected directly to the internet. A second internet connection for all your other electronic devices (cost twice as much as option 1 and frankly, is a waste of money and resources)
3) A typical home LAN with internet connection going into your router and a port forward created to send traffic for your server, to it. (best way to go)

It's worth noting you don't necessarily have to have a static IP address. I don't and I access several of my PC's at home from work on a regular basis. Luckily my ISP has long leases on their DHCP. Something in the area of 4 to 6 months between IP changes. I have a FreeBSD box that I wrote a script on that checks daily to see if my IP has changed. When it does, it emails me at home and at work and tells me that the IP has changed, and what the new IP is now. So if your ISP has long leases like mine, you could even save money by not going with a static IP.

It matters not how straight the gate,
How charged with punishments the scroll,
I am the master of my fate;
I am the captain of my soul.

***William Henley***

message edited by Curt R


Report •

#2
October 23, 2016 at 08:35:56
Besides Curt's options, and with his explanation of how your ip address actually works - assigned to your router by your isp - much in mind. You could also use a third-party service which will continuously monitor your assigned ip address; and then ensure you can connect to whatever your isp may change it to at any time.

In effect "they" (the third-party) assign you an ip address and if/when your isp assigned one changes, "they" (the third party service) catches the change and ensures that the ip address they (the third-party) assigned you is still connecting to your isp via the latest isp assigned address...

I forget what the system is generally referred and which outfits provide the service; but they exist aplenty...


Report •

#3
October 23, 2016 at 09:46:27
trvlr, what you're describing is literally NAT, but I suspect you're thinking about DDNS. DDNS is where you have rapidly expiring DNS records that get updated whenever the target IP gets updated.

How To Ask Questions The Smart Way


Report •

Related Solutions

#4
October 23, 2016 at 11:23:06
yup - NATS; and familiar with it all (well the basics at least) - as f course "we" all use it with our routers and our single "flexible" isp provided ip address...

I didn't want to get into the technicals here as that might simply complicate the discussions.

And yup again - that's it DDNS; couldn't for the lyfe of me remember what it's called (shortage of tea 'n cake/buns.. this afternoon) There are several outfits around offering it; but as I understand it - it aini't exactly cheap?

message edited by trvlr


Report •

#5
October 23, 2016 at 11:43:51
Well, I use No-IP, which has a free plan. They also offer a $25/year and a $35/year plan. It sounds like an okay deal to me, but I don't know how good the support is for the paid plans.

How To Ask Questions The Smart Way


Report •

#6
October 24, 2016 at 07:05:25
I use my FreeBSD box and a script I wrote to check my external IP and whether or not it's changed.

I checks my external IP address and compares it to yesterday's IP. If they're the same, it logs that info and exits the script. If/when my external IP changes (every 4 to 6 months, we have a long lease with my ISP) the script makes note, records the new IP in a file ("IP.past" - to be checked against the next day) and emails me the new IP at home and at work.

I have the cronjob set to run every morning about 4 am and it's been working beautifully for several years.

I did have to make one change recently. My ISP went down for an hour or two and I didn't have error checking for "no IP". Now I do. If for some reason there's no external IP when the script runs, it logs that info and exits gracefully. As I found out when my ISP went down a while back, it exited ungracefully, left an empty "IP.past" file. This messed up my count of days between changes.

If anybody's interested, I'd be happy to share my script. I'm pretty darn sure it could be easily ported over to OpenBSD or Linux as long as you have the "dig" command available (or can get it).

It matters not how straight the gate,
How charged with punishments the scroll,
I am the master of my fate;
I am the captain of my soul.

***William Henley***


Report •

#7
October 25, 2016 at 07:58:15
Thanks for the answer Curt. I think I didn't explain the situation as accurately as I could have. Ill try bullet points.

- I have a static IP assigned to my router by the ISP
- I have a special type of computer which I need to be accessible from the internet HOWERVER this computer wont work if the static IP I use for it is in use anywhere else i.e the router.

I think option 3 you gave me is the best bet. Does it need to be port 80 or is there any way I can open up all the ports for that computer?


Report •

#8
October 25, 2016 at 09:51:18
You don't need to open up all ports and I HIGHLY recommend you not do so. Open only the port (or ports plural) that are associated with the server.

For instance, I have a FreeBSD box at home that I ssh into. SSH uses port 22. I also use RDP to get into my windows box and have it's port open (port 3389) as well. So I have two port forwards setup and they look something like this:

Forward port 22 to 192.168.1.10
Forward port 3389 to 192.168.1.20

So you need to know what port(s) your server needs and forward those. If you don't know which port your server is using offhand, google is your friend. Just search something like: "<application name> port number"

ex: http port number
or: https port number

It matters not how straight the gate,
How charged with punishments the scroll,
I am the master of my fate;
I am the captain of my soul.

***William Henley***


Report •

Ask Question