Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have been running a LAN configuration with several computers and one server box. This server must be accessible from outside of the LAN which is why I forwarded the needed ports on my router to the correct machine.
Unfortunately I forgot to lock the local IP (for the sake of example, say 192.168.1.5) to the MAC address of my server network card. Despite this I was convinced that the local IP would not change unless the router or the server were restarted.
Nonetheless I had a situation just a couple of hours ago when I was remotely connected to my server and the server or the router seemed to be fed up with the current configuration and allocated a new IP for the server (let's say 192.168.1.7) just out of the blue. Server's previous IP (192.168.1.5) was at this point left unused.
This of course broke my port forwarding configuration and my remote connection was lost.
I have now reserved the IP to the server MAC, but I nonetheless wonder, why would such an event happen? There was certainly no need to reallocate the IP as far as I could see: Neither the router nor the server were restarted and there were no remote connections besides mine at the time. Neither was their any reason not to allocate the server to the same IP as it had used before.
Or am I missing something here?
PS. My router is a NETGEAR WGR614v9 and I was running Ubuntu on the server when this occured.
Probably the lease ran out. To fix this, set your server up with a static IP address, don't use DHCP for a server.
Most routers you can control the range of IP addresses they give out. Set it up for the number of boxes that are using DHCP plus one or two more, so if you have five, set the range to eight. Then set a static IP for your server outside the range of DHCP addresses. This is how I have my network, server always has the same IP address. No moving targets...
But I am still unsure as to why a different IP was allocated: AFAIK there was no reason for the router *not* to assign the same IP as the server machine used before, even if the lease ran out and a new DHCP request was sent.
Just a guess, is it possible the router issued that IP to another machine? The rest is up to the router, and its code. Because of problems like this, running static IP's makes sense for servers.
You might want to have a look to see if there are any code updates for your router. Check out the manufacturers web site.
But I am still unsure as to why a different IP was allocated: AFAIK there was no reason for the router *not* to assign the same IP as the server machine used before, even if the lease ran out and a new DHCP request was sent.
The router will send whatever IP it wants...true that the request will come in for the same IP...and the router is likley to give the same IP out...but it isn't surprising that it didn't. As you stated, there was no reason for the router *not* to assign the same IP, but there is no reason (as far as the router is concerned) *to* assign the same ip.
It happens.
I agree with camorri; you should have a static IP set for servers/printers that are accessed all the time.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.