Centos7 after installation is required to start the network connection in the NIC configuration file Onboot =yes first when the NIC gets IP mode is DHCP
You will find that ifconfig can not be used, speculation is abandoned, you want yum install Net-tools this bag.
Vim This is also no also need Yum
So use VI below
First CD to
cd/etc/sysconfig/network-scripts/
Centos7 and 6 series many different LS a bit
The basic is Ifcgf-e centos6.5 is ifcfg-eth0 7 is ifcfg-exxxx
This is a 7 configuration.
Hwaddr=00:0c:29:24:9f:be
Type=ethernet
Bootproto=static
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=a8dc7adf-7e30-47e5-819c-2268900ddfb0
Onboot=yes start NIC
Nm_controlled=yes
The above is basically the default
ipaddr=192.168.0.211 IP Address
netmask=255.255.255.0 Subnet Mask
gateway=192.168.0.8 Gateway
dns1=192.168.0.3 Intranet DNS Please note that some students in the local test when the DNS is written outside the DNS, will cause the network can not be networked, if you do not have a DNS server or DHCP server is fine,
This place, the DNS on the intranet is written as well.
dns2=202.96.128.86 External Network DNS
Basically write so much ok, some people say to go to configure the gateway file and DNS file, actually do not, because the configuration file layer of read, if your configuration will also be overwritten when reading the configuration file
It's centos6.5 's configuration.
Device=eth0
Hwaddr=00:e0:62:08:c8:a8
Type=ethernet
uuid=9977e8c3-d3ff-499a-8646-c793726dd64c
Onboot=yes
Nm_controlled=yes
Bootproto=static Static IP
ipaddr=192.168.0.87 IP Address
netmask=255.255.255.0 Subnet Mask
gateway=192.168.0.8 Gateway
dns1=192.168.0.3 Intranet DNS Server IP
dns2=202.96.128.86 external network DNS server IP
The two network cards are almost the same, many of the computer rooms are intelligent double-line, through the switch, or router to achieve line switching
When using VI, there is a forced exit of the small method of the uppercase ZZ, the predecessor exits the Save
: q! Do not save exit
: Wq Save Exit
ZZ Force Exit Save
Linux basic Command series