Hi, everyone.
I want to drop connections by a script on specific ports via ssh
Got a list of ports (to array):
portnum = $ (ssh $ router ‘/ ip firewall nat export’ | grep -A3 “Rules description” | grep “to-port” | cut -d “=” -f 3)
output:
10487
10488
execute in script:
for port in $ {portnum [*]}
do
echo “port =” $ port
ssh $ r / ip firewall connection remove [find dst-address~"$port"]
done[/b]
output:
connection not dropped
If I try enable debug on router:
exec > /ip firewall connection remove [find dst-address ~“10487”]
exec > /ip firewall connection remove [find dst-address ~“10488”]
If I try run
/ip firewall connection remove [find dst-address ~“10487”]
in scripts - connection drop.
Could you tell me what I’m doing wrong when I use an array?