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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.