Configure Static IP Addresses on Ubuntu 18.04 LTS Server

Опубликовано: 15 Октябрь 2024
на канале: The Training Help
62,907
192

How to configure static IP address on Ubuntu 18.04 Bionic .
Configure Static IP Addresses on Ubuntu 18.04 LTS Server.
How to Configure static IP address in Ubuntu Server 18.04 LTS.
--------------------------------------------------------------------------------------------------------
Configure Static IP Addresses on Ubuntu 18.04 LTS Server
Go to the file
/etc/netplan/50-netcfg.yaml
-----------------------------------------------------------------------------
ONLY STATIC IP
------------------------------------------------------------------------------
network:
version: 2
renderer: networkd
ethernets:
enp0s8:
dhcp4: no
addresses: [192.168.0.100/24]
gateway4: 192.168.0.1
nameservers:
addresses: [8.8.8.8,8.8.4.4]
----------------------------------------------------------------------------------
DHCP AND STATIC IP
----------------------------------------------------------------------------------
network:
ethernets:
enp0s3:
addresses: []
dhcp4: true
optional: true
#version: 2
network:
version: 2
renderer: networkd
ethernets:
enp0s8:
dhcp4: no
addresses: [192.168.0.100/24]
gateway4: 192.168.0.1
nameservers:
addresses: [8.8.8.8,8.8.4.4]
-----------------------------------------------------------------
RUN COMMAND.
-----------------------------------------------------------------
sudo netplan apply

sudo netplan --debug apply