-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xdp-filter in deny policy, denies all packets in native mode #222
Comments
Divyanshu Saxena ***@***.***> writes:
I am a beginner with XDP, and I was trying to run xdp-filter to deny
all packets destined to port 8080. I'm using it as follows:
The 'policy' is what happens to packets that are *not* matched by any
rules. So if you want to only drop packets with port 8080, you should
use -p allow and then add the port. This is explained in the man page.
The expected output (which works if I use the generic mode) is:
```
$ sudo nping -c 1 --tcp -p 8081 10.10.1.1
Starting Nping 0.7.80 ( https://nmap.org/nping ) at 2022-08-24 21:19 MDT
SENT (0.0595s) TCP 10.10.1.2:17666 > 10.10.1.1:8081 S ttl=64 id=61030 iplen=40 seq=2678198273 win=1480
RCVD (0.0598s) TCP 10.10.1.1:8081 > 10.10.1.2:17666 RA ttl=64 id=0 iplen=40 seq=0 win=0
Max rtt: 0.198ms | Min rtt: 0.198ms | Avg rtt: 0.198ms
Raw packets sent: 1 (40B) | Rcvd: 1 (46B) | Lost: 0 (0.00%)
Nping done: 1 IP address pinged in 1.09 seconds
$ sudo nping -c 1 --tcp -p 8080 10.10.1.1
Starting Nping 0.7.80 ( https://nmap.org/nping ) at 2022-08-24 21:21 MDT
SENT (0.0369s) TCP 10.10.1.2:6221 > 10.10.1.1:8080 S ttl=64 id=28160 iplen=40 seq=277663282 win=1480
Max rtt: N/A | Min rtt: N/A | Avg rtt: N/A
Raw packets sent: 1 (40B) | Rcvd: 0 (0B) | Lost: 1 (100.00%)
Nping done: 1 IP address pinged in 1.07 seconds
```
Hmm, it shouldn't work differently in generic mode; could you please
post the output of 'xdp-filter status' after running that test?
|
I thought that the reverse rules will apply to the matched packets. So if I understand correctly, all packets that match any rules are automatically dropped - right?
So, when you mentioned it, I re-ran the test and found a strange behavior. If I load a filter in
Could it be somehow that the maps are not getting cleaned up during unload? |
Hmm, could you try running all those commands with a '-v' switch passed
to xdp-filter? And also add a 'status' command after each time you've
unloaded everything?
|
I am a beginner with XDP, and I was trying to run xdp-filter to deny all packets destined to port 8080. I'm using it as follows:
From another machine, I send out packets using
nping
:The expected output (which works if I use the generic mode) is:
Edit: I am using a machine with Mellanox driver -- so the native mode should be supported.
The text was updated successfully, but these errors were encountered: