Set static IP in virtual machine
Quick instructions for Ubuntu Server 22.04 vm's created in Proxmox.
- Remove all files in
> sudo rm /etc/netplan/*
- Find your mac address and other details
Copy the value of
> ip a
- Create new netplan configuration file.
> sudo -e /etc/netplan/00-network.yaml
- Add configuration, as below replacing addresses as required.
network: version: 2 renderer: networkd ethernets: eth0: addresses: - 192.168.10.10/24 routes: - to: default via: 192.168.10.1 nameservers: search: [winters.local] addresses: [192.168.1.195,192.168.1.1] match: macaddress: c6:2a:cb:17:ee:81 set-name: eth0
- Apply configuration
> sudo netplan apply