简体   繁体   English

导入后如何刷新Scapy配置?

[英]How to refresh Scapy configuration after importing it?

I am using scapy.all.conf.route.routes in order to get some network info (especially gateway and IP for a specific NIC), the problem is that I import Scapy via "from scapy.all import *" at the beginning of the script but the same script does an ifup of my NIC later. 我正在使用scapy.all.conf.route.routes来获取一些网络信息(特别是特定NIC的网关和IP),问题是我通过“从scapy.all import *”导入Scapy。该脚本,但是稍后使用同一脚本对我的NIC进行ifup。 If seems that once the module has been loaded, Scapy does not refresh its config and scapy.all.conf.route.routes still does not contain the info about the NIC I just started via ifup. 如果似乎在模块加载后,Scapy不会刷新其配置,并且scapy.all.conf.route.routes仍不包含我刚刚通过ifup启动的NIC的信息。 The entire project makes extensive use of Scapy so I would like to use Scapy here as well but I am still curious about other options as well. 整个项目广泛使用了Scapy,因此我也想在这里使用Scapy,但我仍然对其他选择感到好奇。

Regards, 问候,

Sam 山姆

你有没有尝试过:

conf.route.resync()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM