Linux收发包工具

发包工具

sendip

  • 安装
bash 复制代码
sudo apt-get install sendip
  • 使用
bash 复制代码
#UDP: 从192.168.9.142向192.168.9.132的8889端口发送udp数据包"hello132"
sendip -p ipv4 -is 192.168.9.142 -p udp -ud 8889 -d "hello132" 192.168.9.132

收包工具

tcpdump

  • 使用
bash 复制代码
-a					#将网络地址和广播地址转变成名字
-e					#打印数据链路层的头部信息,包括源mac和目的mac,以及网络层的协议
-v or -vv			#显示更详细的信息
-w test.pcap		#将原始包保存到test.pcap中
-X					#将包头和内容以16进制和ASCII的形式显示
-n					#显示IP地址而不是域名
-c	10				#count,抓10个包

#抓取ens160网卡的与8889端口有关的udp包
tcpdump -i ens160 udp port 8889

#抓取ens160网卡的目的端口是21或80的udp包
tcpdump -i ens160 udp 'dst port 21 or dst port 80'

#抓取ens160网卡的源地址是192.168.9.132的udp包
tcpdump -i ens160 'src 192.168.9.132 and udp'
相关推荐
少妇的美梦17 小时前
logstash教程
运维
chen94517 小时前
k8s集群部署vector日志采集器
运维
chen94517 小时前
aws ec2部署harbor,使用s3存储
运维
轻松Ai享生活21 小时前
5 节课深入学习Linux Cgroups
linux
christine-rr1 天前
linux常用命令(4)——压缩命令
linux·服务器·redis
三坛海会大神5551 天前
LVS与Keepalived详解(二)LVS负载均衡实现实操
linux·负载均衡·lvs
東雪蓮☆1 天前
深入理解 LVS-DR 模式与 Keepalived 高可用集群
linux·运维·服务器·lvs
qq_264220891 天前
LVS负载均衡群集和LVS+Keepalived群集
运维·负载均衡·lvs
乌萨奇也要立志学C++1 天前
【Linux】进程概念(二):进程查看与 fork 初探
linux·运维·服务器
雨落Liy1 天前
Nginx 从入门到进阶:反向代理、负载均衡与高性能实战指南
运维·nginx·负载均衡