xdp-project / xdp-tools

Utilities and example programs for use with XDP
Other
629 stars 133 forks source link

How to attach same XDP program to multiple interfaces #385

Open byxzone opened 7 months ago

byxzone commented 7 months ago

I want to simultaneously attach the same XDP program to multiple InterFaces. In libxdp, xdp_program__attach only can attach to one InterFace , if I use this function multi times, it will create multi Maps , but i want they use same Maps to interact with others How can i do it ?

byxzone commented 7 months ago

My scenario is like this: a machine loaded with XDP programs acts as a gateway, while attaching XDP programs on two (or more)InterFaces to complete SNAT/DNAT operations

tohojo commented 7 months ago

This should be doable with libxdp (just attach the same xdp_prog multiple times), but there's no support for it in the xdp-loader cli. Not sure which you are after?