Hi,
I create this rule to deny ESP package from this 179.49.229.XX, this traffic comes from internet (eth0)
set firewall ipv4 input filter rule 19 action ‘drop’
set firewall ipv4 input filter rule 19 destination port ‘500’
set firewall ipv4 input filter rule 19 inbound-interface name ‘eth0’
set firewall ipv4 input filter rule 19 protocol ‘udp’
set firewall ipv4 input filter rule 19 source address ‘179.49.229.xx’
commit
didn’t work
Rule Packets Bytes Action Source Destination Inbound-Interface Outbound-interface
10 0 0 drop any any eth0 any
11 1 40 drop any any eth0 any
12 0 0 accept any any eth1 any
13 0 0 accept any any any any
14 0 0 accept any any any any
15 0 0 accept any any any any
16 0 0 accept any any vti0 any
17 0 0 accept any any eth0 any
18 0 0 accept any any any any
19 0 0 drop 179.49.229.XX any eth0 any
1010 0 0 accept any any lo any
default 601 31945 accept any any any any
I tested with these changes
set firewall ipv4 input filter rule 19 protocol ‘esp’ or deleting this
#set firewall ipv4 input filter rule 19 inbound-interface name ‘eth0’
but the same issue.
But I configure this rule and work:
iptables -A INPUT -s 179.49.229.XX -p udp --dport 500 -j DROP
sudo iptables -L -v -n
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
3 1455 DROP 17 – * * 179.49.229.XX 0.0.0.0/0 udp dpt:500
This is my rules:
set firewall ipv4 input filter rule 10 action ‘drop’
set firewall ipv4 input filter rule 10 description ‘Limit SSH attempts on eth0’
set firewall ipv4 input filter rule 10 destination port ‘22’
set firewall ipv4 input filter rule 10 inbound-interface name ‘eth0’
set firewall ipv4 input filter rule 10 protocol ‘tcp’
set firewall ipv4 input filter rule 10 recent count ‘4’
set firewall ipv4 input filter rule 10 recent time ‘minute’
set firewall ipv4 input filter rule 11 action ‘drop’
set firewall ipv4 input filter rule 11 destination port ‘22’
set firewall ipv4 input filter rule 11 inbound-interface name ‘eth0’
set firewall ipv4 input filter rule 11 protocol ‘tcp’
set firewall ipv4 input filter rule 11 state ‘new’
set firewall ipv4 input filter rule 12 action ‘accept’
set firewall ipv4 input filter rule 12 description ‘Allow new SSH connections on eth1’
set firewall ipv4 input filter rule 12 destination port ‘22’
set firewall ipv4 input filter rule 12 inbound-interface name ‘eth1’
set firewall ipv4 input filter rule 12 protocol ‘tcp’
set firewall ipv4 input filter rule 12 state ‘new’
set firewall ipv4 input filter rule 13 action ‘accept’
set firewall ipv4 input filter rule 13 description ‘Allow IKE traffic (UDP 500)’
set firewall ipv4 input filter rule 13 destination port ‘500’
set firewall ipv4 input filter rule 13 protocol ‘udp’
set firewall ipv4 input filter rule 14 action ‘accept’
set firewall ipv4 input filter rule 14 description ‘Allow NAT-T traffic (UDP 4500)’
set firewall ipv4 input filter rule 14 destination port ‘4500’
set firewall ipv4 input filter rule 14 protocol ‘udp’
set firewall ipv4 input filter rule 15 action ‘accept’
set firewall ipv4 input filter rule 15 description ‘Allow ESP traffic’
set firewall ipv4 input filter rule 15 protocol ‘esp’
set firewall ipv4 input filter rule 16 action ‘accept’
set firewall ipv4 input filter rule 16 description ‘Allow new SSH connections on vti0’
set firewall ipv4 input filter rule 16 destination port ‘22’
set firewall ipv4 input filter rule 16 inbound-interface name ‘vti0’
set firewall ipv4 input filter rule 16 protocol ‘tcp’
set firewall ipv4 input filter rule 16 state ‘new’
set firewall ipv4 input filter rule 17 action ‘accept’
set firewall ipv4 input filter rule 17 description ‘Allow wireguard port’
set firewall ipv4 input filter rule 17 destination port ‘51820’
set firewall ipv4 input filter rule 17 inbound-interface name ‘eth0’
set firewall ipv4 input filter rule 17 protocol ‘udp’
set firewall ipv4 input filter rule 17 state ‘new’
set firewall ipv4 input filter rule 18 action ‘accept’
set firewall ipv4 input filter rule 18 description ‘Allow return traffic for established/related connections’
set firewall ipv4 input filter rule 18 state ‘established’
set firewall ipv4 input filter rule 18 state ‘related’
set firewall ipv4 input filter rule 19 action ‘drop’
Rule Packets Bytes Action Source Destination Inbound-Interface Outbound-interface
10 0 0 drop any any eth0 any
11 8 376 drop any any eth0 any
12 0 0 accept any any eth1 any
13 0 0 accept any any any any
14 0 0 accept any any any any
15 0 0 accept any any any any
16 0 0 accept any any vti0 any
17 0 0 accept any any eth0 any
18 0 0 accept any any any any
19 0 0 drop 179.49.229.76 any eth0 any
1010 0 0 accept any any lo any
default 9862 517628 accept any any any any
Thanks