我试过了https://github.com/TOGoS/TUN2UDP
这允许我这样做:
Application --> TAP
Read from TAP --> Write to UDP (under my control)
Read from UDP --> Write to TAP (under my control)
TAP --> Application
我想做的是:
Application --> ETH
Read from ETH --> Write to TAP (under my control)
TAP --> Application
换句话说,我想拦截第2层的传入数据包,并控制阻止它们,修改它们或传递它们。
我认为或许桥接ETH和TAP是关键,但我无法弄清楚如何以我需要的方式以编程方式访问此桥。