Tag Archives: ip

Script Fu – Changing RADIUS server source address

Just a quick post to show an example of day to day usage of RouterOS scripting.

Goal: We had to change the src-address for a bunch of radius-server listings across 40 MikroTik devices, to match a new pptp-tunnel address. What would’ve been a pain was that the address is different on each device.

Solution: Create a scriptlet to pull the IP into the update (set) routine, ensuring it is formatted correctly for use.

Continue reading Script Fu – Changing RADIUS server source address

Scriplet: Grabbing PPPoE IP Address

A quick scriptlet I whipped up for a friend tonight to allow them to retrieve an IP addess from a specific PPPoE interface.
Handy for updating DynDNS entries among other things.

:local wanip [/ip address get [/ip address find where interface=pppoe-wan] address];
:set wanip [:pick $wanip 0 ([:len $wanip]-3) ];
#whatever you want to do with said IP goes here
:put $wanip;

Obviously update pppoe-wan with your interface name 😉