Results 1 to 2 of 2

Thread: Ubuntu Sever Dhclient on Startup

  1. #1
    Join Date
    Mar 2021
    Beans
    1

    Ubuntu Sever Dhclient on Startup

    I just installed Ubuntu server 20.04 and when I set my network interface up and run dhclient, network works fine. But when I reboot I have to run dhclient on every startup. I have researched this and I have found that I might have to use netplan with yaml config files. Is there an easier way to do this or a very. indepth guide on how to use netplan or is there another distro that can do this easier?

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

    Re: Ubuntu Sever Dhclient on Startup

    Quote Originally Posted by mattwag52 View Post
    I just installed Ubuntu server 20.04 and when I set my network interface up and run dhclient, network works fine. But when I reboot I have to run dhclient on every startup. I have researched this and I have found that I might have to use netplan with yaml config files. Is there an easier way to do this or a very. indepth guide on how to use netplan or is there another distro that can do this easier?
    If netplan for DHCP is an issue, I'd suggest that you really don't want to run Ubuntu Server. The netplan file you need is one of the easiest configs to have on an Ubuntu Server install.

    Something like:
    Code:
    network:
      version: 2
      renderer: networkd
      ethernets:
        enxc0335eee777f:
          dhcp4: true
          dhcp6: false
    Just change the ethernet device to match yours which **will be different.** Use the exact spacing shown. netplan.yaml files care about indentation. I've never used tabs, so don't know if that works. The exact number of spaces for each level of indentation isn't important, but consistency is.

    Of course, if you already have a netplan file like this and it isn't working, then we need to
    a) see the exact contents of the file - use "code tags" like I have above or the critical indentation won't be seen here.
    b) look at other issues, probably with the hardware support or cables or switch port or routing or DHCP server in your location.

    DHCP with netplan is pretty bonehead. It is one of the few things that "just works."

    And after making any changes to any netplan files, be certain to :
    Code:
    sudo netplan generate
    sudo netplan apply --debug
    Last edited by TheFu; March 13th, 2021 at 04:50 PM.

Tags for this Thread

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
  •