linux-Network Connections in Linux

Source: Internet
Author: User
Tags ping and traceroute

In Linux, the Ethernet interface is named: Eth0,eth1, and so on. 0, 1 represents the NIC number.

To view the network card information, you can use the Ifconfig command

Ifconfig-a View All interfaces

Ifconfig eth0 Viewing specific interfaces

To turn the NIC on and off:

Ifup eth0 turn on the NIC Eth0

Ifdown eth0 Turn off the NIC Eth0

The NIC is not visible in ifconfig after it is closed


The Setup command can be used to configure the network in Centos/redhat, and a GUI-like configuration interface is created when the Setup command is entered on the command line:

In Ubuntu this is not the default.


Network-related configuration files:

Nic Profile:/etc/sysconfig/network-scripts/ifcfg-eth0 Ubuntu is:/etc/network/interfaces

DNS configuration file:/etc/resolv.conf

Hostname configuration file:/etc/sysconfig/network

static hostname configuration file:/etc/hosts


Test commands commonly used in the network:

Ping IP ping does not have to be explained, the test network is

Host www.xxx.com Test DNS resolution

Dig www.xxx.com is also a test for DNS resolution, and the information displayed is more detailed

Route shows the routing table (This is also used for configuration routing)

Traceroute www.xxx.com tracks the network path to the destination address (many on the public web are not tracked)

MTR www.xxx.com This command is used to test the quality of the network (actually combining ping and traceroute)


linux-Network Connections in Linux

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.