| Post Reply | RetroFed Forum Forum Index » Selfhosted |
| Author | Message | ||
|---|---|---|---|
|
confusedpuppy
lemmy.dbzer0.com
confusedpuppy@lemmy.dbzer0.com Joined: 2023-12-12 |
Podman is no longer supporting nftables has a config file with basic rules which include receiving pings:
I also have a small config file:
After loading the new rules, I get the following output while listing the ruleset:
I can connect perfectly fine with SSH, WireGuard and my reverse proxy on port 5050 but if I ping the server I don't get any response at all. Pings worked as normal when I was using iptables so I am not sure what I am doing wrong with nftables. I've tried to keep the rules as simple as possible to figure out what is happening but I have not been able to make any progress. Any help would be appreciated. |
||
| 34 Original | |||
|
pHr34kY
lemmy.world
pHr34kY@lemmy.world Joined: 2023-07-02 |
My server has this to allow ICMP in nftables:
Yes, it just allows all of it. You could use it as a starting point (if it works) then fine-tune it. I have not tuned mine at all. I don't see the keyword "ipv6-icmp" in your config. It might have something to do with that. There's a hundred ways to do the same thing, and I haven't found online guides to be consistent. |
||
| 5 | |||
|
confusedpuppy
lemmy.dbzer0.com
confusedpuppy@lemmy.dbzer0.com Joined: 2023-12-12 |
My server has this to allow ICMP in nftables: ip protocol icmp accept meta l4proto ipv6-icmp accept Yes, it just allows all of it. You could use it as a starting point (if it works) then fine-tune it. I have not tuned mine at all. I don't see the keyword "ipv6-icmp" in your config. It might have something to do with that. There's a hundred ways to do the same thing, and I haven't found online g...
I tried your suggested rules and still nothing I went a step further and simply enabled all incoming connections with:
Again I can connect with SSH and WireGuard but I still can't ping my server. If I restore to my last backup with iptables, I can get a response from ping again. I also tried directly translating the rules from iptables with:
and adding the rules:
and still no ping from my server... I will agree, the documentation for nftables is just not as accessible or consistent as iptables. It's a bit frustrating. |
||
| 1 | |||
|
pHr34kY
lemmy.world
pHr34kY@lemmy.world Joined: 2023-07-02 |
I tried your suggested rules and still nothing I went a step further and simply enabled all incoming connections with: table inet filter { chain input { type filter hook input priority 0; policy allow; } } Again I can connect with SSH and WireGuard but I still can't ping my server. If I restore to my last backup with iptables, I can get a response from ping again. I also tried directly translat...
Run |
||
| 2 | |||
|
ChrisG
lemmy.world
ChrisG@lemmy.world Joined: 2023-07-12 |
Windscribe |
||
| -1 | |||
|
farcaller
fstab.sh
farcaller@fstab.sh Joined: 2023-07-01 |
nftables offers a very decent debugging interface. First, you add a rule to trace the packet (a new chain with high priority works best). Usually I’d suggest to add those rules by hand instead of relying on declarative configs:
Then you add the actual tracing rule there with the shape to match the incoming traffic:
now you can run |
||
| 4 | |||
|
confusedpuppy
lemmy.dbzer0.com
confusedpuppy@lemmy.dbzer0.com Joined: 2023-12-12 |
nftables offers a very decent debugging interface. First, you add a rule to trace the packet (a new chain with high priority works best). Usually I’d suggest to add those rules by hand instead of relying on declarative configs: nft add table ip ping_trace nft 'add chain ip ping_trace prerouting { type filter hook prerouting priority -301; policy accept; }' Then you add the actual tracing rule t...
I tried what you said. I sent a ping from my computer to the server and this was the output of
I sort of get what's happening and it looks like the ping request has been accepted. From my computer when I send a ping it shows:
So even though it's being accepted, I still get nothing going back to my computer, at least that's how I understand it. |
||
| 1 | |||
|
farcaller
fstab.sh
farcaller@fstab.sh Joined: 2023-07-01 |
I tried what you said. I sent a ping from my computer to the server and this was the output of nft monitor trace: trace id 1d01c81e ip ping_trace prerouting packet: iif "eth0" ether saddr b0:7d:64:e8:8f:3c ether daddr d8:3a:dd:de:28:99 ip saddr 192.168.40.201 ip daddr 192.168.40.203 ip dscp cs0 ip ecn not-ect ip ttl 64 ip id 65074 ip length 84 icmp type echo-request icmp code 0 icmp id 35586 ic...
It is accepted just fine then. You might want to check the reverse, start in top of the output chain and trace the echo reply. |
||
| 1 | |||
|
SayCyberOnceMore
feddit.uk
Cyber@feddit.uk Joined: 2023-06-17 |
I think you're allowing icmp in, but not back out again |
||
| 1 | |||
|
confusedpuppy
lemmy.dbzer0.com
confusedpuppy@lemmy.dbzer0.com Joined: 2023-12-12 |
I think you're allowing icmp in, but not back out again
The default policy for output is accept so I'm assuming I don't need to explicitly add ICMPv4 rules to the output chain. As a test I did add the ICMPv4 rules to the output chain and I still have the same results as before. I can confirm that the server is receiving the ping requests but my computer sending the pings loses the ping packets. |
||
| 1 | |||
|
confusedpuppy
lemmy.dbzer0.com
confusedpuppy@lemmy.dbzer0.com Joined: 2023-12-12 |
It is accepted just fine then. You might want to check the reverse, start in top of the output chain and trace the echo reply.
How would trace the echo reply in the output chain? I tried adding |
||
| 1 | |||
|
farcaller
fstab.sh
farcaller@fstab.sh Joined: 2023-07-01 |
How would trace the echo reply in the output chain? I tried adding meta nftrace set 1 directly to the ICMPv4 rule as well as making a chain postrouting rule but I can't seem to figure it out.
I actually don’t remember off the top of my head, huh. The output chain is not the one I use often. I'd think |
||
| 2 | |||
| Post Reply |
Back to top |