Sy-linux下常用的网络命令linux network commands

linux下的网络命令非常强大,这里根据教材需要,列出来常用的网络命令和场景实例,供参考。

一、命令列表:

Command

Description

ip

Manipulating routing to assigning and configuring network parameters

traceroute

Identify the route taken by packets to reach the host

tracepath

Gets maximum transmission unit while tracing the path to the network host

ping

Often used to check the connectivity between the host and the server

ss

Gets details about network sockets

dig

Gives all the necessary information about the DNS name server

host

Prints IP address of a specific domain and viscera

hostname

Mostly used to print and change the hostname

curl

Transfers data over the network by supporting various protocols

mtr

A combination of ping and traceroute is used to diagnose the network

whois

Gets info about registered domains, IP addresses, name servers, and more

ifplugstatus

Detects the link status of a local Ethernet device

iftop

Monitors stats related to bandwidth

tcpdump

Packet sniffing and analyzing utility used to capture, analyze and filter network traffic

ethtool

Allows users to configure Ethernet devices

nmcli

Troubleshooting utility for network connections

nmap

Primarily used to audit network security

bmon

An open-source utility to monitor real-time bandwidth

firewalld

CLI tool to configure rules of Firewall

iperf

Utility to measure network performance and tuning

speedtest-cli

CLI utility of speedtest.net to check internet speeds

vnstat

Mostly used to monitor network traffic and bandwidth consumption

以上的命令都是在tcp/ip层之间操作。一些比较详细的需要研究对应的tcp/ip协议。

来自 <https://itsfoss.com/basic-linux-networking-commands/#essential-networking-commands-in-linux>

TCP/IP protocol stack vs the OSI reference model

二、包运行环境

请注意,并非所有的命令都会预先安装。Ubuntu/Centos的环境我事先都需要先安装了。对于其他发行版,请使用您的包管理器。

我这里适用了ubuntu、centos 和kali版本(未完全)做验证。分别对应的版本£§¤¥

其中ubuntu的版本和内核如下: £1

£2

Kali 的版本和内核如下:§1

§2

centos的版本和内核如下:¤1

三、工具包运行实例

Note: Both net-tools and iproute2 command are available on most Linux distributions. However, it is recommended to use iproute2 tools due to their flexibility and speed.

Although net-tools is deemed as outdated, it is still widely used by legacy scripts and configurations.

£1为例

1、主机信息相关的cmds

IP

ip [options] object [command]

root@testhost01:~# ip

Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }

       ip [ -force ] -batch filename

where  OBJECT := { address | addrlabel | amt | fou | help | ila | ioam | l2tp |

                   link | macsec | maddress | monitor | mptcp | mroute | mrule |

                   neighbor | neighbour | netconf | netns | nexthop | ntable |

                   ntbl | route | rule | sr | tap | tcpmetrics |

                   token | tunnel | tuntap | vrf | xfrm }

       OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |

                    -h[uman-readable] | -iec | -j[son] | -p[retty] |

                    -f[amily] { inet | inet6 | mpls | bridge | link } |

                    -4 | -6 | -M | -B | -0 |

                    -l[oops] { maximum-addr-flush-attempts } | -br[ief] |

                    -o[neline] | -t[imestamp] | -ts[hort] | -b[atch] [filename] |

                    -rc[vbuf] [size] | -n[etns] name | -N[umeric] | -a[ll] |

                    -c[olor]}

root@testhost01:~# ip -V

ip utility, iproute2-6.1.0, libbpf 1.2.2

root@testhost01:~#

ip addr [subcommand]

The available subcommands on the object are:

  • add - Adds a new address.
  • show - Shows protocol addresses.
  • del - Removes an address.
  • flush - Flushes addresses based on specified criteria.

root@testhost01:~# ip addr

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000

    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

    inet 127.0.0.1/8 scope host lo

       valid_lft forever preferred_lft forever

    inet6 ::1/128 scope host

       valid_lft forever preferred_lft forever

2: ens36: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000

    link/ether 00:0c:29:f9:aa:a7 brd ff:ff:ff:ff:ff:ff

    altname enp2s4

    inet 192.168.105.128/24 brd 192.168.105.255 scope global dynamic noprefixroute ens36

       valid_lft 1563sec preferred_lft 1563sec

    inet6 fe80::2662:4535:1059:ba10/64 scope link noprefixroute

       valid_lft forever preferred_lft forever

3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default

    link/ether 02:42:cc:2e:94:21 brd ff:ff:ff:ff:ff:ff

    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0

       valid_lft forever preferred_lft forever

root@testhost01:~# ip addr show ens36

2: ens36: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000

    link/ether 00:0c:29:f9:aa:a7 brd ff:ff:ff:ff:ff:ff

    altname enp2s4

    inet 192.168.105.128/24 brd 192.168.105.255 scope global dynamic noprefixroute ens36

       valid_lft 1423sec preferred_lft 1423sec

    inet6 fe80::2662:4535:1059:ba10/64 scope link noprefixroute

       valid_lft forever preferred_lft forever

root@testhost01:~#

ip monitor

ip link [subcommand] [options] [interfaces]

The subcommands enable the following actions:

  • show - Prints network interface information.
  • set - Changes or adds information to a network interface.
  • add - Adds a new network interface.
  • del - Deletes a network interface.

  把网卡禁用后,secCRT就不能登录了,中断了,如上图,这是需要直接进入vmware中

启动up网卡,如下图:

ip route [subcommand] [options] [destination]

The following actions are available as subcommands:

  • show - Shows the routing table.
  • add - Adds a new route to the table.
  • del - Deletes a route from the table.
  • change - Modifies an existing route.

root@testhost01:~# ip route show

default via 192.168.105.2 dev ens36 proto dhcp src 192.168.105.128 metric 100

169.254.0.0/16 dev ens36 scope link metric 1000

172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown

192.168.105.0/24 dev ens36 proto kernel scope link src 192.168.105.128 metric 100

root@testhost01:~#

Nslookup

nslookup <domainName>

root@testhost01:~# nslookup www.ygu.edu.cn

Server:         127.0.0.53

Address:        127.0.0.53#53

Non-authoritative answer:

Name:   www.ygu.edu.cn

Address: 42.247.25.1

Name:   www.ygu.edu.cn

Address: 2001:da8:e815:1::2

root@testhost01:~#

Dig

dig [options] [domain] [record type] [DNS server]

The components of the command are:

  • [options] - Parameters that modify the behavior of the command.
  • [domain] - The domain name to query.
  • [record type] - The DNS record type to query. Defaults to A records.
  • [DNS server] - A specified DNS server for the query.

All parameters are optional. The command shows the default DNS resolver information and query statistics without additional options.

root@testhost01:~# dig www.google.com

; <<>> DiG 9.18.18-0ubuntu2.1-Ubuntu <<>> www.google.com

;; global options: +cmd

;; Got answer:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 35752

;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:

; EDNS: version: 0, flags:; udp: 65494

;; QUESTION SECTION:

;www.google.com.                        IN      A

;; ANSWER SECTION:

www.google.com.         5       IN      A       172.217.26.68

;; Query time: 131 msec

;; SERVER: 127.0.0.53#53(127.0.0.53) (UDP)

;; WHEN: Fri Apr 12 09:49:23 CST 2024

;; MSG SIZE  rcvd: 59

root@testhost01:~# dig -x 8.8.4.4

; <<>> DiG 9.18.18-0ubuntu2.1-Ubuntu <<>> -x 8.8.4.4

;; global options: +cmd

;; Got answer:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 54054

;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:

; EDNS: version: 0, flags:; udp: 65494

;; QUESTION SECTION:

;4.4.8.8.in-addr.arpa.          IN      PTR

;; ANSWER SECTION:

4.4.8.8.in-addr.arpa.   5       IN      PTR     dns.google.

;; Query time: 131 msec

;; SERVER: 127.0.0.53#53(127.0.0.53) (UDP)

;; WHEN: Fri Apr 12 09:49:35 CST 2024

;; MSG SIZE  rcvd: 73

root@testhost01:~#

Ping

ping [options] [hostname/IP]

ping -c 5 google.com

Uname

Host

host [options] [hostname/IP]

The various [options] control the command's behavior, such as the query type or the start of authority (SOA) for the provided domain.

root@testhost01:~# host www.baidu.com

www.baidu.com is an alias for www.a.shifen.com.

www.a.shifen.com has address 157.148.69.80

www.a.shifen.com has address 157.148.69.74

www.a.shifen.com has IPv6 address 2408:8756:c52:1107:0:ff:b035:844b

www.a.shifen.com has IPv6 address 2408:8756:c52:1aec:0:ff:b013:5a11

root@testhost01:~# host aliyun.com

aliyun.com has address 106.11.248.146

aliyun.com has address 106.11.249.99

aliyun.com has address 106.11.172.9

aliyun.com has address 140.205.135.3

aliyun.com has address 106.11.253.83

aliyun.com has address 140.205.60.46

aliyun.com has IPv6 address 2401:b180:1:60::6

aliyun.com has IPv6 address 2401:b180:1:60::5

aliyun.com mail is handled by 10 mx2.mail.aliyun.com.

Ifconfig

ifconfig [interface] [options]

root@testhost01:~# ifconfig -s

Iface      MTU    RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg

docker0          1500        0      0      0 0             0      0      0      0 BMU

ens36            1500   253964      0      0 0         48211      0      0      0 BMRU

lo              65536    18559      0      0 0         18559      0      0      0 LRU

root@testhost01:~# ifconfig -a

docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500

        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255

        ether 02:42:cc:2e:94:21  txqueuelen 0  (Ethernet)

        RX packets 0  bytes 0 (0.0 B)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 0  bytes 0 (0.0 B)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ens36: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

        inet 192.168.105.128  netmask 255.255.255.0  broadcast 192.168.105.255

        inet6 fe80::2662:4535:1059:ba10  prefixlen 64  scopeid 0x20<link>

        ether 00:0c:29:f9:aa:a7  txqueuelen 1000  (Ethernet)

        RX packets 253989  bytes 328717030 (328.7 MB)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 48227  bytes 5320298 (5.3 MB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536

        inet 127.0.0.1  netmask 255.0.0.0

        inet6 ::1  prefixlen 128  scopeid 0x10<host>

        loop  txqueuelen 1000  (Local Loopback)

        RX packets 18559  bytes 2505591 (2.5 MB)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 18559  bytes 2505591 (2.5 MB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

root@testhost01:~#

Nslookup  

nslookup [domain] [DNS server]

root@testhost01:~# nslookup ygu.edu.cn

Server:         127.0.0.53

Address:        127.0.0.53#53

Name:   ygu.edu.cn

Address: 127.0.0.1

root@testhost01:~# nslookup www.163.com

Server:         127.0.0.53

Address:        127.0.0.53#53

Name:   www.163.com

Address: 192.168.52.130

root@testhost01:~#

2、网络连接相关cmds

Scp

选项非常多,简单的如下:

scp [OPTION] [user@]SRC_HOST:]file1 [user@]DEST_HOST:]file2

1、从本地拷贝到远程:

 scp local_file remote_username@remote_ip:remote_folder或者

 scp local_file remote_username@remote_ip:remote_file或者

 scp local_file remote_ip:remote_folder或者

 scp local_file remote_ip:remote_file

如果复制目录,需要-r参数:scp -r

2、从远程拷贝到本地:

只要把本地复制到远程的命令的后面2个参数调换顺序即可。

若远程防火墙有为scp指定了端口号,需要使用-p参数:scp -p

 比如scp命令使用端口号6389:scp -p 6389

注意:使用scp命令要确保使用的用户具有远程服务器文件对应的权限,否则无法起作用。

Rsync

1、同步本地不同路径下的两个目录

 rsync -zvr  /dir1  /dir2/dir3/

-z 启用压缩

-v 输出详细信息

-r 表示递归

如上结果显示,两个同步的目录下的文件的时间戳不一致的!

2、使用-a选项表示存档模式。

-a选项递归同步、保留符号链接、保留权限、保留时间戳、保留所有者和组。

这里时间戳就一致了。

3、将文件在本地目录和远程目录之间的同步

rsync允许在本地和远程系统之间同步文件/目录,前提是本地和远程系统都要安装rsync才行。

执行以下命令完成文件从远程目录同步到本地:

 rsync -avz root@192.168.105.130:~/test130dir /root/test128dir/

执行以下命令,实现文件从本地目录同步到远程目录

Ss  

ss [options] [filter]

使用ss -lt列车所有tcp的sockets 

root@testhost01:~# ss -lt

State     Recv-Q    Send-Q       Local Address:Port                Peer Address:Port   Process   

LISTEN    0         511                0.0.0.0:http                     0.0.0.0:*                

LISTEN    0         4096         127.0.0.53%lo:domain                   0.0.0.0:*                

LISTEN    0         4096             127.0.0.1:41575                    0.0.0.0:*                

LISTEN    0         4096             127.0.0.1:ipp                      0.0.0.0:*                

LISTEN    0         4096            127.0.0.54:domain                   0.0.0.0:*                

LISTEN    0         511                   [::]:http                        [::]:*                

LISTEN    0         2                    [::1]:3350                        [::]:*                

LISTEN    0         4096                     *:ssh                            *:*                

LISTEN    0         2                        *:ms-wbt-server                  *:*                

LISTEN    0         4096                 [::1]:ipp                         [::]:*                

root@testhost01:~#

使用-lu或者-au列出UDP端口信息:

root@testhost01:~# ss -au

State  Recv-Q  Send-Q           Local Address:Port        Peer Address:Port   Process

UNCONN 0       0                      0.0.0.0:mdns             0.0.0.0:*             

UNCONN 0       0                      0.0.0.0:55534            0.0.0.0:*             

UNCONN 0       0                   127.0.0.54:domain           0.0.0.0:*             

UNCONN 0       0                127.0.0.53%lo:domain           0.0.0.0:*             

ESTAB  0       0        192.168.105.128%ens36:bootpc   192.168.105.254:bootps        

UNCONN 0       0                         [::]:mdns                [::]:*             

UNCONN 0       0                         [::]:48070               [::]:*             

root@testhost01:~# ss -lu

State    Recv-Q   Send-Q     Local Address:Port         Peer Address:Port   Process  

UNCONN   0        0                0.0.0.0:mdns              0.0.0.0:*               

UNCONN   0        0                0.0.0.0:55534             0.0.0.0:*               

UNCONN   0        0             127.0.0.54:domain            0.0.0.0:*               

UNCONN   0        0          127.0.0.53%lo:domain            0.0.0.0:*               

UNCONN   0        0                   [::]:mdns                 [::]:*               

UNCONN   0        0                   [::]:48070                [::]:*               

root@testhost01:~#

Route

route [options] [subcommand] [arguments]

It contains the following components:

  • [options] - Optional command-line parameters that control the output view, address family, and IP protocol.
  • [subcommand] - An action to perform, such as add or delete.
  • [arguments] - Additional arguments that differ depending on the subcommand.

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

default         bogon           0.0.0.0         UG    100    0        0 ens36

link-local      0.0.0.0         255.255.0.0     U     1000   0        0 ens36

172.17.0.0      0.0.0.0         255.255.0.0     U     0      0        0 docker0

192.168.105.0   0.0.0.0         255.255.255.0   U     100    0        0 ens36

添加默认网关命令:sudo route add default gw [gateway]

3、网络监控相关cmds

Netstat 

netstat [options]

使用-at参数列出所有TCP  port

netstat -at        #查看当前已经建立的tcp连接
netstat -au       #列出所有 udp 端口
netstat -lt         #只列出所有监听中的 tcp类型的 端口
netstat -lu         #只列出所有监听中的 udp类型的端口
netstat -antp     #查看所有已经建立的tcp连接,并且域名以数字形式显示
netstat -tupl      #查看所有监听的tcp和udp及进程名信息(udp不能监听,但可以查看是否在占用)
netstat -s           #显示所有端口的统计信息
netstat -st 或 -su   #显示 TCP 或 UDP 端口的统计信息
netstat -i           #查看网卡接口信息
netstat -tulnp |grep nginx   #查看nginx服务的网络信息

Netcat

Tcpdump

tcpdump命令是一个数据包嗅探器和网络安全工具,用于捕获实时网络数据包信息。使用命令可以分析流量、排除问题和监视网络安全。

tcpdump [options] [filter]

tcpdump port 80 

过滤器port 80捕获指定端口上的数据包以监视HTTP流量

还可以在命令中指定协议(TCP、UDP、TCP和其他),如下指令:

 tcpdump -i <network_device> tcp

To specify the port, use the command,要指定端口,请使用如下指令:

 tcpdump -i <network_device> port 22

tcpdump命令将继续执行并发送数据包,除非被取消。因此,您可以指定要捕获的事件数量以控制连续执行。

 tcpdump -c 20 -i <network_device>

您还可以使用标记src或dst指定要从中捕获的IP。指令:

 tcpdump -c 20 -i <network_device> src XXX.XXX.XXX.XXX

比如我在另外一台机器ping本机,然后捕获:

最后可以将即时捕获的网络流量保存到一个文件中,供以后使用。更多参数:

-a  将网络地址和广播地址转变成名字
-d  将匹配信息包的代码以人们能够理解的汇编格式给出
-dd  将匹配信息包的代码以c语言程序段的格式给出
-ddd 将匹配信息包的代码以十进制的形式给出
-D   显示所有可用网络接口的列表
-e  在输出行打印出数据链路层的头部信息
-f  将外部的Internet地址以数字的形式打印出来
-l  使标准输出变为缓冲行形式
-L   列出指定网络接口所支持的数据链路层的类型后退出
-n  不把网络地址转换成名字,即不做反向域名解析
-q   简洁地打印输出。即打印很少的协议相关信息, 从而输出行都比较简短
-t   在每行的输出中不输出时间
-tt  在每行的输出中会输出时间戳
-ttt 输出每两行打印的时间间隔(以毫秒为单位)
-tttt 在每行打印的时间戳之前添加日期的打印(此种选项,输出的时间最直观)

-v   产生详细的输出. 比如包的TTL,id标识,数据包长度,以及IP包的一些选项。同时它还会打开一些附加的包完整性检测,比如对IP或ICMP包头部的校验和。
-vv  产生比-v更详细的输出. 比如NFS回应包中的附加域将会被打印, SMB数据包也会被完全解码。
-vvv 产生比-vv更详细的输出。比如 telent 时所使用的SB, SE 选项将会被打印, 如果telnet同时使用的是图形界面,其相应的图形选项将会以16进制的方式打印出来
-c  在收到指定的包的数目后,tcpdump就会停止
-F  从指定的文件中读取表达式,忽略其它的表达式
-i  指定监听的网络接口
-r  从指定的文件中读取包(这些包一般通过-w选项产生)
-w  直接将数据报写入文件中,并不分析和打印出来
-T  将监听到的包直接解释为指定的类型的报文,常见的类型有rpc (远程过程调用)和snmp(简单 网络管理协议)
-s   tcpdump 默认只会截取前 `96` 字节的内容,要想截取所有的报文内容,可以使用 `-s number`, `number` 就是你要截取的报文字节数,如果是 0 的话,表示截取报文全部内容。
-S  seq ack 使用绝对序列号,而不是相对序列号
-Z  后接用户名,在抓包时会受到权限的限制。如果以root用户启动tcpdump,tcpdump将会有超级用户权限

Traceroute

traceroute [options] [hostname/IP]

-T使用tcp协议追踪 

root@testhost01:~# traceroute -T 8.8.4.4

traceroute to 8.8.4.4 (8.8.4.4), 30 hops max, 60 byte packets

 1  _gateway (192.168.105.2)  0.203 ms  0.099 ms *

 2  dns.google (8.8.4.4)  128.577 ms  128.472 ms  128.370 ms

root@testhost01:~# traceroute -T 114.114.114.114

traceroute to 114.114.114.114 (114.114.114.114), 30 hops max, 60 byte packets

 1  _gateway (192.168.105.2)  0.164 ms  0.134 ms *

 2  public1.114dns.com (114.114.114.114)  129.930 ms  129.768 ms  129.656 ms

root@testhost01:~#

Iftop

iftop命令是一个网络监视实用程序。使用命令可真实的查看网络连接和带宽使用情况。

iftop [options]

先使用字符浏览器工具浏览qq的网站:W3m www.qq.com 

然后查看流量

Tracepath 

tracepath [options] [hostname/IP]

Mtr 

mtr命令(my traceroute)是一个诊断工具,它结合了ping和traceroute命令中的元素。该命令发送对网络质量的实时洞察,使其成为解决高延迟和数据包丢失问题的绝佳工具。

mtr [options] [hostname/IP]

不带任何参数的mtr命令启动到所提供主机的跟踪会话,如:

mtr aliyun.com

To exit the window, press q.

Nmap  (这个有必要单独列一个章节深究)

nmap is a network scanning tool for network exploration and security auditing. It allows you to discover hosts on a network, identify open ports, gather information about services running on those ports, and even detect security vulnerabilities.

  • Syntax: nmap [scan type(s)] [options] [target spec]
  • Useful options: -sS(TCP SYN scan), -sU(UDP scan), -O(OS detection), -p(port range), and -v(verbose output).
  • Command: Perform a basic TCP SYN scan on a target host.

4、其他方面cmds

Curl or wget 

wget [options] [URL]

curl [options] [URL]

To download a file using the wget command, use the following format:

使用wget下载文件命令如下:

wget -O [file name] [URL]

Alternatively, to use curl to achieve the same task, run:

或者,要使用curl来实现相同的任务,请运行:

curl -o [file name] [URL]

The file downloads from the specified URL and saves the contents to the provided file name.

文件从指定的URL下载并将内容保存到提供的文件名。

Whois

whois [options] [query]

五、linux下一些troubleshooting的技巧

Troubleshooting Network Issues

在本节中,我们将探讨解决Linux中常见网络问题的策略和技术。

诊断连接问题

当在建立和维护系统之间的网络连接时遇到问题或困难时,请尝试执行以下步骤:

  • 检查物理连接。
  • 使用ifconfig命令检查网络接口状态。
  • 使用traceroute命令测试IP连接。
  • 使用ip命令确保正确的IP配置。
  • 使用tcpdump捕获数据包并检查异常报头。

DNS相关问题

DNS(域名系统)相关问题是DNS基础设施遇到的问题。要解决DNS问题,请执行以下步骤:

  • 在/etc/resolv.conf中确认DNS服务器设置。
  • 使用dig测试DNS解析。
  • 必要时清除DNS缓存。

防火墙配置

防火墙配置是指在防火墙内实施的设置和规则,用于控制和管理网络流量。要解决防火墙问题,请执行以下步骤:

  • 验证防火墙服务的状态(iptables)。
  • 使用iptables -L命令查看防火墙规则。
  • 通过临时禁用防火墙或添加特定规则来测试流量。

最后,常见的网络错误,如“目标主机无法到达”或“连接拒绝”,需要检查IP配置,服务可用性和路由表。

通过遵循这些故障排除策略并利用适当的命令和工具,您可以有效地诊断和解决网络问题。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/550410.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

【Java】通过poi给word首页添加水印图片

背景&#xff1a; poi并没有提供直接插入水印图片的方法&#xff0c;目前需要再word的首页插入一张水印图片&#xff0c;于是就需要通过另一种方式&#xff0c;插入透明图片&#xff08;png格式&#xff09;并将图片设置为“浮于文字上方”的方式实现该需求。 所需jar&#xf…

Linux解压4GB以上zip文件

Linux使用unzip解压大于4GB文件&#xff0c;会出现以下错误&#xff1a; 解决方法 安装p7zip yum -y install p7zip执行命令&#xff1a; 7za x MSRVTT.zip

Spark-机器学习(2)特征工程之特征提取

在之前的文章中&#xff0c;我们了解我们的机器学习&#xff0c;了解我们spark机器学习中的MLIib算法库&#xff0c;知道它大概的模型&#xff0c;熟悉并认识它。想了解的朋友可以查看这篇文章。同时&#xff0c;希望我的文章能帮助到你&#xff0c;如果觉得我的文章写的不错&a…

HackMyVM-Connection

目录 信息收集 arp nmap WEB web信息收集 dirsearch smbclient put shell 提权 系统信息收集 suid gdb提权 信息收集 arp ┌─[rootparrot]─[~/HackMyVM] └──╼ #arp-scan -l Interface: enp0s3, type: EN10MB, MAC: 08:00:27:16:3d:f8, IPv4: 192.168.9.115 S…

js打印页面源码 ,打印选取的容器里的内容,打印指定内容

js打印页面源码 &#xff0c;打印选取的容器里的内容&#xff0c;打印指定内容 效果 代码 <!DOCTYPE html> <html lang"en"> <head><meta charset"UTF-8"><meta http-equiv"X-UA-Compatible" content"IEedge&…

FreeRTOS时间管理

FreeRTOS时间管理 主要要了解延时函数&#xff1a; 相对延时&#xff1a;指每次延时都是从执行函数vTaskDelay()开始&#xff0c;直到延时指定的时间结束。 绝对延时&#xff1a;指将整个任务的运行周期看成一个整体&#xff0c;适用于需要按照一定频率运行的任务。 函数 vTa…

PTA图论的搜索题

目录 7-1 列出连通集 题目 输入格式: 输出格式: 输入样例: 输出样例: AC代码 7-2 六度空间 题目 输入格式: 输出格式: 输入样例: 输出样例: 思路 AC代码 7-3 地下迷宫探索 题目 输入格式: 输出格式: 输入样例1: 输出样例1: 输入样例2: 输出样例2: 思路 …

MySQL 试图

视图功能在 5.0 以后的版本启用 视图是一张虚表。数据表确实包含了具体数据并且保存到硬盘中的实表。视图使用数据检索语句动态生 成的一张虚表。每一次数据服务重启或者系统重启之后&#xff0c;在数据库服务启动期间&#xff0c;会使用创建视图的语 句重新生成视图中的数据&…

这家物流装备公司突破天际:销售额飙升至10亿美元,引领仓储机器人革命!...

导语 大家好&#xff0c;我是智能仓储物流技术研习社的社长&#xff0c;老K。专注分享智能仓储物流技术、智能制造等内容。 新书《智能物流系统构成与技术实践》 法国的Exotec公司在仓储自动化领域取得了显著成就&#xff0c;其销售额已超过10亿美元&#xff0c;成为全球物料搬…

考研数学|《1800》《1000》《660》《880》如何搭配❓

这几本书都是不同阶段对应的习题册 我觉得最舒服的使用就是方式就是基础阶段用《1800题基础部分》然后强化阶段主要刷《880题》并且强化阶段带着刷《660题》 上面是我的使用方式。之所以没有刷《1000题》是因为这本习题册的难度对我来说还是太大了&#xff0c;并且计算量很大…

上海计算机学会 2023年10月月赛 乙组T3 树的连通子图(树、树形dp)

第三题&#xff1a;T3树的连通子图 标签&#xff1a;树、树形 d p dp dp题意&#xff1a;给定一棵 n n n个结点的树&#xff0c; 1 1 1号点为这棵树的根。计算这棵树连通子图的个数&#xff0c;答案对 1 , 000 , 000 , 007 1,000,000,007 1,000,000,007取余数。题解&#xff1…

HTML内联框架

前言&#xff1a; 我们有时候打开网页时会有广告窗的出现&#xff0c;而这些窗口并不是来自于本站的&#xff0c;而是来自于外部网页&#xff0c;只是被引用到了自己网页中而已。这一种技术可以通过内联来实现。 标签介绍&#xff1a; HTML 内联框架元素 (<iframe>) 表示…

基于Springboot的影城管理系统

基于SpringbootVue的影城管理系统的设计与实现 开发语言&#xff1a;Java数据库&#xff1a;MySQL技术&#xff1a;SpringbootMybatis工具&#xff1a;IDEA、Maven、Navicat 系统展示 用户登录 首页展示 电影信息 电影资讯 后台登录页 后台首页 用户管理 电影类型管理 放映…

RAG (Retrieval Augmented Generation) 结合 LlamaIndex、Elasticsearch 和 Mistral

作者&#xff1a;Srikanth Manvi 在这篇文章中&#xff0c;我们将讨论如何使用 RAG 技术&#xff08;检索增强生成&#xff09;和 Elasticsearch 作为向量数据库来实现问答体验。我们将使用 LlamaIndex 和本地运行的 Mistral LLM。 在开始之前&#xff0c;我们将先了解一些术…

vue3 生命周期(生命周期钩子 vs 生命周期选项 vs 缓存实例的生命周期)

vue3 支持两种风格书写&#xff1a;选项式 API 和组合式 API 若采用组合式 API &#xff0c;则使用生命周期钩子若采用选项式 API &#xff0c;则使用生命周期选项两者选用一种即可&#xff0c;不建议同时使用&#xff0c;避免逻辑紊乱。 生命周期钩子 在 setup 中使用 onBefo…

Vue 阶段练习:记事本

将 Vue快速入门 和 Vue 指令的学习成果应用到实际场景中&#xff08;如该练习 记事本&#xff09;&#xff0c;我们能够解决实际问题并提升对 Vue 的技能掌握。 目录 功能展示 需求分析 我的代码 案例代码 知识点总结 功能展示 需求分析 列表渲染删除功能添加功能底部统计…

3D目标检测实用技巧(二)- 实现点云(or 体素)向图像平面的投影并可视化

一、引言 受Focals Conv的启发&#xff0c;该论文中通过将点云投影到图片中清晰展现出点云学习后的情况&#xff1a; 本次实现的是体素向图像投影并显示&#xff0c;实现出来的效果如下&#xff1a; 二、 实现细节 1、体素投影到图像坐标系 这里我们参考的是VirConv的投影函…

通过matlab分别对比PSO,反向学习PSO,多策略改进反向学习PSO三种优化算法

目录 1.程序功能描述 2.测试软件版本以及运行结果展示 3.核心程序 4.本算法原理 4.1 粒子群优化算法 (PSO) 4.2 反向学习粒子群优化算法 (OPSO) 4.3 多策略改进反向学习粒子群优化算法 (MSO-PSO) 5.完整程序 1.程序功能描述 分别对比PSO,反向学习PSO,多策略改进反向学…

百货商场用户画像描绘与价值分析

目录 内容概述数据说明实现目标技术点主要内容导入模块1.项目背景1.1 项目背景与挖掘目标 2.数据探索与预处理2.1 结合业务对数据进行探索并进行预处理2.2 将会员信息表和销售流水表关联与合并 3 统计分析3.1 分析会员的年龄构成、男女比例等基本信息3.2 分析会员的总订单占比&…

Python 入门指南(四)

原文&#xff1a;zh.annas-archive.org/md5/97bc15629f1b51a0671040c56db61b92 译者&#xff1a;飞龙 协议&#xff1a;CC BY-NC-SA 4.0 第十章&#xff1a;哈希和符号表 我们之前看过列表&#xff0c;其中项目按顺序存储并通过索引号访问。索引号对计算机来说很有效。它们是整…
最新文章