Answer the question
In order to leave comments, you need to log in
Ubuntu Server 18.04 + VirtualBox - How to set up a network?
Available:
Ubuntu Server 18.04.3 LTS
$ sudo ls /etc/netplan/
01-network.yaml 50-cloud-init.yaml.bak
$ sudo cat /etc/netplan/01-network.yaml
network:
version: 2
renderer: networkd
ethernets:
enp0s3:
dhcp4: yes
enp0s8:
addresses: [192.168.56.2/24]
gateway4: 192.168.56.1
dhcp4: no
$ sudo cat /etc/netplan/50-cloud-init.yaml.bak
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
version: 2
ethernets:
enp0s3:
dhcp4: true
$ sudo cat /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
network: {config: disabled}
$ sudo ifconfig -a
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.2.15 netmask 255.255.255.0 broadcast 10.0.2.255
inet6 fe80::a00:27ff:fe0e:f506 prefixlen 64 scopeid 0x20<link>
ether 08:00:27:0e:f5:06 txqueuelen 1000 (Ethernet)
RX packets 2 bytes 1180 (1.1 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 15 bytes 1704 (1.7 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.56.2 netmask 255.255.255.0 broadcast 192.168.56.255
inet6 fe80::a00:27ff:febe:a750 prefixlen 64 scopeid 0x20<link>
ether 08:00:27:be:a7:50 txqueuelen 1000 (Ethernet)
RX packets 508 bytes 47165 (47.1 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 462 bytes 53569 (53.5 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 6 bytes 402 (402.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 6 bytes 402 (402.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question