How to setup Static IP address on ubuntu server 20.04

Task: 
DNS: 192.168.56.1
Gateway: 192.168.56.1
Netmask: 255.255.255.0
IPv4: 192.168.56.12 

sudo vim /etc/netplan/00-installer-config.yaml
# This is the network config written by 'Samdup'
network:
version: 2
renderer: networkd 
ethernets:
enp0s3:
dhcp4: true
enp0s8:
dhcp4: no
dhcp6: no
addresses: [192.168.56.12/24,]
gateway4: 192.168.56.1
nameservers:
addresses: [8.8.8.8, 8.8.4.4

 

sudo netplan apply 

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed

Menu