1

I am running many servers off of my computer and I need to port forward to do that. But recently my IPv4 Address keeps changing when I shut my computer off and turn it back on. I have no clue why this is happening.

4
  • Is it a local ip? Does it look like 192.168.x.x, or 10.x.x.x, or 172.x.x.x?
    – djeikyb
    Jun 11, 2013 at 0:05
  • Is there anything between your computer and the internet, like a modem, or router, or any kind of box you plug your computer into?
    – djeikyb
    Jun 11, 2013 at 0:06
  • Also, by "servers" do you mean physical computers, or software like httpd or ssh running on ports 80 and 22?
    – djeikyb
    Jun 11, 2013 at 0:35
  • Do you also turn off the router?
    – Anders
    Jun 11, 2013 at 16:03

3 Answers 3

4

I see two options.

Your computer is connected to a local network

This is true if your ip address starts with one of:

  • 10.x.x.x
  • 192.168.x.x
  • 172.16.x.x
  • 172.17.x.x
    ...
  • 172.31.x.x

Your computer is connected directly to the internet

This is probably bad and you should change it. It's common practice to put your server behind a dedicated firewall and on a local network. This makes it more convenient to manage and secure your computers.

Q: How do you get an ip address?

A: You ask for one.

There is a computer connected to your network that runs ip-address-assigning software, aka a dhcp server. Your computer asks it for an ip address. The dhcp server says "here's an ip address, but you can only have it for so many minutes." Every time your minutes are up, your computer renegotiates the agreement. We call this agreement a dynamic lease.

One way to almost always get the same ip address is to always renew the lease as soon as it expires. But if you turn your computer off, the dhcp server will forget you ever had a lease. (some dhcp servers forget sooner than others). Also, this is kinda like trying to ride the same ride at Disneyland over and over without waiting. If you get to, it's not cause you're special, there's just no one else at the park.

Another way is to configure the dhcp server to always give your computer the same ip address (called a static lease). If you're on a local network, and it's your local network, you can do it for free. You'll just need to know how. If you're on a public network (ie, the internet), you'll want to talk to whoever you're paying for the connection. They'll probably want more money.

How I've had the same public ip address for ages without paying for it

I have a local network. I have a router that handles the local network. It's connected to a dsl modem, which is the box that actually makes the connection to the internet. The dsl modem is what gets the public ip address. That modem is almost never offline. When it is, it's for a reboot, which happens pretty fast. So far, fast enough to always lease the same ip address. But, like I've already said, it's a gamble. There's nothing to guarantee I get the same ip address, and if for some reason I get leased a different one, no one at my ISP is going to care (until I pay for the privilege of a never-changing ip address).

0

You probably don't have a static IP. Ask your ISP if you need one, many ISPs do not give you static IP unless you pay for it specifically.

1
  • True, but they don't change IPs very often. I'd bet he's getting different local dhcp from his router each time he logs on.
    – Marc
    Jun 11, 2013 at 1:40
0

It sounds like you have a dynamic IP address. Talk to your ISP to get a static IP. Be warned: they cost a lot more! (usually)

You must log in to answer this question.

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