Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: netplan issue with Ubuntu 18.04.1 Server. No network connectivity (no routes either)

  1. #1
    Join Date
    Nov 2018
    Beans
    6

    netplan issue with Ubuntu 18.04.1 Server. No network connectivity (no routes either)

    I've been using Ubuntu since inception and have recently found out about Ubuntu's switch to using netplan vs it's traditiona /etc/network/interfaces method.


    I'm attempting to get this to work but it simply isn't working. Based on what I can tell, there is no default route, or possibly even a bad netplan (though ./netplan apply runs correctly). Below is what I'm doing:



    • Clean/brand new 18.04.1 install on ESXi
    • Interface is named ens160
    • My IP Address 247.235.60.161
    • My Gateway is 247.235.38.51
    • My subnet mask is 255.255.255.255



    /etc/netplan/01-netcfg.yaml:


    Code:
    network:
      version: 2
      renderer: networkd
      ethernets:
              ens160:
                      dhcp4: no
                      addresses: [247.235.60.161/32]
                      gateway4: 247.235.38.51
                      nameservers:
                              addresses: [8.8.8.8,8.8.4.4]
    When I run "netplan apply" it completes successfully. If I do with the --debug switch, nothing jumps out (see here: https://i.imgur.com/aViBohG.png ). "ip link" shows this: https://i.imgur.com/Scs7Frv.png


    If I ping 8.8.8.8 I get a "SIOCADDRT: Network is unreachable"


    If I do a "route" to view my routing table, it returns with nothing. No routing table. This definitely is an issue.


    If I do an "ifconfig -a" it displays my ens160 interface, correct IP, netmask of 255.255.255.255, no broadcast address, the mac/ether address is correct.


    With regards to the addressing/gw/sn, I can confirm that is correct (I have other hosts running with same/similar on this network/ESXi server).


    Something is definitely wrong with netplan. Any ideas?


    Thanks very much for your help!
    Last edited by uufor44400aa12; November 4th, 2018 at 02:48 AM.

  2. #2
    Join Date
    Mar 2006
    Location
    Williams Lake
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: netplan issue with Ubuntu 18.04.1 Server. No network connectivity (no routes eith

    It looks like your spacing is off, a yaml file uses spaces, not tabs. Your /etc/netplan/01-netcfg.yaml should look similar to this:

    Code:
    network: 
      version: 2 
      renderer: networkd 
      ethernets: 
        enp0s3: 
          addresses: [192.168.107.2/24] 
          gateway4: 192.168.107.1 
          nameservers: 
            addresses: [192.168.107.212,192.168.107.213,1.1.1.1,8.8.8.8]

  3. #3
    Join Date
    Nov 2018
    Beans
    6

    Re: netplan issue with Ubuntu 18.04.1 Server. No network connectivity (no routes eith

    Quote Originally Posted by cariboo View Post
    It looks like your spacing is off, a yaml file uses spaces, not tabs. Your /etc/netplan/01-netcfg.yaml should look similar to this:
    Hey there, thanks for the response!

    My forum post here was hand written VS a copy paste due to it being an ESXi instance where copy/paste is not available.

    The server itself is correctly spaced (auto-spaces in vi + no errors on run). Definitely is something other than spaces

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

    Re: netplan issue with Ubuntu 18.04.1 Server. No network connectivity (no routes eith

    Did you set up a static IP during installation or you let it use dhcp and then modified netplan config? I have found that selecting static IP during installation creates the correct netplan file by default.

    Also, I know you say your IP and GW data is correct, but I keep wondering. A 247.235.60.161/32 address would not be able to reach the GW 247.235.38.51 in general. It is completely out of the subnet, even if you used /24 that GW would still be out of the range.

    I assume you double checked the networking on ESXi level? Made sure the vSwitch/portgroup is correct?
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 18.04 LTS 64bit

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

    Re: netplan issue with Ubuntu 18.04.1 Server. No network connectivity (no routes eith

    Quote Originally Posted by darkod View Post
    Also, I know you say your IP and GW data is correct, but I keep wondering. A 247.235.60.161/32 address would not be able to reach the GW 247.235.38.51 in general. It is completely out of the subnet, even if you used /24 that GW would still be out of the range.
    +1 this doesn't make sense. As a test, try a subnet mask of 19.
    Any follow-up information on your issue would be appreciated. Please have the courtesy to report back.

  6. #6
    Join Date
    Apr 2007
    Beans
    66

    Re: netplan issue with Ubuntu 18.04.1 Server. No network connectivity (no routes eith

    You are using the wrong subnet mask. Using a /32 means the default gateway is not on the same subnet.

  7. #7
    Join Date
    Nov 2018
    Beans
    6

    Re: netplan issue with Ubuntu 18.04.1 Server. No network connectivity (no routes eith

    Quote Originally Posted by darkod View Post
    Did you set up a static IP during installation or you let it use dhcp and then modified netplan config? I have found that selecting static IP during installation creates the correct netplan file by default.

    Also, I know you say your IP and GW data is correct, but I keep wondering. A 247.235.60.161/32 address would not be able to reach the GW 247.235.38.51 in general. It is completely out of the subnet, even if you used /24 that GW would still be out of the range.

    I assume you double checked the networking on ESXi level? Made sure the vSwitch/portgroup is correct?
    Hey there, thanks again for the response!

    On installation I skipped the networking portion due to the eternal bug that Ubuntu has in that it does not accept network information that has a GW not on the same subnet as the IP. For those who are curious, you absolutely can have a GW not on the same subnet as your IP address. So I skipped the network information and then configured it manually.

    As far as the networking on the ESXi level, that is correct, there are many VMs with the same addressing information (except the IP addy being different).

  8. #8
    Join Date
    Nov 2018
    Beans
    6

    Re: netplan issue with Ubuntu 18.04.1 Server. No network connectivity (no routes eith

    Quote Originally Posted by joebeasley View Post
    You are using the wrong subnet mask. Using a /32 means the default gateway is not on the same subnet.
    Hey there, it definitely is correct.

    The subnet has a single host hence the cidr /32. You are correct, the gateway is not on the same subnet as the IP address (since it is a /32). The subnet listed is correct.

    For what it's worth, if I install Ubuntu 16.04 then this works correctly when I dump it into /etc/network/interfaces. It also works with other OSes. It only fails with netplan on Ubuntu versions that require it.

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

    Re: netplan issue with Ubuntu 18.04.1 Server. No network connectivity (no routes eith

    Quote Originally Posted by uufor44400aa12 View Post
    For those who are curious, you absolutely can have a GW not on the same subnet as your IP address.
    Yes, but from what I read before replying earlier today, it isn't straight forward, and routing needs to be specifically taken care of.

    If you say it worked for 16.04, I believe you. I am not a fan of netplan, and that is why my servers are still on 16.04.
    Any follow-up information on your issue would be appreciated. Please have the courtesy to report back.

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

    Re: netplan issue with Ubuntu 18.04.1 Server. No network connectivity (no routes eith

    ESXi does some strange things with its networking/bridging, making use of its from the drivers that would not work with a real switched network. Maybe this is why your mis-configured networking works on other boxes though I am surprised that it does. It appears that netplan is doing more sanity checking and ignoring erroneous configuration. You really should correct your subnet mask, although configuring the interface as a point-to-point link instead of a normal ethernet link might possibly work, given ESXI's special knowledge.

Page 1 of 2 12 LastLast

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
  •