开发者

Packet forwarding

I want to make a program to receive a packet on one network interface do some processing and forward it to a different开发者_运维知识库 interface. What can be the most efficient way to do it on Linux? I want to forward the packet with minimum delay


Use libnetfilter_queue.

iptables <....> -j NFQUEUE --queue-num <queue number>

Then write your own program and link with libnetfilter_queue. After some really simple operations you will be able to use recv to receive packets and nfq_set_verdict to decide what to do with the packet.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜