Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Basic configuration of Linux network

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Basic commands for network configuration

1 use the ifconfig command to view the network interface address

2 hostname change hostname

3 use the route/netstat-r command to view routing table entries

4 use the netstat command to check the network connection

Common option

-a displays all active network connection information in the current host

-n display relevant host address, port and other information in digital form

-r displays routing table information

-l displays network connections and port information in the listening state

-t view information related to the tcp protocol

-u displays information related to udp protocol

-p displays the process number and process name information associated with the network connection

In general, when viewing utp and tcp protocols, to show the completeness, use it with the option anp

5 use the ping command to test network connectivity

Format: ping [option] destination host

Unlike the windows system, using the ping command in the Linux system will constantly send packets to the target host, which is equivalent to adding-t to the ping command of the windows system. It must be forcibly terminated using CTRL+C, and the packet life cycle is the same as the windows system, the packet life cycle is 64.

6 use the traceroute command to trace the routing path of the packet

Format: traceroute+ destination address ip, this command tests which network nodes have passed from the current host to the destination host, and displays the connection status of an intermediate node to test for network failure

7 use the nslookup command to test DNS domain name resolution

This command resolves the domain name to an ip address

Format: nslookup destination host address [DNS server address]

8 set network parameters

(1) change the address of the network card

Temporary configuration will not be changed permanently, but will be restored after restart, using the command ifconfig

Fixed configuration means access to profile changes

Command: vim / etc/sysconfig/network-scripts/ifcfg- Nic name

(2) disable and enable the network card

Ifconfig network interface up

Ifconfig network interface down

(3) set virtual network interface

Set up a virtual network interface, that is, a network card with multiple ip addresses, and you can access this server through the configured ip address.

Format: ifconfig API name: serial number ip address

9 set routing record route

(1) specify the network segment

(2) default gateway

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report