To allow all traffic from an IP:
ip saddr 1.1.1.1 counter accept comment "Allow all for PMS"
or
ip saddr 1.1.1.1 ct state new counter packets 0 bytes 0 accept comment "Allow all for PMS"
The second is more secure as it only allows new connections from the IP, not all of its traffic.
I would put this under "# Other services specific" in /etc/nftables.conf
Check your formatting is valid and free of errors before restarting/applying nftables.
nft -c -f /etc/nftables.conf
systemctl restart nftables
which line should i add this?
Maybe I can just add this port 15374 into the 3cx section?
# Basic IPv4/IPv6 stateful firewall for server/workstation.
table inet filter {
chain input {
type filter hook input priority 0; policy drop;
iifname lo accept comment "Accept any localhost traffic"
ct state { established, related } accept comment "Accept traffic originated from us"
ip daddr 222.0.1.75 counter accept comment "Accept SIP Multicast"
#ip6 nexthdr ipv6-icmp type echo-request accept
ct state invalid drop comment "Drop invalid connections"
tcp dport 113 reject with icmpx type port-unreachable comment "Reject AUTH to make it fail fast"
# 3CX PhoneSystem specific
tcp dport { 80,443,5000,5001,5015,5060,5061,5062,5090 } ct state new counter accept comment "Accept 3CX PhoneSystem TCP ports"
udp dport { 69,5060,5090,7000-10999 } counter accept comment "Accept 3CX PhoneSystem UDP ports"
# Other services specific
udp dport { 137,138 } counter accept comment "Accept NetBIOS"
tcp dport { 139,445 } counter accept comment "Accept TCP/IP MS Networking"
# SSH Bruteforce blacklist
tcp dport ssh ct state new limit rate 15/minute accept comment "Avoid brute force on SSH"
# ICMPv4
ip protocol icmp icmp type {
echo-reply, # type 0
destination-unreachable, # type 3
time-exceeded, # type 11
parameter-problem, # type 12
} accept comment "Accept ICMP"
ip protocol icmp icmp type echo-request limit rate 1/second accept comment "Accept max 1 ping per second"
# ICMPv6
icmpv6 type {
echo-request,
time-exceeded,
destination-unreachable,
parameter-problem,
nd-neighbor-solicit,
nd-router-advert,
nd-neighbor-advert
} accept comment "Accept ICMPv6"
ip6 nexthdr icmpv6 icmpv6 type echo-request limit rate 1/second accept comment "Accept max 1 ping per second"
fib daddr type broadcast drop comment "Drop other broadcast"
fib daddr type multicast drop comment "Drop other multicast"
fib daddr type anycast drop comment "Drop other anycast"
ip daddr 224.0.0.0/4 drop comment "Drop DVMRP"
}
chain forward {
type filter hook forward priority 0; policy drop;