/ip firewall address-list
Firewall address lists allow user to create lists of IP addresses grouped together. Firewall filter, mangle and NAT facilities can use address lists to match packets against them.
|address (IP address/netmask | IP-IP; Default: )||IP address or range to add to address list|
|list (string; Default: )||Name of the address list where to add IP address|
The following example creates an address list of people thet are connecting to port 23 (telnet) on the router and drops all further traffic from them. Additionaly, the address list will contain one static entry of address=188.8.131.52/32 (www.example.com):
[admin@MikroTik] > /ip firewall address-list add list=drop_traffic address=184.108.40.206/32 [admin@MikroTik] > /ip firewall address-list print Flags: X - disabled, D - dynamic # LIST ADDRESS 0 drop_traffic 220.127.116.11 [admin@MikroTik] > /ip firewall mangle add chain=prerouting protocol=tcp dst-port=23 \ \... action=add-src-to-address-list address-list=drop_traffic [admin@MikroTik] > /ip firewall filter add action=drop chain=input src-address-list=drop_traffic [admin@MikroTik] > /ip firewall address-list print Flags: X - disabled, D - dynamic # LIST ADDRESS 0 drop_traffic 18.104.22.168 1 D drop_traffic 22.214.171.124 2 D drop_traffic 10.5.11.8 [admin@MikroTik] >
As seen in the output of the last print command, two new dynamic entries appeared in the address list. Hosts with these IP addresses tried to initialize a telnet session to the router.