参考:
https://blog.csdn.net/gua___gua/article/details/48968837
1.配置网卡
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens32
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=no
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=ens32
UUID=a0d8811a-95fb-4ea0-9e5b-2ac1313c1bae
DEVICE=ens32
ONBOOT=yes
IPADDR=10.2.2.126
NETMASK=255.255.255.0
GATEWAY=10.2.2.254
Note: 如果关闭DHCP=no,则默认ONBOOT=yes会变成no.需要改成yes.
2. 启动/重启/查看服务
service netwokr start/restart/status
3.使用ifconfig查看配置
需要安装包:
1.yum upgrade
2.yum install net-tools
4.设置DNS
文件:/etc/resolv.conf
nameserver 61.177.7.1