I have a fresh install of Ubuntu 18.04.1 server. When I configure netplan with just my WAN address it starts up fine and I can ping out right away. However; when I add another address to my netplan file and reboot I have to run "netplan apply" before I get any connection. Does anyone have any ideas?

edit: Just discovered that even though I can not ping out on server after reboot, I can how ever ssh into it...

network:  
   version: 2  
   ethernets:  
     eno1:  
      renderer: networkd  
      dhcp4: no  
      dhcp6: no  
      addresses: [WAN.190/24]  
      gateway4: WAN.1  
      nameservers:  
        addresses: [24.224.127.143, 24.224.95.205]  
     enp4s0:  
      renderer: networkd  
      dhcp4: no  
      dhcp6: no  
      addresses: [172.16.1.14/20]  
      gateway4: 172.16.1.14  
      nameservers:  
         addresses: [24.224.127.143, 24.224.85.205]
  • Sounds like you have some odd configuration headaches going on, mind sharing the config? It sounds like if you're adding a second address to the same port it's failing routing, or attempting to apply it on boot it doesn't like it, but we'd need to know more about what you've set up. (My guess is routing is at play because you can't ping out from it) – Thomas Ward Nov 27 at 19:10
  • edit it to show conf. Sorry, don't know how to show spaces so had to use dashes. – tremors Nov 27 at 19:33
  • which of the two interfaces is your Internet connection. You can only have one with a gateway, as that sets the default route. I assume the WAN is the Internet one. Remove the gateway4 line from enp4s0, run sudo netplan apply, and see if it works. – Thomas Ward Nov 27 at 19:39
  • Well that did that trick. – tremors Nov 27 at 19:48
  • Glad to hear it. I wrote up an answer to summarize the comments. – Thomas Ward Nov 27 at 21:09

The problem is because both your networks have gateways defined, and as such the netplan configuration is a little 'confusing' and will break your default routes to the Internet.

In netplan configurations, doing this will have conflicting 'default' route rules for your Internet traffic.

For network traffic headed out for a specific interface (to/from the Internet, in this case eno1), set the gateway4 field. For all other network adapters, do not define gateway4 (in this case, enp4s0). Then, either sudo netplan apply or reboot the system.

This will solve the routing headaches that you've observed.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.