Home > OS >  Centos8 set a static IP
Centos8 set a static IP

Time:10-08


Adjust the configuration file


/root @ localhost ~ # CD/etc/sysconfig/network - scripts/
[root @ localhost network - scripts] # ls
Ifcfg - ens33
[root @ localhost network - scripts] # vi ifcfg - ens33


TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
# BOOTPROTO="DHCP"
# set static IP
BOOTPROTO="static"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable - privacy"
NAME="ens33
"UUID="c7e - 9 cca e6783344-8348-4-3 f07360b567a"
DEVICE="ens33"
ONBOOT="yes"

# set the IP address
The PREFIX=24
IPADDR=192.168.1.80
GATEWAY=192.168.1.1
NETMASK=255.255.255.0
DNS1=192.168.1.1

Reproduced reference: https://www.cnblogs.com/song-wentao/p/12255253.html
  • Related