Description

This article explain about How to block traffic to a destination IP using firewall filters on SRX

Solution

If a user wants to restrict traffic towards one particular IP to enter the SRX device, he can achieve this by creating firewall filter and applying it on the ingress interface of that particular traffic.

 

Here is configuration example

 

set firewall family inet filter <filter name> term 1 from destination-address <specify the IP>

set firewall family inet filter <filter name> term 1 then discard

set firewall family inet filter <filter name> term 1 then count attempt-to-IP

set firewall family inet filter <filter name> term 2 then accept

 

term "1" and "2" are term names and attempt-to-IP is the counter name(you can name it as you want).

 

Apply the filter to the interface from where the traffic is coming, example untrust interface.

set interfaces <interface-name> family inet filter input <filter name>

 

Example:-

set interfaces ge-0/0/0 unit 0 family inet filter input abc-filter

 

show | compare 

commit check

commit

 

You can check the Counters for the configured filter by using the below command:

> show firewall filter <filter-name>

 

Note:

If you want to restrict IPv6 IP traffic then you need to configure as set firewall family inet6 filter <filter name> term 1 so on.

If you want to restrict IPv6 and IPv4 IPs in same filter, then use generic commad without using inet that is set firewall filter <filter name> term 1 so on .

 

Modification History

2024-12-05 : Article Created