1、查看网卡名字

[root@bogon ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:0c:29:a9:f0:25 brd ff:ff:ff:ff:ff:ff
    inet 192.168.232.128/24 brd 192.168.232.255 scope global noprefixroute dynamic ens33
       valid_lft 863sec preferred_lft 863sec
    inet6 fe80::6fbb:42a7:2c7:8f56/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
[root@bogon ~]# 

网卡名字是ens33,在centos7版本以后网卡名字都改成了ens33

2、修改网络信息配置文件

[root@bogon ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens33

# 把最后一行 ONBOOT=no,改为ONBOOT=yes,如下我已经改成了yes
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=dhcp
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=7cb158af-de25-49da-8d13-959e44272942
DEVICE=ens33
ONBOOT=yes

3、重启网络

[root@bogon ~]# ifup ens33
[root@bogon ~]# 

Q.E.D.

知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议

隻言片語・於此匯聚!