Jump to content

MikroTik dhcp

возникла необходимость писать ip адрес ни мак адрес на другой сервер для дольнейший обработки

нашел скрипт пытался под себя его переделать только он ято то у меня не заработал

/ip dhcp-server> export 
# mar/12/2015 10:56:05 by RouterOS 6.27
# software id = N8AV-5CVY
/ip dhcp-server
add add-arp=yes address-pool=dhcp_pool1 authoritative=yes disabled=no interface=bridge-local lease-script=":if (\$leaseBound = 1) do={\r\
   \n/ip dhcp-server lease;\r\
   \n:foreach i in=[find dynamic=yes] do={\r\
   \n:local dhcpip\r\
   \n:set dhcpip [ get \$i address ];\r\
   \n:local clientid\r\
   \n:set clientid [get \$i host-name];\r\
   \n \r\
   \n:if (\$leaseActIP = \$dhcpip) do={\r\
   \n:local comment \"New IP\"\r\
   \n:set comment ( \$comment . \": \" .  \$dhcpip . \": \" . \$clientid);\r\
   \n/log error \$comment;\r\
   \n/system ssh   user=mikrotik  command=\" echo \$leaseActIP \$leaseActMAC  >> 1.txt\"  \r\
   \n}" name=dhcp1
/ip dhcp-server network
add address= gateway=

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this