Step 1: Activate the network card
After the system is installed, the default network card is eth0, use the following command to activate this network card. # ifconfig eth0 up
Step 2: Set the network card to start when entering the system
You want to automatically obtain the IP address to access the Internet every time you turn it on. You must set the network service to start when the system starts. Linux is different from Windows. Many services are stopped by default, and you start the service when you use the service one time, but you don't set it to be the default. The next time you enter the system, the service is still stopped. The following is how to set up the network service to start when the system starts.
Use the chkconfig command to make the network service start by default when the system startup level is 2345.
#chkconfig --level 2345 network on
Step 3: Modify the NIC file ifcfg-eth0
Modify the ifcfg-eth0 file and set the ONBOOT value to yes to let the network service use the network card when it starts. Set the BOOTPROTO value to dhcp to let the NIC automatically obtain an IP address from the DHCP server.
# vi /etc /sysconfig /network-scripts /ifcfg-eth0
ONBOOT = yesBOOTPROTO = dhcp
summary:
usual case, the first three steps are the most important, because most The Linux system default network service is also started when the system starts, and the network card is also enabled. Just set the third step, then use the following command to start the network service.
# service network start
Configure the static IP address to go online with the dynamic IP address, modify ifcfg-eth0, and then restart the network service with the service network retart command.
DEVICE = eth0IPADDR = 192.168.1.100NETMASK = 255.255.255.0GATEWAY = 192.168.1.1DNS = 8.8.8.8BOOTPROTO = staticONBOOT = yes
after performing the above three steps, you can get the ip. But later it was not possible to get ip, and repeating the above did not work.
#dhclient eth0
Remarks:
Linux Force DHCP client (dhclient) to renew ip addressLinux renew ip command$ sudo dhclient -r //release ip Release IP$ Sudo dhclient //Get IP////////////////Original start //////////////////////////////Now Acquire fresh IP:$ sudo dhclient There is no need to restart network service. Above command should work with any Linux distro such as RHEL, Fedora, CentOS, Ubuntu and others. On a related note you can also try out the following commands:# Ifdown eth0# ifup eth0# /etc/init.d/network restart OR# /etc/init.d/networking restart
Introduction to Soft InterruptsInsert processing that can be deferred from the hard interrupt handl
When a person is operating under Linux, they may encounter that the file they are doing is accident
Faced with powerful Microsoft and early NetWare, Linux server operating system can be said to be a r
Linux supports sharing open files between different processes. To illustrate file sharing, lets firs
Shell programming condition test
The slow mail problem of sendmail under Linux host
Cp: omitting directory Error explanation and solution
Take you to know the password "breaking" software under Linux
How to find recently modified files in Linux
Use the awk command to find hidden superusers and passwords in the system.
Run DOS commands in Linux environment
The role of CTRL+Z when running commands under Linux operating system
Introduction to APMD parameters and usage in Linux
Linux environment programming - waitpid with fork and execlp
Win7 system desktop shows my computer icon the easiest way
Win8 upgrade to Win8.1 Update shortcut program
How to use URI with Win10 system
Computer hard disk private file encryption method and hidden skills (3)
Microsoft removes the RT word of Surface
Win10 system quickly create a restore point shortcut method
How can Win8.1 quickly switch between different accounts?
What is AAC? What is AAC format
Iso file to open the ISO file to open the method
Change the size of the start menu icon under Windows XP and 98