Skip to content
This repository has been archived by the owner on Aug 26, 2024. It is now read-only.

how do also listen to a specific port and forward to another application port based on ip address? #25

Open
kolinfluence opened this issue Dec 3, 2022 · 1 comment

Comments

@kolinfluence
Copy link

  1. how do also listen to a specific port and forward to another application port based on ip address?
    e.g. how to listen to port 80, forward to port 8080 if crc/xxhash(123.123.123.123)%[number of cpu] + 8080?

[client 123.123.123.123] -> [listen port 80, xdp hash ip] -> [forward to app listening on port 8080+2 (hashed based on ip address)]

also,
2. with reference to #23

@kolinfluence
Copy link
Author

kolinfluence commented Dec 3, 2022

i just read this
#13

so how do i forward to different af_xdp program based on ip address? since i cant divert to different application ports?

but https://github.com/xdp-project/xdp-tutorial/tree/master/packet-solutions

packet rewriting, rewrite port numbers. this works. i just need to rewrite port number that's all.

can u provide an example or clue on how to get this done? thx in advance.

can i buy u coffees for this? need to

  1. divert to port
  2. drop some ips based on the application reactions etc. (this can be later, shld be much easier. my app connects to a redis pub/sub and listens for bad ips and not sure how to connect to this af_xdp thing.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant