Linux Network commands

Source: Internet
Author: User

ifconfig Command: View and configure network status commands

Ifdown network card device name : Disable the NIC device
ifup network card device name : Enable the NIC device

netstat options : Querying network status
Option:-T: List TCP protocol ports
-U: List UDP protocol ports
-N: Do not use domain name and service name, but use IP address and port number
-L: List only in the Listening State Network Service
-A: List all network connections
Note: These parameters can be used in conjunction, such as NETSTAT-TULN//querying the computer to open the port service or Netstat-an//To see who is connected to my server

route-n : View the list of routes (you can see the gateway)
Route add default GW 192.168.1.1: Set temporary gateway 192.168.1.1

Service Network Restart : Restart Network Service

nslookup host or IP : domain name and IP address resolution

Ping Host domain name or IP: Test the network condition of the specified IP or domain name
For example, Ping 115.159.66.51 will ping all the time in a Linux environment, but will only ping four times in the Windows environment
Ping xiongchao.net.cn When the ping is the domain name, will first resolve the domain name of the IP, and then the way the IP will continue to ping, note: In the case of the host allows Ping Ping, the host can prohibit ping
Note: You can set the number of pings in a Linux environment, such as: Ping 115.159.66.51-c 3 so that only ping3 times

traceroute Host domain name or IP: route tracking Command
The difference between traceroute and Ping:
Traceroute and Ping are sending ICMP packets, the difference is that the ICMP packets sent by Traceroute are not returned, the TTL is increasing, the ICMP packets sent by Ping must have a return packet, the TTL will not change

telnet domain name or IP [port] : Remote management and Port test command
For example: Telnet 115.159.66.51//remote management 115.159.66.51
Telnet 115.159.66.51 3306//Detect 115.159.66.51 3306 port if "common" is turned on
NOTE: If remote management, Telnet is an unencrypted protocol, SSH is an encrypted protocol, the general choice is ssh. So the usual use of Telnet is to test whether the port is turned on (if the port is not detected, it is possible that the firewall is blocking the port)

wget URL address : Download command
Example: wget http://soft.vpser.net/lnmp/lnmp1.1-full.tar.gz

tcpdump-i eth0-nnx Port : Grab Package Command
Option:-i specifies the NIC interface
-nn the domain name and service in the packet to IP and port
-X Display packet contents in 16 binary and ASCII code
PORT specifies the ports to listen on

Linux Network commands

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.