TOUGHRADIUS
Wiki
  • README
  • Security Update: XSS Vulnerability Fix
  • config
  • docker
  • freeRADIUS integration
  • tr069
    • tr069_events
  • common
    • XMLX
  • docs
    • documents
      • Explanation of nouns
      • Mikrotik TR069 Client Setup for ToughRADIUS
      • ToughRADIUS Defined TR069 Preset Template
      • Introduction to BRAS
      • The Cisco BRAS device is connected to the ToughRADIUS server
      • ToughRADIUS Configuration
      • database
      • ToughRADIUS Docker Quick Deployment
      • ToughRADIUS 对 EAP 认证方法的支持
      • FreeRadius rest module Configuration
      • freeRADIUS integration
      • ## H3C 设备配置对接 ToughRADIUS
      • Huawei device configuration and interconnection ToughRADIUS
      • ToughRADIUS Quick start
      • ToughRADIUS 常见问题
      • Docker-compose 部署
      • ToughRADIUS Data Model
      • tr069_cert
      • Event type (meaning corresponding to EVENT CODE)
      • Mikrotik TR069 Client Setup for ToughRADIUS
      • zh-cn
        • ToughRADIUS 快速安装指南
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. docs
  2. documents

Mikrotik TR069 Client Setup for ToughRADIUS

This script can be used to automatically configure the TR069 client on a Mikrotik device for device management by ToughRADIUS. This script is generated by ToughRADIUS and automatically replaces variables, which can be found in the System Settings - TR069 function menu

# mikrotik tr069 client setup script
# Install certificate
:global acsCaCertTxt "{{.CacrtContent}}";

/file print file=tr069_ca_cert.txt;
delay 2;
/file set tr069_ca_cert.txt contents=$acsCaCertTxt;
/certificate import file-name=tr069_ca_cert.txt passphrase="";
/file remove tr069_ca_cert.txt;

# Wait while ehter ifaces show up
:local count 0;
:while ([/interface ethernet find] = "") do={
    :if ($count = 30) do={
        /quit;
    }
    :delay 1s; :set count ($count +1);
};

#Get serial-number
:local sn;
:if ([/system resource get board-name] = "CHR") do={
  :set sn [/system license get system-id];
} else={
  :set sn [/system routerboard get serial-number];
}

:local existingClient [/ip dhcp-client find interface=ether1];
:if ( $existingClient = "" ) do={
  /ip dhcp-client add interface=ether1 disabled=no comment="defconf";
} else={
  :put "DHCP Client already exists on interface ether1.";
}

/ip dns set servers=8.8.8.8

/tr069-client set acs-url="{{.TR069AccessAddress}}" enabled=yes \
username="$sn" password="{{.TR069AccessPassword}}" periodic-inform-interval=60s

:global ToughradiusApiServer "{{.TR069AccessAddress}}";
:global ToughradiusApiToken "{{.ToughradiusApiToken}}";

:local setupdate [/system clock get date];
:local setuptime [/system clock get time];

:local note ("# Device Info \r\
    \n1. Serial Number: $sn \r\
    \n2. TR069 Setup Time: $setupdate $setuptime \r\
    \n");

/system note set note=$note;
PreviousEvent type (meaning corresponding to EVENT CODE)Nextzh-cn

Last updated 1 year ago

Was this helpful?