3 ms·
Tangential, but this reminds me of a problem I've had with pf tables. But for other reasons, and with FreeBSD. On a FreeBSD server, using pf, I wanted to open
by quectophoton 3y ago
Tangential, but this reminds me of a problem I've had with pf tables. But for other reasons, and with FreeBSD.
On a FreeBSD server, using pf, I wanted to open one port to only IP addresses from two specific countries[1], and disallow from everywhere else. Everything else is behind a VPN, but I'm managing this server for other people, and, for some reason, a WireGuard VPN is a no (this would have instantly solved the problem).
So then, why a whole country? Because searching for a way to auto-allow their specific /32 public IP addresses each time they changed sounded like a PITA. So, rejected.
So I went and created pf tables for allowing whole-country address ranges, this was the easy part. But then I couldn't get FreeBSD to stop complaining about the tables being too large, even after tweaking some sysctl settings and stuff.
I don't remember the actual size, but at the very least the plaintext file that contained one subnet per line, could fit in my 64GB RAM with a lot of room to spare.
I just gave up for now and told them to use SSH forwarding on a bastion server, which is an option they accept.
[1]: Yes, I know, this isn't bulletproof. I just want to reduce noise from spray-and-pray bs on my SSH and HTTPS logs.
- nolist_policy 3y agoWould have been a piece of cake with nftables sets: https://wiki.nftables.org/wiki-nftables/index.php/Sets https://wiki.nftables.org/wiki-nftables/index.php/Sets
- throw0101c 3y agoAnd it was a piece of cake with FreeBSD's PF as well, as Sets seem to be the same functionality as Tables: * https://man.freebsd.org/cgi/man.cgi?query=pf.conf#TABLES https://man.freebsd.org/cgi/man.cgi?query=pf.conf#TABLES It was the size / scalability of the tables/sets that seem to be the issue, as opposed to the functionality of them.
- quectophoton 3y agoYup. But still, learning nftables has been on my backlog for some time already, so I appreciate it being mentioned. If anything I should try doing this on Linux with nftables and see how it goes, since it sounds like a good way to learn.