Results 1 to 7 of 7

Thread: Netplan headache?

  1. #1
    Join Date
    Mar 2014
    Beans
    25

    Netplan headache?

    So I was just to update my DNS server address today. I just changed my netplan yaml file "/etc/netplan/01-netcfg.yaml" and saved it and typed "sudo netplan apply". After that i had no network connectivity until after i reboot. So i did a little research on google and from what i can gather every indentation is supposed to have 2 spaces (make sure you don't have tabs). Also the space between each keyword and the value ("gateway4: 10.0.0.1") had two spaces between them. I also made sure there were no trailing spaces at the end of each line yet i'm still having the issue:

    https://drive.google.com/file/d/18aV...ew?usp=sharing





    Does anyone know whats going on?

    Thanks...
    Last edited by ncage; August 7th, 2020 at 07:08 PM.

  2. #2
    Join Date
    Nov 2009
    Location
    Catalunya, Spain
    Beans
    14,558
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: Netplan headache?

    You need to post the yaml file so that we can have a look and try to help. In theory after a reboot it should have worked. Besides, you lost network connectivity or dns resolving? Those two things are not the same.

    In any case please post the yaml content in CODE tags so that formatting is kept.
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 18.04 LTS 64bit

  3. #3
    Join Date
    Mar 2014
    Beans
    25

    Re: Netplan headache?

    Thanks it was just a little difficult to get it to a place where i could post it here but i figured it out :
    Code:
    # This file describes the network interfaces available on your system
    # For more information, see netplan(5).
    network:
      version: 2
      renderer: networkd
      ethernets:
        eth0:
          dhcp4: no
          addresses: [192.168.7.8/24]
          gateway4: 192.168.7.1
          nameservers:
            addresses: [192.168.7.1]
    So after i run "sudo netplay apply" this is what happens
    Code:
    ping -c 3 google com
    ping: google.com: Temporary failure in name resolution
    Last edited by ncage; August 7th, 2020 at 08:54 PM.

  4. #4
    Join Date
    Nov 2009
    Location
    Catalunya, Spain
    Beans
    14,558
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: Netplan headache?

    The yaml looks good. Are you sure the dns server is working correctly?
    Code:
    ping -c 4 192.168.7.1
    telnet 192.168.7.1 53
    Does telnet connect?

    If it does maybe your dns server is not giving you good reply?

    By the way, to test networking to the internet try by IP:
    Code:
    ping -c 4 8.8.8.8
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 18.04 LTS 64bit

  5. #5
    Join Date
    Mar 2014
    Beans
    25

    Re: Netplan headache?

    Positive. That is the dns server for the entire network

    Quote Originally Posted by darkod View Post
    The yaml looks good. Are you sure the dns server is working correctly?
    Here is an example for a windows box i have on the network
    Code:
    C:\Users\Brent>nslookup google.com
    Server: 192.168.7.1 
    Address:  192.168.7.1
    
    
    Non-authoritative answer:
    Name:    google.com
    Addresses:  2607:f8b0:4009:80d::200e
                      216.58.192.174
    So after i run the netplan command i cannot ping the dns/gateway server (by ip address so there is no name resolution) or external ips like 8.8.8.8. I will get the "ping: connect: network is unreachable". I checked the ip address of the box to make sure it didn't mess up the ip of the machine and it didn't. I checked the dns from /etc/resolv.conf and its the old dns server address (before and after i run the command). The only dns server is still active so everything should still be ok. I double checked the gateway to make sure its pingable (i remember turning ping off at some point) but i only turned it off for the external interface. As soon as i reboot everything is ok again until i run the netplan command.

  6. #6
    Join Date
    Mar 2014
    Beans
    25

    Re: Netplan headache?

    OK maybe i am confused and every time after you run "sudo netplan apply" you have to reboot? After i reboot my network connectivity is fine and if i run
    Code:
    systemd-resolve --status | grep 'DNS Servers'
    i get:
    Code:
    DNS Severs: 192.168.7.1
    So everything seems good but when i run
    Code:
    nslookup google.com
    i get:
    Code:
    Server: 127.0.0.1
    Address: 127.0.0.1:#53
    
    ....
    Which makes you believe the results are coming from localhost.....

  7. #7
    Join Date
    Nov 2009
    Location
    Catalunya, Spain
    Beans
    14,558
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: Netplan headache?

    The last part is fine. That is how ubuntu does it since few years back (unfortunately). It has like a local dns stub (or what ever they call it), which acts as your own local dns server but in fact gets the data from the dns server you put in the network settings. Don't get confused by the 127.0.0.1:53, that's normal now in ubuntu.

    So did I understand correctly that it is working now after reboot?

    I have also seen issues with just restarting netplan or networking after modifications. I find it is best to reboot the whole server. After all, network modifications shouldn't happen that often.
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 18.04 LTS 64bit

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
  •