Manual setup in the CentOS environment-network parameter configuration-network error sequence-

Source: Internet
Author: User
Tags network troubleshooting

The network parameters in Linux roughly include the following:

IP Address

Subnet mask

Gateway

DNS Server

Host name (default localhost)

Historically, the methods of modifying these parameters in Linux systems are: command, file two. Where the command settings can be effective immediately but will expire after a reboot, the file modification is implemented permanently, but does not take effect immediately.

First, let's look at the way the command works:
Ifconfig: View and set IP address, subnet mask
Hostname: View and set host name
Route: View and set routing information (default gateway, etc.)

To modify by file:
/etc/sysconfig/network-scripts/ifcfg-device name (typically Ifcfg-eth0) IP, default gateway, subnet mask
/etc/sysconfig/network
/etc/resolv.conf files: Setting up a DNS server

Network troubleshooting

Check that the native network protocol is correct: # ping-c 3 127.0.0.1
Check that the native NIC link is correct: # ping-c 3 192.168.0.1 (native IP address)
Check that the gateway is correct: # PING-C 3 192.168.0.254 (Gateway IP address)
Check external connectivity: # PING-C 3 www.google.com.hk
Check the hardware

1. The network card can be set directly through the Ifconfig eth0 IP, but these things are temporarily operated, as long as the Networking System (NIC) restarts, and the previous settings are restored.

If you update the IP of eth0, the default netmask and default gateway, as well as the network segment, will change, so you need to redefine the appropriate configuration for the new IP.

2. You can do this by directly modifying the eth0 profile of the NIC and then restarting the Network service.

(1) in the CentOS environment,/etc/sysconfig/ifcfg-eth0, this file does not exist.

Copy the file structure to create a new file through the CP Ifcfg-lo Ifcfg-eth0.

(2) Modify the file:

If you update the specified ipaddr:192.168.134.223

Then, the corresponding subnet mask netmask:255.255.255.0

The corresponding network designator network:192.168.134.0 represents the network representation in this network segment, that is, the IP of the network segment is the first IP of 0.

Broadcast address broadcast:192.168.134.255 represents the last IP of the secondary network segment, which is the broadcast address.

  

Add a default gateway, otherwise you cannot surf the Internet. NAT Architecture's network is generally made up of the NAT service IP (192.168.134.2) as the default gateway.

Add a DNS server that is generally selected (192.168.134.2) as the DNS service address.

  

(3) Restart the network

/etc/init.d/network restart

Success.

Manual setup in the CentOS environment-network parameter configuration-network error order-

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.