Linux Network configuration graphics and text detailed

Source: Internet
Author: User

After installing Linux, it is necessary to do some simple configuration to normal use, such as network, firewall, security settings and so on, but also need to install some required software. Only after this series of configuration can be considered normal use.

The network is one of the most important functions, so be sure to configure it, otherwise you will not be able to network

Dynamic Network

Dynamic networks can use IP addresses assigned by DHCP servers. Input Vi/etc/sysconfig/network-scripts/ifcfg-eth0 will show the following screen

Edit Linux Network card properties

When CentOS was just installed, it was DHCP by default, but the NIC was not enabled. That is to be in the onboot= "no", the option is changed to Yes, otherwise the network card does not automatically online, will lose its role. When you are done, press ESC to code mode and enter ": Wq" (without quotes) to save the exit. Explain, the W parameter is saved meaning, q is exit, two parameters together is to save and exit the meaning.

Static Network

As a server, it is best to use a static network and assign it a legitimate IP address. or use the command to edit the network card properties vi/etc/sysconfig/network-scripts/ifcfg-eth0 to the following image

Edit Linux static network card properties

To change the bootprot= "DHCP" to static, that is, to statically address. Add three records: Ipaddr= "172.18.4.199" (Here I give the allocation of the 172.18.4.199 as an example), the back of the netmask is the subnet mask, Gateway is gateways. After filling out, still press ESC and then: Wq save. In order for the settings to take effect to restart Linux, there are two ways to reboot, one is the reboot command, the other is shutdown-r now.

After setting the IP address and subnet mask, you can ping the gateway to see the return value if you want the settings to be effective.

Linux for Ping Gateways

It seems to have ping the gateway, but ping the extranet address is not a pass. What is this for? Yes, it is not set DNS, so the domain name can not be resolved, this time to DNS settings, the command is as follows: vi/etc/resolv.conf, add two records

The code is as follows Copy Code

NameServer 8.8.8.8

NameServer 8.8.4.4

Here take Google's DNS as an example, the actual local DNS is the subject. After setting up, reboot restart the network is normal.

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.