随笔分类 -  Network

摘要:单项抓包 tcpdump -nn -e -i eth0 "ip proto 4 and (ip[20+16:1]=10 and ip[20+17:1]=244 and ip[20+18:1]=72 and ip[20+19:1]=10)" 双向抓包 tcpdump -nn -e -i eth1 "i 阅读全文
posted @ 2024-05-17 18:00 salami_china 阅读(46) 评论(0) 推荐(0)
摘要:at 后面值是偏移量,偏移是从以太网头末尾开始计算的,在这之后用正数表示偏移量,在这之前用负数表示偏移量 以太网数据包格式:【https://blog.csdn.net/hhpingyear/article/details/80216680】 at等于0就是上面红色区域的其实位置,负数向前偏移,正数 阅读全文
posted @ 2023-04-14 19:35 salami_china 阅读(133) 评论(0) 推荐(0)
摘要:在使用命令 ip link add bond0 type bond 创建 Bond 接口时,可以指定不同的 Bond 模式。常见的 Bond 模式有以下几种: mode=balance-rr:即 Round-robin 模式,是默认的 Bond 模式。在该模式下,数据包会按照轮流分发到不同的物理接口 阅读全文
posted @ 2023-04-11 16:41 salami_china 阅读(1189) 评论(0) 推荐(0)
摘要:参考链接:https://developer.aliyun.com/ask/336089 当开启只有不在tcp窗口内的rst包被标志为无效,当关闭(默认)所有不在tcp窗口中的包都被标志为无效. 0:关闭 1:开启 “When packets with sequence number out-of- 阅读全文
posted @ 2023-03-23 17:02 salami_china 阅读(714) 评论(0) 推荐(0)
摘要:运行 dropwatch -l kas,不加参数会显示函数地址,不方便观察 #dropwatch -l kas Initalizing kallsyms db dropwatch> start Enabling monitoring... Kernel monitoring activated. I 阅读全文
posted @ 2023-03-06 20:43 salami_china 阅读(533) 评论(0) 推荐(0)
摘要:参考文档: https://www.nuomiphp.com/serverfault/zh/60480e758726d95932321906.html # dhcp 配置 option rfc3442-classless-static-routes code 121 = array of integ 阅读全文
posted @ 2022-11-29 19:09 salami_china 阅读(209) 评论(0) 推荐(0)
摘要:1. struct iphdr *ip_header = (struct iphdr *)skb_network_header(skb); struct tcphdr *tcp_header = (struct tcphdr *)skb_transport_header(skb); 2. struc 阅读全文
posted @ 2022-09-20 13:35 salami_china 阅读(62) 评论(0) 推荐(0)
摘要:参考链接:https://blog.laoliu.eu.org/archives/e3c95af8.html 安装quagga: centos: yum install quagga -y 查看安装: [root@master ~]# rpm -qa | grep quagga quagga-0.9 阅读全文
posted @ 2022-06-08 13:45 salami_china 阅读(182) 评论(0) 推荐(0)
摘要:route scope,取值范围如下: RT_SCOPE_UNIVERSE:该选项用于所有通向非直连目的地的路由表项,即应用层创建的路由中包含via的路由 RT_SCOPE_LINK:该选项用于目的地址为本地网络的路由项 RT_SCOPE_HOST:该选项用于路由为本机接口 RT_SCOPE_NOW 阅读全文
posted @ 2022-06-06 19:17 salami_china 阅读(152) 评论(0) 推荐(0)
摘要:参考链接: http://blog.iis7.com/article/24048.html 什么是连接跟踪? 连接跟踪是Linux内核中引入的nf_conntrack 模块所实现的功能,同时支持IPv4 和 IPv6,取代只支持 IPv4 的 ip_connktrack,用于跟踪连接的状态,供其他模 阅读全文
posted @ 2022-06-02 15:56 salami_china 阅读(1762) 评论(0) 推荐(0)
摘要:测试UDP链接: nc -vuz x.x.x.x xxxx 测试TCP链接: nc -vz x.x.x.x xxxx -v 详细输出(用两个-v可得到更详细的内容) -u 使用UDP传输协议 -z 使用0输入/输出模式,只在扫描通信端口时使用。 阅读全文
posted @ 2022-06-02 15:51 salami_china 阅读(86) 评论(0) 推荐(0)
摘要:参考链接: https://www.cnblogs.com/hanyifeng/p/6723964.html 总结:回环lo接口上的 127.0.0.1 地址,不允许发到设备外部,sysctl -w net.ipv4.conf.eth0.route_localnet=1 开启route_localn 阅读全文
posted @ 2022-04-26 14:51 salami_china 阅读(878) 评论(0) 推荐(0)
摘要:参考链接: https://blog.csdn.net/qq_46402409/article/details/121945808 https://www.pianshen.com/article/72101945189/ https://blog.z0ukun.com/?p=3664 IPV4每次 阅读全文
posted @ 2022-04-19 13:30 salami_china 阅读(982) 评论(0) 推荐(0)
摘要:在 Linux 上可用以下语句看了一下服务器的TCP状态(连接状态数量统计): netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}' 返回结果范例如下: ESTABLISHED 1423 FIN_WAIT1 1 FI 阅读全文
posted @ 2022-03-03 19:00 salami_china 阅读(321) 评论(0) 推荐(0)
摘要:参考链接: https://www.cnblogs.com/mrwuzs/p/12793207.html #! /bin/sh interface=bond0 ip=10.10.10.10/16 delay=100ms loss=30% tc qdisc add dev $interface roo 阅读全文
posted @ 2022-02-21 19:46 salami_china 阅读(796) 评论(0) 推荐(0)
摘要:ebtable最重要的应用是当内核开启了bridge-nf功能后,将iptables和ebtables都整合到二层处理里 阅读全文
posted @ 2021-10-21 16:09 salami_china 阅读(152) 评论(0) 推荐(0)
摘要:问题:Ncat: socket: Address family not supported by protocol QUITTING 原因:使用ipv4, 默认会使用v4 v6, 如果v6禁用了,就会出现这个错误 解决:nc -lk4 8080 阅读全文
posted @ 2021-10-15 19:53 salami_china 阅读(1383) 评论(0) 推荐(0)
摘要:参考链接: https://blog.csdn.net/qq_20817327/article/details/113770498 [root@master ~]# iptables -m addrtype --help iptables v1.4.21 Usage: iptables -[ACD] 阅读全文
posted @ 2021-09-13 14:10 salami_china 阅读(396) 评论(0) 推荐(0)
摘要:原文链接:http://blog.sina.com.cn/s/blog_53d7350f0100od58.html Limit match 这个匹配操作必须由-m limit明确指定才能使用。有了他的帮助,就能对指定的规则的日志数量加以限制,以免你被信息的洪流淹没哦。比如,你能事先设定一个限定值,当 阅读全文
posted @ 2021-08-17 11:28 salami_china 阅读(393) 评论(0) 推荐(0)
摘要:现象: ipset 不支持 0.0.0.0/0 全段IP 解决: 可以使用 0.0.0.0/1 和 128.0.0.0/1 来包含全部IPv4 IP地址 补丁:http://git.netfilter.org/ipset/commit/?id=9b0be3d2545bfd0b482883bada1f 阅读全文
posted @ 2021-08-12 21:01 salami_china 阅读(226) 评论(0) 推荐(0)