Private Network Configuration
Your virtual machine supports private networking. If you have initially set up your virtual machine with a private network selected it works automatically, however, certain changes require a manual configuration. For example, when the virtual machine was attached to a private network after it was created.
Choose your Linux version
Edit your network configuration
vim /etc/netplan/50-cloud-init.yaml
Add a new ethernet entry under eth1
You can find your assigned IP address under the "Network" tab of your virtual machine. Below you can see an example configuration:
network:
version: 2
ethernets:
eth1:
addresses:
- "10.0.0.2/24"
set-name: "eth1"
Apply the configuration
sudo netplan apply
Edit your network configuration or create it if it doesn't exist
vim /etc/NetworkManager/system-connections/cloud-init-eth1.nmconnection
Add a new ethernet entry under eth1
You can find your assigned IP address under the "Network" tab of your virtual machine. Below you can see an example configuration:
[connection]
id=cloud-init eth1
uuid=3c50eb47-7260-5a6d-801d-bd4f587d6b58
autoconnect-priority=120
type=ethernet
[user]
org.freedesktop.NetworkManager.origin=cloud-init
[ipv4]
method=manual
may-fail=false
address1=10.0.0.2/24
Apply the configuration
sudo nmcli con reload eth1
Edit your network configuration or create it if it doesn't exist
vim /etc/sysconfig/network-scripts/ifcfg-eth1
Add a new ethernet entry under eth1
You can find your assigned IP address under the "Network" tab of your virtual machine. Below you can see an example configuration:
AUTOCONNECT_PRIORITY=120
BOOTPROTO=none
DEVICE=eth1
IPADDR=10.0.0.2
NETMASK=255.255.255.0
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
Apply the configuration
sudo systemctl restart NetworkManager
(Advanced option) Force a re-run of cloud-init
Making cloud-init run again may be destructive and must never be done on a production system. Artifacts such as ssh keys or passwords may be overwritten.
When cloud init runs again it will set the correct default network values and therefore your IPv4 and IPv6 connectivity should be working out of the box. You do need to reboot your virtual machine for changes to take into effect.

