1. vi /etc/sysconfig/network-scripts/ifcfg-ens33
    1. TYPE=Ethernet
    2. PROXY_METHOD=none
    3. BROWSER_ONLY=no
    4. BOOTPROTO=static
    5. DEFROUTE=yes
    6. IPV4_FAILURE_FATAL=no
    7. IPV6INIT=yes
    8. IPV6_AUTOCONF=yes
    9. IPV6_DEFROUTE=yes
    10. IPV6_FAILURE_FATAL=no
    11. IPV6_ADDR_GEN_MODE=stable-privacy
    12. NAME=ens33
    13. UUID=495eadde-2a91-44bc-b656-67056b2b504f
    14. DEVICE=ens33
    15. ONBOOT=yes
    16. # 自定义参数
    17. IPADDR=192.168.1.101
    18. NETMASK=255.255.255.0
    19. GATEWAY=192.168.1.1
    20. DNS1=114.114.114.114

    然后执行命令刷新网络配置

    1. service network restart