Guide Change Static Ip on Linux (Debian Family)

Static IP on Linux.
1)If you are interested about static ip, click here.
2)If you are interested about static ip, click here.

Step 1. First, find the name of the active network interfaces that you want to configure. To do so run the following command:

#ip a (IP add/ ifconfig / IP address)

Step 2. The Netplan default Configuration file is under the directory /etc/netplan. You can find that using the following command:

#ls /etc/netplan/

Step 3. To view the content of Netplan network Configuration file, run the following command:

#cat /etc/netplan/*.yaml

Step 4. Now you will need to open the Configuration file in any editor: As I am using Nano editor to edit the Configuration file, so I will run:

#sudo nano /etc/netplan/*.yaml

Step 5. Update the Configuration file as per your networking needs. For static IP addressing, add the IP address, Gateway, DNS information while for dynamic IP addressing, there is no need to add this information as it will get this information from DHCP server. Use the following syntax to edit the Configuration file.

//This is yaml file.

network:
Version: 2
Renderer: NetworkManager/ networkd.
Ethernets:
DEVICE_NAME:
DHCP4: yes/no
Addresses: [IP_ADDRESS/NETMASK]
Gateway: GATEWAY.
Nameservers:
Addresses: [NAMESERVER_1, NAMESERVER_2]

Step 6. Test it VIA ping command
#Ping X. X. X. X (for example 8.8.8.8)

You can get detailed info from here (via picture or screenshoot ).
Thanks For your attention XD.
 
Son düzenleme:

Geri
Yukarı