Post

Static IP and DHCP Configuration in Ubuntu

Show my ip address

sudo ip a
ifconfig

Go to "/etc/netplan/" and edit the required file

#sudo vi /etc/netplan/01-netcfg.yaml
#sudo vi /etc/netplan/00-installer-config.yaml
# This is the network config written by 'subiquity'
# Static IP Conf.
network:
ethernets:
ens33:
addresses:
- 10.5.10.47/24
nameservers:
addresses:
- 10.5.10.10
search:
- guler.com
routes:
- to: default
via: 10.5.10.1
version: 2
# This is the network config written by 'subiquity'
# DHCP Client Conf-1
network:
version: 2
renderer: networkd
ethernets:
ens33: # Ağ arayüz adınızı buraya yazın, ens33 sadece bir örnektir.
dhcp4: true


# This is the network config written by 'subiquity'
# DHCP Client Conf-2
network:
ethernets:
epns160:
dhcp4: true
version: 2

Apply network settings configuration changes and update network settings

sudo netplan apply

Best Regards. – Saygılarımla.

This post is licensed under CC BY 4.0 by the author.