Linux Network commands

Source: Internet
Author: User
Tags nslookup nslookup command traceroute command

1,ifconfig

The user can execute the ifconfig command to detect and set the local network interface. By default, this command displays the first NIC, the configuration information for eth0 and the native loop (lo,local loopback). If the user needs to detect or set up other network interfaces of this machine, simply specify the NIC code after the command.

The command can also turn the specified NIC on or off. For example, start the first NIC, turn off the first NIC, and use the ping command to verify that the NIC is set successfully. Execute command:
Ifconfig eth0 up
The command can also modify the subnet mask for the specified network card. For example, the first NIC (eth0) of this machine has its original subnet mask of "255.255.0.0", and the updated subnet mask is "255.255.255.0". Use the ifconfig eth0 command to detect. Execute command:
Ifconfig eth0 255.255.255.0

2,netconfig

Users can usually in two stages of the local Linux host network card installation settings, the first phase of the installation of the Linux operating system network card configuration, according to its installation interface can be divided into graphical installation and character installation of two kinds The second stage is the network card configuration that was made when you missed the opportunity to install the NIC in the first phase or when the NIC settings changed.

3,ping

The user can perform a ping command to detect whether the transmission channel between the two hosts is unblocked, or if the remote host is normal. This command determines the current state of the network by sending the Echo_request packet in the ICMP (Internet Control Message Protocol) to the specified remote host by responding to the information.
1. Ping pensive address or localhost

2. Ping the native IP address or host name

3. Ping the LAN gateway or other hosts within the LAN

4. Ping the gateway on the external network or other hosts on the external network

5,lokkit

Lokkit command to Firewall settings
If the user misses the opportunity to install the firewall in the first phase or if its firewall settings change, the user can execute the lokkit command to configure the firewall.
6,traceroute

The user can execute the traceroute command to detect which routers are in transit and how long they are delayed when the computer is connected to another host. This command has many similarities to the ping command and is a way to debug the network. However, the result of the ping command can only tell the user that the host can connect, and the traceroute command not only tells the user what the ping command can provide, but also the process of sending the packet and detecting the congestion of the network.

7,mtr

The user can execute the MTR command to complete detection similar to the ping command and the traceroute command. It will continue to send packets to all routers in the local to the destination host and dynamically update their results.

8,host/nslookup

A user can execute the host/nslookup command to query the IP address of a known host by its domain name, or to query the domain name of a known host by its IP address. The nslookup command, in addition to listing the results queried by the host command, also shows which domain name servers have been passed through the query task.

Host Www.sina.com

Nslookup www.sina.com

9,netstat

The user can execute the netstat command to display the current network service condition for the entire system. For example, the detection of native network services.
Netstat-a

10,tcpdump

The user can execute the tcpdump command to detect the data traffic status of the network on which the machine resides. For example, detecting the data traffic status of a native network. Execute command:

11,route

The user can execute the route command to display the contents of the current native routing table, and can also perform actions such as adding, deleting, or modifying the records in the routing table.

For example, display the contents of the routing table in this computer. Execute command:
Route


The command can also add or remove the specified records from the routing table. For example, add a record to the routing table. Execute command:
Route add-net 10.20.1.0 netmask 255.255.0.0 Dev eth0

Deletes a record from the routing table. Execute command:
Route del-net 10.20.1.0 netmask 255.255.0.0 Dev eth0

The command can also add or remove the default gateway from the routing table. For example, add a default gateway to the routing table. Execute command:
Route add default GW Xinxi

Removes a default gateway from the routing table. Execute command:
Route del default GW Xinxi

12,rlogin

The user can execute the rlogin command, enter the IP address of the network host on the local host, and through the user account of the host and its password authentication, to achieve the remote Linux system host login.

13,telnet

The user can perform Telnet command, enter the IP address of the network host on the local host, and through the user account of the host and its password authentication, to achieve the remote Linux system host login. Unlike the Rlogin command, users can log on to a remote Linux system host on a Windows 95/98/2000 system host, in addition to being able to log on to a Linux system host. It is important to note that the system does not allow users to log in as root user account for system security reasons.

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.