xdp-project / xdp-tutorial

XDP tutorial
2.5k stars 579 forks source link

Attempt to redirect to lo interface using xdp's bpf_redirect or bpf_redirect. #330

Open Jerry0171 opened 1 year ago

Jerry0171 commented 1 year ago

Hi. I redirect tcp(http) packets coming into eth0(NIC) to the lo interface as an example of packet03-redirecting I want to see http as tcpdump in lo but it doesn't work. However, redirecting from eth0(NIC) to other hosts connected to eth1(NIC) is doing well Is tcp(http) redirect impossible with lo interface? Please answer me

img

tohojo commented 1 year ago

The lo interface doesn't support XDP, so no, you can't redirect to it...

Jerry0171 commented 1 year ago

Tohojo, thank you 1.Then should I make a virtual ip in the server and redirect it? 2.Can iptables read af_xdp's data? If possible, could you tell me how?

tohojo commented 1 year ago

Jerry0171 @.***> writes:

Tohojo, thank you Then should I make a virtual ip in the server and redirect it?

I really don't know, depends on what you're trying to achieve, I guess?

Jerry0171 commented 1 year ago

Tohojo, thank you I will proceed further and ask the question again. Thank you so much for your quick reply and I respect you.