ping 127.0.0.1会出现时延很大

问题:

国产化uos操作系统,有时网络ping 127.0.0.1会出现时延很大的情况,时延在毫秒级别,有时甚至在10毫秒级别,经查该问题是现有iptables版本与kube-proxy存在兼容性问题,需要对现有iptables进行降级

降级步骤:

查看现有的iptables版本
root@k8s-10:~# iptables --version
iptables v1.8.2 (nf_tables)
 
 
统计现有规则数:
root@k8s-10:~# iptables -S |wc -l
11733
 
 
root@k8s-10:~# update-alternatives --config iptables
There are 2 choices for the alternative iptables (providing /usr/sbin/iptables).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/sbin/iptables-nft 20 auto mode
1 /usr/sbin/iptables-legacy 10 manual mode
2 /usr/sbin/iptables-nft 20 manual mode
Press <enter> to keep the current choice[*], or type selection number: 1
update-alternatives: using /usr/sbin/iptables-legacy to provide /usr/sbin/iptables (iptables) in manual mode
 
 
统计修改后的规则数:
root@k8s-10:~# iptables -S |wc -l
733
 
 
查看修改后的iptables版本信息:
root@k8s-10:~# iptables --version
iptables v1.8.2 (legacy)
 
 
可以看到修改iptables后,iptables规则数有明显下降

参考链接:

https://blog.csdn.net/LL845876425/article/details/105211484

https://zhuanlan.zhihu.com/p/83254020?from_voters_page=true