【笔记】openwrt - full cone NAT(全锥NAT)、解决“arp_cache: neighbor table overflow!”

2023-05-16

在这里插入图片描述
在这里插入图片描述

最近安装了比特彗星(bitcomet)后,老是收到警告说日志的接收超过每秒上限了。一看日志,好家伙,一堆的kern.info kernel: [194004.157620] neighbour: arp_cache: neighbor table overflow!日志,还是kernel的,还是info的?

在这里插入图片描述

Sat Jan 28 15:47:41 2023 kern.warn kernel: [474996.419813] net_ratelimit: 1279 callbacks suppressed
Sat Jan 28 15:47:41 2023 kern.info kernel: [474996.419824] neighbour: arp_cache: neighbor table overflow!
Sat Jan 28 15:47:41 2023 kern.info kernel: [474996.424599] neighbour: arp_cache: neighbor table overflow!
Sat Jan 28 15:47:41 2023 kern.info kernel: [474996.426614] neighbour: arp_cache: neighbor table overflow!
Sat Jan 28 15:47:41 2023 kern.info kernel: [474996.433420] neighbour: arp_cache: neighbor table overflow!
Sat Jan 28 15:47:41 2023 kern.info kernel: [474996.433737] neighbour: arp_cache: neighbor table overflow!
Sat Jan 28 15:47:41 2023 kern.info kernel: [474996.434832] neighbour: arp_cache: neighbor table overflow!
Sat Jan 28 15:47:41 2023 kern.info kernel: [474996.435122] neighbour: arp_cache: neighbor table overflow!
Sat Jan 28 15:47:41 2023 kern.info kernel: [474996.435789] neighbour: arp_cache: neighbor table overflow!
Sat Jan 28 15:47:41 2023 kern.info kernel: [474996.436122] neighbour: arp_cache: neighbor table overflow!
Sat Jan 28 15:47:41 2023 kern.info kernel: [474996.440968] neighbour: arp_cache: neighbor table overflow!
Sat Jan 28 15:47:46 2023 kern.warn kernel: [475001.544054] net_ratelimit: 2432 callbacks suppressed
Sat Jan 28 15:47:46 2023 kern.info kernel: [475001.544064] neighbour: arp_cache: neighbor table overflow!
Sat Jan 28 15:47:46 2023 kern.info kernel: [475001.545075] neighbour: arp_cache: neighbor table overflow!
Sat Jan 28 15:47:46 2023 kern.info kernel: [475001.546204] neighbour: arp_cache: neighbor table overflow!
Sat Jan 28 15:47:46 2023 kern.info kernel: [475001.548341] neighbour: arp_cache: neighbor table overflow!
Sat Jan 28 15:47:46 2023 kern.info kernel: [475001.549918] neighbour: arp_cache: neighbor table overflow!
Sat Jan 28 15:47:46 2023 kern.info kernel: [475001.550398] neighbour: arp_cache: neighbor table overflow!
Sat Jan 28 15:47:46 2023 kern.info kernel: [475001.551738] neighbour: arp_cache: neighbor table overflow!
Sat Jan 28 15:47:46 2023 kern.info kernel: [475001.552784] neighbour: arp_cache: neighbor table overflow!
Sat Jan 28 15:47:46 2023 kern.info kernel: [475001.553170] neighbour: arp_cache: neighbor table overflow!
Sat Jan 28 15:47:46 2023 kern.info kernel: [475001.556931] neighbour: arp_cache: neighbor table overflow!

网上找问题原因、解决方法,最接近的就是lede的这个issue https://github.com/coolsnowwolf/lede/issues/6427#issuecomment-785553693,https://github.com/coolsnowwolf/lede/issues/6612

两个东西共同造成的arp_cache: neighbor table overflow!

  1. 在openwrt中打开了FullCone NAT(全锥NAT)
    在这里插入图片描述

  2. 在比特彗星(bitcomet)中默认设置了network.max_udp_pkt_per_sec(每秒最大udp数据包发送量)为1000

    在这里插入图片描述

    在这里插入图片描述

issue中提供的解决方法有两:

  1. 要么: 关闭Full Cone NAT

    💡个人情况
    我没用到nat、upnp,而是使用ipv6做端口监听,所以关了没作用

  2. 要么: 将network.max_udp_pkt_per_sec调小,比如100

但至于这些东西是什么?做什么的?什么意思?为啥这样这样就会有日志警告?那样那样设置就没有警告?是否有更好的解决方案?

下面逐一研究一下

文章目录

      • arp cache和neighbor table
      • FullCone NAT(全锥NAT)
      • Bitcomet为啥发送udp包

arp cache和neighbor table

参考:

  1. Linux: Neighbour Table Overflow Error and Solution - https://www.cyberciti.biz/faq/centos-redhat-debian-linux-neighbor-table-overflow/

首先搞清楚哪里出现的日志信息

根据日志的含义,大概是arp表出现了问题(arp的邻居表溢出)。

💡关于arp(地址解析协议)的基本概念 - <>

查看arp表,没发现啥问题()

$ arp –a
IP address       HW type     Flags       HW address            Mask     Device
192.168.1.1     0x1         0x2         xxxxxxx     *        br-lan
192.168.1.2     0x1         0x2         xxxxxxx     *        br-lan
192.168.1.3     0x1         0x2         xxxxxxx     *        br-lan
192.168.1.4     0x1         0x2         xxxxxxx     *        br-lan
192.168.1.5     0x1         0x2         xxxxxxx     *        br-lan
192.168.1.6     0x1         0x2         xxxxxxx     *        br-lan
192.168.1.7     0x1         0x2         xxxxxxx     *        br-lan
192.168.1.8     0x1         0x2         xxxxxxx     *        br-lan

查看配置信息

net.ipv4.neigh.default.gc_thresh1     ── 存在于ARP高速缓存中的最少层数,如果少于这个数,垃圾收集器将不会运行。缺省值是128。
net.ipv4.neigh.default.gc_thresh2     ── 保存在 ARP 高速缓存中的最多的记录软限制。垃圾收集器在开始收集前,允许记录数超过这个数字 5 秒。缺省值是 512。
net.ipv4.neigh.default.gc_thresh3     ── 保存在 ARP 高速缓存中的最多记录的硬限制,一旦高速缓存中的数目高于此,垃圾收集器将马上运行。缺省值是1024。
net.ipv4.neigh.default.gc_stale_time  ── 决定检查一次相邻层记录的有效性的周期。当相邻层记录失效时,将在给它发送数据前,再解析一次。缺省值是60秒。
$ sysctl net.ipv4.neigh.default.gc_thresh1
net.ipv4.neigh.default.gc_thresh1 = 128
$ sysctl net.ipv4.neigh.default.gc_thresh2
net.ipv4.neigh.default.gc_thresh2 = 512
$ sysctl net.ipv4.neigh.default.gc_thresh3
net.ipv4.neigh.default.gc_thresh3 = 1024
$ sysctl net.ipv4.neigh.default.gc_interval
net.ipv4.neigh.default.gc_interval = 30
$ sysctl net.ipv4.neigh.default.gc_stale_time
net.ipv4.neigh.default.gc_stale_time = 60
$ grep . /proc/sys/net/ipv4/neigh/default/gc_thresh*
/proc/sys/net/ipv4/neigh/default/gc_thresh1:128
/proc/sys/net/ipv4/neigh/default/gc_thresh2:512
/proc/sys/net/ipv4/neigh/default/gc_thresh3:1024
# 编辑配置文件
vi /etc/sysctl.conf

# ========================
# Append the following values (this is taken from server that protects over 200 desktops running MS-Windows, Linux, and Apple OS X):
 ## works best with <= 500 client computers ##
# Force gc to clean-up quickly
net.ipv4.neigh.default.gc_interval = 3600
 
# Set ARP cache entry timeout
net.ipv4.neigh.default.gc_stale_time = 3600
 
# Setup DNS threshold for arp 
net.ipv4.neigh.default.gc_thresh3 = 4096
net.ipv4.neigh.default.gc_thresh2 = 2048
net.ipv4.neigh.default.gc_thresh1 = 1024
# ========================

# 加载配置,使变更生效
sysctl -p

todo

FullCone NAT(全锥NAT)

更多: 关于全锥NAT、路由器四种NAT(Full Cone NAT/Restricted Cone NAT/Port Restricted Cone NAT/Symmetric NAT) - https://lawsssscat.blog.csdn.net/article/details/104637117

简单来说,开启full cone nat后,

Bitcomet为啥发送udp包

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

【笔记】openwrt - full cone NAT(全锥NAT)、解决“arp_cache: neighbor table overflow!” 的相关文章

  • 基于openwrt平台搭建局域网技术验证之二

    1 测试目的 验证l2tp服务器模式的可行性 提供vpn l2tp模式的服务器功能 供客户端连接访问内网 2 参考资料 参考连接1 https www jianshu com p ccf8f2cca70e 参考连接2 https openw
  • 【openwrt学习笔记】dnsmasq源码阅读

    目录 一 DHCP Dynamic Host Configuration Protocol 1 1 前置知识 1 2 参考链接 1 3 IP地址分配代码分析 rfc2131 c dhcp common c dhcp c 1 4 几个小问题
  • openwrt调试用到的

    PC间文件共享 python3 m http server 在共享的电脑上 打开浏览器 直接输入 serverip 8000 NFS Ubuntu PC端 sudo apt get install nfs kernel server sud
  • Ubuntu16.04下交叉编译适配openwrt(CC版本)的swoole扩展库(swoole-1.10.3)

    Ubuntu16 04下交叉编译适配openwrt CC版本 的swoole扩展库 swoole 1 10 3 文章目录 Ubuntu16 04下交叉编译适配openwrt CC版本 的swoole扩展库 swoole 1 10 3 一 简
  • openwrt路由器(RP-LINK)安装python并设置开机启动程序

    由于项目需求 实际条件限制 需要在某台设备上运行一个python小程序 在工业机器人和云服务器之间实现信息转发的功能 因为机器人也需要通过路由器认证连接校园网 出于简化设备的考虑 不想每次跑程序还得开电脑 我决定尝试在路由器上运行这个程序
  • openwrt设置定时重启(天/周/月)

    1 进入openwrt管理页面 找到 系统 计划任务 编辑命令行 点击 保存 2 系统 启动项 中找到cron 确认状态为 开启 点击 重启 使计划生效 或重启系统 说明 一定要设置延时 防止无限重启 每天凌晨1点45分 延时70秒后自动重
  • 在openwrt使用C语言增加ubus接口(包含C uci操作)

    在openwrt使用C语言增加ubus接口 包含C uci操作 文章目录 在openwrt使用C语言增加ubus接口 包含C uci操作 创建自己的软件包 软件包结构 编写代码和启动脚本 重点 案例大致分析 实现过程 ubus demo i
  • OpenWrt添加软件包(一)

    本文参考https wiki openwrt org zh cn doc devel packages http blog csdn net teddy99999 article details 17537545 OpenWrt是一个比较完
  • 通过NAT访问SQL Server实例

    我正在尝试访问通过 IP NAT 映射公开的 SQL Server 所有端口均开放 我不知道 NAT 的详细信息 是否相关 因为那是公司其他地方隐藏在一堆繁文缛节中的内容 这就是我的想法 当您尝试访问 SQL Server 的命名实例时 客
  • 如何从远程主机的以太网地址获取其IP地址?

    我正在寻找一些 Linux 代码来从以太网地址查找 IP 地址 我想我必须做一些反向 A RP 欺骗 但我没有找到任何例子 http compnetworking about com od networkprotocolsip f conv
  • UDP/TCP 打洞 vs UPnP vs STUN vs?

    我尝试制作一个 P2P 程序 需要帮助来穿越客户端的 NAT 我在 stackoverflow 上读过很多问题 但我从来不知道通过 NAT 的所有方法的缺点和优点是什么 有多少路由器支持哪些方法 大公司常用哪些方法 BitTorrent T
  • 通过 NAT 在端口 2000 上运行的 FTP 服务器无法在被动模式下工作

    我正在 Windows 上运行 FILE Zilla ftp 服务器 其中一台 LAN 电脑连接到我的路由器 我正在尝试使用路由器 WAN ip 从路由器外部的网络访问 FTP 服务器 广域网到局域网 通过添加端口转发规则 NAT 在路由器
  • AWS Lambda - NAT 网关互联网访问导致超时

    我有一个 AWS Lambda 函数 检查 Redis Elasticache 实例 如果在缓存中未找到该项目 则转至 Google Places API 服务 Redis 实例位于私有子网 因此 为了获取它 我添加了 VPC 和实例所在的
  • socket.error:[errno 99] 无法分配请求的地址:flask 和 python

    我有同样的问题 and here https stackoverflow com questions 19246103 socket errorerrno 99 cannot assign requested address and nam
  • 仅捕获 arp-reply 数据包的 BPF 表达式

    有没有BPF http biot com capstats bpf html只捕获 arp reply 数据包的表达式 目前 我正在使用 Pcap4J 和以下 BPF 表达式 arp 和 dst 主机host和乙醚 dstmac where
  • 如何从公共互联网访问 HTTP 端口 5001

    我有 Windows Server 2016 Data center x64 NET Core SDK 5 0 预览版 Microsoft SQL Server 2019 在服务器上 https localhost 5001 publish
  • 通过 SNMP 访问路由表

    如果我尝试查找安装了 openWRT 的 Linksys WRT54G 的路由表 我需要哪个 MIB 那应该是MIB II SNMP 对象 ID OID 为 1 3 6 1 2 1 4 21 可转换为ip ipRouteTable 这对我在
  • 未在虚拟机内分配外部 IP

    我正在尝试设置几个 Centos 6 虚拟机 我为它们分配了静态 IP 但运行 ifconfig 时 我看不到外部 IP 只看到内部 IP Google 不允许这种功能吗 除了Anderson所说的之外 这是从实例本身查询外部IP的命令 c
  • 从MAC地址获取IP。 arp -a 不显示设备

    我正在尝试编写一个批处理文件 该文件应该在连接到网络 腾达 WiFi 路由器 时找到我的 Android 手机的动态分配的 IP 所以我正在尝试arp a并搜索我手机的 MAC 地址 以便我可以从表中获取其 IP C Users Leero
  • 使用 STUN 打孔

    我目前正在尝试通过 Internet 发送 UDP 消息 并且必须为端点 A 和 B 都位于 NAT 后面 设置防火墙 为此 我想使用 STUN 服务器进行打孔 当 A 创建对 STUN 服务器的请求 例如 私有 85 1 1 12 600

随机推荐

  • 一文带你读懂PyQt:用Python做出与C++一样的GUI界面应用程序

    一 简介 Python标准库更多的适合处理后台任务 xff0c 唯一的图形库tkinter使用起来很不方便 xff0c 所以后来出现了针对Python图形界面开发的扩展库 xff0c 今天老猿要介绍的是主流Python图形界面扩展库之一的P
  • Python中可迭代对象是什么?

    Python中可迭代对象 Iterable 并不是指某种具体的数据类型 xff0c 它是指存储了元素的一个容器对象 xff0c 且容器中的元素可以通过 iter 方法或 getitem 方法访问 iter 方法的作用是让对象可以用for i
  • 老猿Python博客文章目录索引

    本目录提供老猿Python所有相关博文的一级目录汇总 xff0c 带星号的为付费专栏 xff1a 一 专栏列表 本部分为老猿所有专栏的列表 xff0c 每个专栏都有该专栏置顶的博文目录 xff1a Python基础教程目录PyQt入门学习
  • 用TAP方式让QEMU虚拟机与host联网

    转载自 cgjvcd 最终编辑 cgjvcd QEMU虚拟机网络的缺省模式是NAT方式 xff0c 即虚拟机可以通过host访问外网 xff0c 但host和外网无法访问虚拟机 如果要想让host访问虚拟机 xff0c 则可以使用TAP方式
  • TCP服务器端怎么判断客户端已经关闭了连接?

    http xidianzhangjun blog 163 com blog static 11548877120114411056939 哎 xff0c 首先 xff0c 又犯了一个大错 xff0c 前几天把这个问题通过实验搞懂了 xff0
  • PDP上下文和PDP地址

    http www mscbsc com 10037062 viewspace 61117 html S要接入外部PDN MS还应具有与该PDN相应的地址 称为PDP地址 PDP地址是用于外部分组数据网识别MS的PDP上下文时使用的地址 如用
  • Nmap从探测到漏洞利用备忘录

    http www freebuf com articles network 32302 html 在侦查期间 xff0c 扫描一直是信息收集的初始阶段 什么是侦查 侦查是尽可能多收集关于目标网络的信息 从黑客的角度来看 xff0c 信息收集
  • 内存分配器dlmalloc 2.8.3源码浅析

    目 录 1 本文档介绍 1 2 xff0e 边界标记法 2 3 分箱式内存管理 6 4 核心结构体malloc state 13 5 内存分配相关函数 16 5 1 函数dlmalloc 16 5 2 函数tmalloc small 25
  • C++环境下的expect远程命令执行

    首先 xff0c 必须安装几个开发包 xff0c 在centos fedora下 xff0c 可以使用yum安装 yum y install tcl devel expect devel 装完以后 xff0c 就可以使用expect来写代码
  • aufs 存储机制

    aufs存储机制已经发展到超出了改进squid磁盘I O响应时间的最初尝试 34 a 34 代表着异步I O 默认的ufs和aufs之间的唯一区别 xff0c 在于I O是否被squid主进程执行 数据格式都是一样的 xff0c 所以你能在
  • align-items 与 align-content 的区别

    最明显的区别是align content 适用于多行 xff0c align item 则是适用于单行 align content xff08 单行无效 xff09 可以设置上对齐 下对齐 居中 拉伸 平分剩余空间 xff1b align
  • Apache Traffic Server 简介

    http blog sina com cn s blog 502c8cc40100mw7n html 作者 xff1a 王柯龙 一 介绍 Apache Traffic Server xff08 ATS 或 TS xff09 是一个高 性能
  • 反向代理原理

    局域网主机联入互联网的一种方式 xff0c 使用代理上网可以节约紧缺的IP地址资源 xff0c 而且可以阻断外部主机对内部主机的访问 xff0c 使内部网主机免受外部网主机的攻击 但是 xff0c 如果想让互联网上的主机访问内部网的主机资源
  • SQLite 揭秘

    http msdn microsoft com zh cn magazine ff898405 aspx 孜孜不倦的程序员 SQLite 揭秘 Ted Neward 下载示例代码 为了与本刊主题保持一致 xff0c 现在应该回过头来介绍一下
  • Actor的原理

    http www cnblogs com netfocus p 3365166 html 先从著名的c10k问题谈起 有一个叫Dan Kegel的人在网上 xff08 http www kegel com c10k html xff09 提
  • 【车载开发系列】CAN总线帧种类介绍篇

    车载开发系列 CAN总线帧种类介绍篇 CAN总线帧种类介绍篇 车载开发系列 CAN总线帧种类介绍篇一 CAN总线当中帧的种类二 五种类型帧用途说明三 数据帧的组成1 xff09 帧起始2 xff09 仲裁段3 xff09 控制段4 xff0
  • VS2013 C++ Rest SDK 环境配置方法

    简介 C 43 43 REST SDK 是 Microsoft 的一个开源跨平台项目 xff08 使用 MIT 开源协议 xff09 其使用大量现代异步 C 43 43 API 实现了一个基于 HTTP HTTPS 协议的 服务端 客户端
  • 【日常】FIFA历年四强

    世界杯 xff0c 全称 xff1a 国际足联世界杯 xff08 FIFA World Cup xff09 世界杯每四年举办一次 xff0c 任何国际足联会员国 xff08 地区 xff09 都可以派出代表队报名参加这项赛事 从1930年第
  • 【日常】圣诞节、颜色⛄

    2022年圣诞节到来啦 xff0c 很高兴这次我们又能一起度过 关于圣诞节 x1f384 xff0c 大家想到什么颜色 xff1f x1f98c x1f381 x1f385 x1f525 demo online https codepen
  • 【笔记】openwrt - full cone NAT(全锥NAT)、解决“arp_cache: neighbor table overflow!”

    最近安装了比特彗星 xff08 bitcomet xff09 后 xff0c 老是收到警告说日志的接收超过每秒上限了 一看日志 xff0c 好家伙 xff0c 一堆的kern info kernel 194004 157620 neighb