With a virtual machine installed a centos7.0 to play, the installation interface than the original 5.x has undergone a great change, but the process is to get through the small difference, it is not recorded. This time the installation of a pure environment, of course, no desktop, no network connection, here to record the configuration of the network process:
1, the virtual device uses the way of bridging, directly connected to the physical network
2, cd/etc/sysconfig/network-scripts/#进入网络配置文件目录
3, vi ifcfg-eno16777736 #编辑配置文件, add modify the following content
hwaddr=00:0c:29:8d:24:73 type=ethernet bootproto=static #启用静态IP地址 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=ae0965e7-22b9-45aa-8ec9-3f0a20a85d11 ONBOOT=yes #开启自动启用网络连接 ipaddr0=192.168.21.128 #设置IP地址 prefixo0=24 #设置子网掩码 gateway0=192.168.21.2 #设置网关 dns1=8.8.8.8 #设置主DNS DNS2 =8.8.4.4 #设置备DNS: wq! #保存退出 4, service network restart #重启网络 5, ping www.baidu.com #测试网络是否正常
centos7.0 Setting up network Connections (IP, gateway DNS)