First time when the basic network configuration is
1. Check the network mac address first
[root@centos ~] # cat /etc/udev/rules.d/70-persistent-net.rules
2. Modify hostname
[root@centos ~]# vim /etc/sysconfig/network< Br>
Open the file, modify the following and save
NETWORKING=yes #Use the network
NETWORKING_IPV6=yes #Use the network to not write
HOSTNAME=centos #Set Host Name
3.Modify Network Card
[root@centos ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0 # Correspondence A network card
TYPE=Ethernet
ONBOOT=yes #Run at startup
NM_CONTROLLED=yes
BOOTPROTO=static #Use static IP, and IP is not assigned by DHCP
DEFROUTE=yes
HWADDR=00:50:56:94:04:3C # Must correspond to the MAC address of etho (/etc/udev/rules.d/70-persistent-net.rules)
PEERDNS=yes # The dns obtained from DHCP overwrites the local DNS
PEERROUTES=yes
IPADDR=192.168.0.100 #Specify the local IP address
NETMASK=255.255.255.0 #Specify the child Netmask
GATEWAY=192.168.0.1 #Specify gateway
IPV6INIT=no# indicates that IPV6 is not supported
4.Modify DNS
[root@ Centos ~]# vim /etc/resolv.conf
Open the file, modify the following and save
nameserver 202.106.195.68 #Specify the nearest DNS server in the current city (the cities are different, online Search)
nameserver 202.106.46.151
nameserver 192.168.0.1 #Specify the DNS server specified on the router
5. Restart the network configuration
[ ,null,null,3],Root@centos ~]#service network restart
6.Test whether to connect to the external network
ping gateway
ping www.bicner.com
The above is A piece of content that you can find from the Internet, this is easy to find on the Internet
The following is the most important note.
1. Check if the network cable is plugged in
The server is sometimes so wonderful, obviously the light of the network cable interface is bright, but in fact it is not good, don't ask me how to know, in the ratio The data center where the factory sounds are big, standing for a few hours, I won’t say it out.
[root@RedHat ~]# ethtool eth0
Look at Link detected: yes This line, if yes, it means the network cable is connected. If it is no, it is not connected to the network cable. You can also see the Speed line. If it is Unknown, the network cable is not plugged in. If it is 1000Mb/s, the network cable is plugged in.
Ifconfig can also be viewed. If there is no RUNNING, it means the network cable is not connected.
2. NIC interface is closed and activated
[root@RedHat ~]# ifdown eth0 #关闭网络
[root@RedHat ~]# ifup eth0 #Start Network
A few days ago, I met a friend on QQ and asked for help. I said that the VPS I bought could not sta
In daily work or experiment, we often need to clone or migrate the virtual machine. After the migra
The process is simply a process of executing a program, it is a dynamic concept. No matter what sys
The missing header file ‘security/pam_modules.h’ is part of the libpam development, a P
How do I create a logical volume management (LVM) partition using kickstart?
Shell script to view Linux memory usage
Linux operating system classic practical skills 33
Linux cd command Switch working directory
Linux Hypertext Cross Code Retrieval Tool
Linux Network Programming--Advanced Socket Function
u disk installation linux experience
How to install Perl scripting language under Linux operating system
What should I do if the Windows 8 system enters the desktop and the syslevelup prompt pops up?
How to delete the remaining folders after Win8 uninstalls Master Lu?
How does Win10 turn off automatic maintenance? Win10 off automatic maintenance tutorial
Windows 8 Global Search and Settings
12Windows XP Home Edition can also be used with IIS
What is the win7 shutdown shortcut key
What should I do if the win8 store cannot download and cannot complete the purchase?