4 Key network commands in the shell

Source: Internet
Author: User
Tags nslookup root access

Ifconfig

This command is consistent with the "ipconfig" function of windows for displaying details such as network interfaces, subnet masks, and so on.

Ifconfig the left column is the network interface name, which occupies 10 bytes, and several columns on the right show the details of the corresponding network interface.

In each system, the default is a lo, called the loopback interface, which points to the current host itself.

The following is the message displayed after running this command on the blogger's computer:

650) this.width=650; "title=" Ifconfig "src=" http://www.linuxprobe.com/wp-content/uploads/2017/03/ Wkiom1jtzilidxowaaf5wokecpa348.jpg the use of 4 network-related commands in the "alt=" Shell "border=" 0 "style=" height:auto; "/>

Related tips:

1. Print a list of network interfaces

650) this.width=650; "title=" "src=" http://www.linuxprobe.com/wp-content/uploads/2017/03/ Wkiol1jtzjssmsvraaafuf9i7qs044.png the use of 4 network-related commands in the "alt=" Shell "border=" 0 "style=" height:auto; "/>

Description: The first 10 bytes of the ifconfig output show the network interface name, so we use the Cut command to extract the first 10 characters of each line.

Run as follows:

650) this.width=650; "title=" "src=" http://www.linuxprobe.com/wp-content/uploads/2017/03/ Wkiol1jtzj7ym1liaabpmjl6seu051.png the use of 4 network-related commands in the "alt=" Shell "border=" 0 "style=" height:auto; "/>

2. Hardware address (MAC address) spoofing

In some cases, it is necessary to use hardware addresses to authenticate or filter computers on the network, and we can use hardware address spoofing

The command is as follows:

650) this.width=650; "title=" "src=" http://www.linuxprobe.com/wp-content/uploads/2017/03/ Wkiom1jtzlcj6phiaaaepqnrfhy091.png the use of 4 network-related commands in the "alt=" Shell "border=" 0 "style=" height:auto; "/>

Let's run a look at the results:

650) this.width=650; "title=" "src=" http://www.linuxprobe.com/wp-content/uploads/2017/03/ Wkiom1jtzluxx1gnaagkyglo5wc494.png the use of 4 network-related commands in the "alt=" Shell "border=" 0 "style=" height:auto; "/>

Note: This command requires root access

Host and Nslookup

These two commands are the DNS Lookup tool

When the host is executed, it lists all the IP addresses of a domain name; nslookup is a host-like command that is used to query DNS-related details and name resolution.

Here is the IP address of the www.baidu.com on the blogger's computer:

650) this.width=650; "title=" "src=" http://www.linuxprobe.com/wp-content/uploads/2017/03/ Wkiom1jtzm6bvc7baaekwwpkfoy612.jpg the use of 4 network-related commands in the "alt=" Shell "border=" 0 "style=" height:auto; "/>

Route

The operating system maintains a table called the routing table, which contains information about how the packet is forwarded and which nodes are forwarded through the network, and the following methods can be used to display the routing table

650) this.width=650; "title=" "src=" http://www.linuxprobe.com/wp-content/uploads/2017/03/ Wkiol1jtznui5e5laaakfnchy7i787.png the use of 4 network-related commands in the "alt=" Shell "border=" 0 "style=" height:auto; "/>

-n Specifies that the address is displayed numerically.

As shown below:

650) this.width=650; "title=" "src=" http://www.linuxprobe.com/wp-content/uploads/2017/03/ Wkiom1jtzoatybpdaacs7mgaz10425.jpg the use of 4 network-related commands in the "alt=" Shell "border=" 0 "style=" height:auto; "/>

Traceroute

This command displays all gateway addresses for the packet path. Traceroute information can help us figure out how many hops a packet will take to reach its destination. The number of Midway gateways or routers gives a measure of the direct distance of two nodes on the network.

Again, let's look at the following:

Here, Bo Master Query www.baidu.com packet forwarding information:

650) this.width=650; "title=" "src=" http://www.linuxprobe.com/wp-content/uploads/2017/03/ Wkiol1jtzpkxpv-uaaeqvpmvgqk646.jpg the use of 4 network-related commands in the "alt=" Shell "border=" 0 "style=" height:auto; "/>

This shows that the arrival of Baidu needs to pass 12 jump.

Original address:http://www.linuxprobe.com/shell-command.html

This article is from the "blog" blog, please be sure to keep this source http://coderhsf.blog.51cto.com/12629645/1920320

4 Key network commands in the shell

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.