首页 > 代码库 > centOS 7联网

centOS 7联网

    在windows上安装的centOS7虚拟机要联网后才能正常使用,只需这样配置下即可:

      打开vim /etc/sysconfig/network-scripts/ifcfg-eno16777736,会看到:

      TYPE=Ethernet
      BOOTPROTO=dhcp
      DEFROUTE=yes
      PEERDNS=yes
      PEERROUTES=yes
      IPV4_FAILURE_FATAL=no
      IPV6INIT=yes
      IPV6_AUTOCONF=yes
      IPV6_DEFROUTE=yes
      IPV6_PEERDNS=yes
      IPV6_PEERROUTES=yes
      IPV6_FAILURE_FATAL=no
      NAME=eno16777736
      UUID=bee7fabf-6977-4466-a7d7-f9bbdd2350b3
      DEVICE=eno16777736
      ONBOOT=no(将这里改为yes即可)
    最后重启网络服务即可:service network restart(systemctl restart network)

    另外centOS7启动和关闭防火墙的命令是firewalld.service,而不是iptables,

    systemctl stop firewalld  

    systemctl start firewalld

 

  

 

 

 

      

centOS 7联网