Results 1 to 9 of 9

Thread: IP address keeps changing

  1. #1
    Join Date
    Mar 2014
    Location
    Quebec, Canada
    Beans
    63
    Distro
    Lubuntu 18.10 Cosmic Cuttlefish

    IP address keeps changing

    I have recently bought a new computer but kept my old one for certain tasks. The old computer has ubuntu 14.04 and the new one mint 18.2 (KDE). On the new computer I have written a script to sync three folders with the ones on my new computer. I use Rsync. The script works fine but the old computer keeps changing IP address. I don't know why. I am wondering if the system updates have some thing to do with it. So far since I've written the script the IP has changed twice. I adjust the script to the new IP and it works.

    Why does it change and how to solve the problem

  2. #2
    Join Date
    Feb 2014
    Location
    Canada
    Beans
    47
    Distro
    Ubuntu

    Re: IP address keeps changing

    Are they connected in an internal network with IP addresses like 192.168.X.Y?

    I suppose the old computer gets its IP address via DHCP. If it's WLAN select its source, then IPv4 and set it to "Manual". Below also provide a fixed IP address. Should work similar if connected via Ethernet.
    Ankman

    My blog https://news-commentaries.blogspot.com
    Retro arcade game web page http://www.ankman.de/mame/

  3. #3
    Join Date
    Mar 2014
    Location
    Quebec, Canada
    Beans
    63
    Distro
    Lubuntu 18.10 Cosmic Cuttlefish

    Re: IP address keeps changing

    That is correct, I am connected by an internal network with IP addresses like 192.168.X.Y. It's the last number that changes 101 to 104 to 106. I have a cable connection via my router. (ssh connection)

  4. #4
    Join Date
    Feb 2014
    Location
    Canada
    Beans
    47
    Distro
    Ubuntu

    Re: IP address keeps changing

    Ok. Then set the IP address acquisition to "Manual". That will fix the problem.
    Ankman

    My blog https://news-commentaries.blogspot.com
    Retro arcade game web page http://www.ankman.de/mame/

  5. #5
    Join Date
    Mar 2014
    Location
    Quebec, Canada
    Beans
    63
    Distro
    Lubuntu 18.10 Cosmic Cuttlefish

    Re: IP address keeps changing

    Took me a while to realize where to set the "Manual" setting. Don't play around with network settings very often. I found it in Editing the "Wired connection 1" > IPv4 settings. Changed the automatic DHCP to Manual and entered the current IP address, Netmask and gateway. (all taken from Network info icon on Ubuntu.
    Did a sync command on new computer and it worked. If, in a month, the IP does not change I'll come back to this tread and mark it as solved.

    Thanks for the help AnkMan

  6. #6
    Join Date
    Nov 2007
    Location
    London, England
    Beans
    7,017
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: IP address keeps changing

    With DHCP, the router tracks IP addresses and allocates them to computers that ask for an address. There is a danger that if you use a manual IP address, the router may happen to allocate that same address to a different device on your network so that you have two boxes with the same address. That would cause you hours of grief trying to figure out what's wrong with your network. It would be better to go into the router config and tell it to always allocate the IP address you want to that MAC address. Or find out if the router only allocates addresses from a limited pool of numbers, and use an address outside that pool.

  7. #7
    Join Date
    Mar 2014
    Location
    Quebec, Canada
    Beans
    63
    Distro
    Lubuntu 18.10 Cosmic Cuttlefish

    Re: IP address keeps changing

    Thanks The Cog, I will do that.

  8. #8
    Join Date
    Feb 2014
    Location
    Canada
    Beans
    47
    Distro
    Ubuntu

    Re: IP address keeps changing

    Good point I forgot to mention!

    Although routers I came across seem to silently reserve an once allocated IP address for this computer again. But I might just have been lucky... But I usually use "high" addresses starting with 200 while these routers usually start allocating at 100.

    Anyway, good point.
    Ankman

    My blog https://news-commentaries.blogspot.com
    Retro arcade game web page http://www.ankman.de/mame/

  9. #9
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    15,103
    Distro
    Kubuntu 20.04 Focal Fossa

    Re: IP address keeps changing

    That router has a pretty poor DHCP server installation if it keeps giving out new addresses to the same device. Most well-designed DHCP servers, like isc-dhcp-server, keep track of the addresses they assign to MAC adapter addresses and give the adapter the same address each time.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •