版权声明:Copyright © https://cloud.tencent.com/developer/article/1476321
# Centos 配置网卡
ifconfig
vi /etc/sysconfig/network-script/网卡名称
TYPE=Ethernet
BOOTPROTO=static 静态ip
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME=eno16777736
UUID=34bbe4fa-f0b9-4ced-828a-f7f7e1094e4a
DEVICE=eno16777736
ONBOOT=yes
PEERDNS=yes
PEERROUTES=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPADDR=192.168.179.3 ip地址
NETMASK=255.255.255.0 子网掩码
GATEWAY=192.168.179.2 网关
service network restart
# 修改DNS 地址
vi /etc/resolv.conf
修改文件内容 nameserver 114.114.114.114