如何捕获IP数据包,更改其内容并在Linux上重新发送? [英] How to captuare an IP packet, change its content and resend it on Linux?
本文介绍了如何捕获IP数据包,更改其内容并在Linux上重新发送?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的问题是:
如何从网络接口捕获传入的IP数据包,更改其内容并从其他网络接口重新发送?
How to captuare an incoming IP packet from a network interface, change its content and resend it from another network interface?
推荐答案
选择是你的,没有偏好(因此没有正常)。
The choice is yours, there is no preference (and hence no "normal").
- 使用libnetfilter_queue传递给用户空间并在那里进行大量修改。
- 或xtables模块也可以工作(因为它无论如何都被NF调用)。在用户空间的帮助下允许足够的细粒度配置。
- nfhook模块,如果必须的话。你必须自己实现的所有配置。
- 以及最后,如果你喜欢受伤的东西,你也可以实现自己的虚拟网卡驱动程序。
- using libnetfilter_queue to deliver to userspace and do extensive modification there.
- or an xtables module, also works (since it's called by NF anyway). Allows for sufficient fine-grained configuration with help from userspace.
- nfhook module, if you must. All configuration you must implement yourself.
- well and finally, if you like things that hurt, you might as well implement your own virtual NIC driver.
这篇关于如何捕获IP数据包,更改其内容并在Linux上重新发送?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文