Network Configuration by netplan
For Example we want to set IPv4 192.168.10.10 on our ubuntu machine, here is a sample of yml file
network: version: 2 renderer: networkd ethernets: eth0: dhcp4: false dhcp6: false addresses: - 192.168.10.10/24 routes: - to: default via: 192.168.10.1 nameservers: addresses: [192.168.10.1]
In the above configuration:
eth0– is the network interface name
addresses– is used to configure IPv4 address on an interface. Make sure to define CIDR. You can add multiple addresses here
nameservers– Set the name servers here. 126.96.36.199 and 188.8.131.52 are Google’s name servers
routes– This is used to set gateway on your system.
Make sure the IPv4 address belongs to the system network and has the correct gateway Ip address. Once confirmed, save file content and close it.
after editing yml file which should be exist in this path /etc/netplan, should run these 2 commands:
sudo netplan generate sudo netplan --debug apply
Nginx – Apache
check status of services:
systemctl status apache2 systemctl status nginx