ifconfig command to view network settings
Step 1, configure the files in the/etc/sysconfig/network-scripts/ifcfg-eth0. Some (IFCFG-ENS33) files
Configuration details for the Ifcfg-eth0 under CentOS:
[Email protected] ~]# Vim/etc/sysconfig/network-scripts/ifcfg-eth0
Device= "Eth0"
Hwaddr= "00:0C:29:FD:FF:2A"
Nm_controlled= "Yes"
onboot= "Yes"
ipaddr=192.168.1.31
netmask=255.255.255.0
gateway=192.168.1.1
Bootproto=static
The previous three lines are the system Jairus, followed by manual additions.
So set the buckle, remember to restart the network card:
[[email protected] ~]#/etc/init.d/network stop
[[email protected] ~]#/etc/init.d/network start
OK, now you can ping through the gateway, if you have to surf the internet, do not have to set up DNS. Setting up DNS is described in step 2
Step 2, modify DNS
[Email protected] ~]# vi/etc/resolv.conf
Add two DNS to the inside:
NameServer 202.96.134.133
NameServer 8.8.8.8
OK, big attack Gaocheng, can surf the internet!!!
Linux Internet Settings