4

I am struggling to set up a static IP address in Ubuntu server 18.04 server LTS. The OS is running in a VirtualBox machine.

What I have done so far:

  1. Created a VM.
  2. Added a "NAT and a "Host-only" adapter to the network settings in VirtualBox.
  3. Installed Ubuntu Server 18.04 LTS.
  4. Configured netplan with static IP settings matching IP of "Host-only adapter.
  5. Ran netplan apply
  6. Ran netplan --debug generate to check syntax accuracy. (Passed)
  7. Rebooted server

My current netplan configuration as described by the netplan documentation:

netplan configuration - host

Ping results in an error message: Temporary failure in name resolution.

ping result - host

Gateway and nameserver addresses are set to the IP of the NAT adapter in VirtualBox's "Host Network Manager" as per screenshot:

Host Network Manager - VB

The "Host-only" adapter is added to the VM under adapter 2:

Network adapter settings -VB

This is configured in netplan as enp0s8.

Changing the configuration back to DHCP using eth0s3 allows name resolution, but the moment I switch back to eth0s8 with a static configuration I am unable to resolve to any domains.

Update: See the result of "route -n"

result of route n

Please assist.

slava
  • 3,787
  • 9
  • 30
  • 65
  • 2
    I had the exact problem. The solution was to remove the gateway4 entry from the enp0s8 ethernet config as described here ... https://askubuntu.com/a/1051542/22667 – Michael Gorham Jul 12 '18 at 19:29
  • 1
    Please check out either the detailed description on how to set everything up https://unix.stackexchange.com/a/457240/301403 or the original solution / working netplan https://askubuntu.com/a/1051542/851428. I hope it solves the issue you are having. – lars Jul 19 '18 at 15:20

0 Answers0