Linux system network configuration and linux System Network Configuration

Source: Internet
Author: User

Linux system network configuration and linux System Network Configuration


Linux Network Configuration

There are several methods to configure the Linux system network. Here we will introduce two common methods.

First, use the command ifconfig to configure. Use Ipconfig ethx x. x netmask x. x

The effect is as follows:

 

Generally, this configuration method is only used for testing, because after the machine is restarted, the configuration content will become invalid.

 

Method 2: vi/ect/sysconfig/network-scripts/ifcfg-ethx

This configuration method directly modifies the configuration file, and the configuration effect will always take effect.

Is the effect of the virtual machine configuration in this example. The specific parameters are not parsed:

Common Linux Network commands:

Modify DNS command:

# Vi/etc/resolv. conf

Nameserver 202 101.224.68

Nameserver 202.101.224.69

 

Long-term effectiveness:

Enable eth0: ifup eth0

Disable eth0: ifdown eth0

 

Temporary effect:

Enable NIC: ifconfig eth0 up

NIC: ifconfig eth0 down

Restart the server:

Service network restart or/etc/init. d/network restart

 

Configure the Host Name and Default Gateway:

Vi/etc/sysconfig/network

NETWORKING = yes whether to enable the System Network Function

HOSTNAME = centosmin

 

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.