Results 1 to 4 of 4

Thread: System obtains two IP addresses from DHCP

  1. #1
    Join Date
    Nov 2021
    Beans
    3

    System obtains two IP addresses from DHCP

    Hey, I was wondering how this could be:
    My router says it assigned two different IPs to my home server and I can use both to ping and ssh onto it. They do have the same MAC address but different DHCP client ids.

    Looking at ifconfig eno2 only one address is shown, looking at /var/lib/dhcp/dhclient.leases only the other one is shown. I thought my networking master was netplan, having quite a simple setup:
    Code:
    network:
      version: 2
      renderer: networkd
      ethernets:
        eno2:
          dhcp4: yes
    What could I have done wrong or which configs could live on from old sates of the system bringing up this odd behaviour?

    P.S.: I'm pretty sure this is also the reason my bonding wasn't working

  2. #2
    Join Date
    Feb 2011
    Location
    Coquitlam, B.C. Canada
    Beans
    3,521
    Distro
    Ubuntu Development Release

    Re: System obtains two IP addresses from DHCP

    Which version of Ubuntu?

    I wonder if somehow you have got a mixture of systemd-networkd and the old way going on at the same time. I am not an expert, and actually avoid using netplan entirely, preferring systemd-netorkd directly. You appear to have dhclient running, which I don't think it should be. There shouldn't be a dhclient.leases file. I think you have to decide one way or the other between systemd-networkd (which netplan is merley a front end for) or ifup/down (or whatever the official name for the old way is).
    Any follow-up information on your issue would be appreciated. Please have the courtesy to report back.

  3. #3
    Join Date
    Dec 2021
    Beans
    4

    Re: System obtains two IP addresses from DHCP

    It could be the your computer has an outdated ARP table, witch causes the crash. You can list the ARP table with $ arp -a and review the result for compared with your correct network interface.

  4. #4
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: System obtains two IP addresses from DHCP

    Any server should have a static IP assigned and not trust DHCP. This is important for a number of reasons, including security and firewall rules. There are attacks against DHCP servers that can do some nasty things. Why risk it? Just setup static IPs for every device that isn't portable. Some IoT devices should use DHCP reservations to get the same IP assigned always, but only devices from outside your home - like when guests come for a visit - should truly have random DHCP addresses.

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
  •