I want to allow IP 1.2.3.4
on port 3306 with nftables, but I was not able to find how to actually insert port?
I was trying something like nft insert saddr 1.2.3.4.5 ip daddr server_ip accept
Since I assume it's the MySQL port, using the TCP protocol:
sudo nft add rule filter input ip saddr 1.2.3.4 tcp dport 3306 accept
The saddr
and daddr
options are part of ip
setting, while the sport
and dport
options should be used with the layer 4 protocol such as tcp
or udp
.