Hi 建霆 陈
suggest to look at SIOCGIFINDEX example programming
Sending raw Ethernet packets from a specific interface in C on Linux | Austin's blog
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------