View Linux Server network status

Source: Internet
Author: User
Tags get ip

Reprinted from Http://blog.chinaunix.net/uid-26413552-id-3202366.html

View Linux Server network status

Ifconfig

Used to display details of all network interfaces, such as: IP address, subnet mask, and so on.

The ETHX is the name of the Ethernet network card.

Configuration file in/etc/sysconfig/network-scripts/ifcfg-eth0

Device= "Eth0"

Hwaddr= "00:0c:29:68:c0:8c"

Nm_controlled= "Yes"

onboot= "Yes" set to Yes will start the network card when the boot, no for the machine does not start the network card

Bootproto=dhcp DHCP set to dynamic get Ip,static is set to static get IP

#IPADDR =192.168.1.5 Set IP address

#GATEWAY =192.168.1.1 setting up the Gateway

#NETMASK =255.255.255.0 Set Subnet mask

When you manually secure the IP, ipaddr and netmask must write together.

Ping:

Used to check whether a host on the network is active or has failed. The principle is to use the ICMP protocol in the IP layer of the TCP/IP protocol to return the response from a particular host.

Echo 1 >/proc/sys/net/ipv4/icmp_echo_ignore_all If you want to disable ping

Netstat–an

Used to display network connections, routing tables, and network interface information.

Options:

A: Displays the status of all sockets.

N: Print the actual address, add this parameter speed is relatively good, memory consumption is small.

R: Prints the routing table.

The listen represents a connection request that listens for TCP ports from afar. In this figure, receive any port from any IP to connect to the 22 port on this machine.

Established represents an open connection condition.

In Linux, the port mechanism is that if a port is consumed by an external request, the system will automatically replicate a port identical to the original port to listen for the next external request.

Route

Used to view the routing table information for that system

Traceroute

The path that is used to track network packets, and the packet size defaults to 40 bytes. It is possible to know how many routes a packet will take to reach its destination.

Nslook

Used to query the IP address of a machine and the corresponding domain name

Lsof

Used primarily to view a specific port situation.

You can tell which programs are occupied by Port 22.

View Linux Server network status (RPM)

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.