Community discussions

MikroTik App
 
Ammer
just joined
Topic Author
Posts: 18
Joined: Mon Dec 16, 2013 12:49 pm

Script for adding ip adresses to whitelist

Fri Jan 23, 2015 12:12 am

Hi,

We have a a firewall setting to protect our routers from ssh, pptp, and web attacks.
It checks if an ip is on a whitelist, and if its not when it does more then 2 failed login attempts within one minute, the ip is added to a blacklist and dropped.

However, we have routers that function as pptp servers and i want to find a way to prevent established pptp clients from ever getting on the blacklist.
In my eyes the easiest way is to run a script that checks the established pptp tunnels and adds the client addresses to a whitelist.
Has anyone got a script for this, or does someone know the command to print the client addresses so i can write a script to put them on the whitelist?
/int pptp-server print
gives me a list of established clients and their client ip addresses
but how do i get the router to print a list of only the client addresses?

BR.

Ammer
 
User avatar
c0d3rSh3ll
Long time Member
Long time Member
Posts: 557
Joined: Mon Jul 25, 2011 9:42 pm
Location: [admin@Chile] >

Re: Script for adding ip adresses to whitelist

Tue Feb 03, 2015 5:52 am

check this

ros code

/ppp active 
	:foreach i in=[find] do={
		:local ip [get value-name=address $i]
			/ip firewall address-list add list=pptp-whitelist address=$ip
		}

Who is online

Users browsing this forum: No registered users and 13 guests