Linux Security Basics: network configuration commands and linux basic configuration commands

Source: Internet
Author: User
Tags nslookup nslookup command

Linux Security Basics: network configuration commands and linux basic configuration commands

1. ifconfig view and configure network interface information
(1) set an IP address
Ifconfig eth0 192.168.0.1
(2) temporarily disable or enable the NIC
Ifconfig eth0 down
Ifconfig eth0 up
(3) set the subnet mask
Ifconfig eth0 netmask 255.255.255.0
(4) view the status of the first ENI
Ifconfig eth0

2. Manage route tables and set static routes
Add a route table entry
Del deletes a route table entry.
-C: displays the route Cache Information in the kernel.
-F: displays the routing FIB route 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-

Show only the listening port: netstat-l

List all tcp listening ports: netstat-lt

The output shows the PID and process name: netstat-p.

 

4. nslookup command

The nslookup command is used to query the IP address of a machine and its corresponding domain name. It usually requires a Domain Name Server to provide domain name services.

Usage: nslookup [IP Address/domain name]

 

5. host Command

The host command has the same functions as nslookup. Query the Host IP address or the host name based on the host IP address.
Usage: host [Option] [IP Address/Domain Name/host name]

Common parameters:-a: displays information about the queried domain name, IP address, domain name, or host name.

 

6. finger command

The finger command is used to query user information.

Parameters:

-L: multi-line display

-S: Single Row display

Lists information about the current logon User: finger-l

 

7. ping Command

The ping command is used to check whether hosts on the network are working. It sends data packets to the host to determine whether the host is alive.

Usage: ping An IP Address

 

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.