Linux Security essentials: Network Configuration commands

Source: Internet
Author: User
Tags domain name server nslookup nslookup command security essentials

1.ifconfig Viewing and configuring network interface information
(1) Set IP address
Ifconfig eth0 192.168.0.1
(2) Temporarily turn off or enable the NIC
Ifconfig eth0 Down
Ifconfig eth0 up
(3) Set subnet mask
Ifconfig eth0 netmask 255.255.255.0
(4) View the status of the first NIC
Ifconfig eth0

2.route Manage routing tables, set up static routes
Add adds a route table entry
Del Deletes a route table entry
-C Display Kernel middle cache information
-F Show Route fib routing table
(1) Add a route table entry
Route add-net 192.168.0.0 netmask 255.255.255.0 Dev eth0
(2) Add a default route
Route add 0.0.0.0 GW
(3) Delete the default route
Route del 0.0.0.0 GW

3.netstat command
List all UDP ports: Netstat-au

List all TCP ports: Netstat-at

Show only listening ports: netstat-l

List all ports listening on TCP: NETSTAT-LT

PID and process name shown in output: netstat-p

4.nslookup command

The function of the nslookup command is to query the IP address of a machine and its corresponding domain name. It usually requires a domain name server to provide the domain name service.

Usage: NSLOOKUP[IP address/Domain name]

5.host command

The function of the host command is basically the same as Nslookup. The root hostname queries the host's IP address or queries the hostname based on the host IP address.
Usage: host [options] [IP address/domain name/host name]

Common parameters are-a: Displays information about the domain name or IP address, domain name, or hostname you are looking for.

6.finger command

The function of the finger command is to query the user for information.

Parameters:

-L: Multi-line display

-S: Single-line display

Lists information about the currently logged on user: Finger-l

7.ping command

The ping command is used to see if a host on the network is working. It sends a packet to the host to determine if the host is alive.

Usage: Ping IP address

Linux Security essentials: Network Configuration 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.