1. Introduction

TR-069 (Technical Report 069), officially known as the CPE WAN Management Protocol, is an industry-standard protocol developed by the Broadband Forum. It is designed to facilitate communication and management between remote devices (such as routers, modems, set-top boxes, etc.) and the Auto Configuration Server (ACS). The goal of TR-069 is to simplify and automate the deployment, configuration, management, and maintenance processes of broadband devices. Through this protocol, service providers (ISPs) can remotely manage millions of user devices, improving operational efficiency, reducing maintenance costs, and enhancing user experience. This article describe how to manage Milesight routers via TR069 protocol.

 

2. Requirements

  • Ubuntu Server 20.04.6
  • Milesight router: UR3x with firmware version 3x.3.0.8 or later
  • Network Connectivity between the router and Ubuntu Server, ensuring the following ports are open: 7547, 7443, 3000, 7557, 9091

 

3. Setting Up the GenieACS Server

GenieACS is a high performance Auto Configuration Server (ACS) for remote management of TR-069 enabled devices. It utilizes a declarative and fault tolerant configuration engine for automating complex provisioning scenarios at scale. Refer primarily to the articles in the Installation Guide for detailed instructions.

 

3.1. Install Node.js Environment

Note: The version must be 12.x; other versions are not compatible.

sudo apt-get update
sudo apt-get install -y curl gnupg
curl -fsSL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs

 

 

3.2. Install MongoDB Database

Note: The version must be 3.6 or later; other versions are not compatible.

echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
sudo apt update
sudo apt install mongodb-org
sudo systemctl start mongod.service
sudo systemctl status mongod.service
sudo systemctl enable mongod.service

 

3.3. Install GenieACS System

sudo npm install -g [email protected]

Wait for the installation to complete.

 

3.4. Create Configuration Files

sudo useradd --system --no-create-home --user-group genieacs
mkdir /opt/genieacs
mkdir /opt/genieacs/ext
chown genieacs:genieacs /opt/genieacs/ext

Edit the configuration file:

vi /opt/genieacs/genieacs.env
Enter the following content:
GENIEACS_CWMP_ACCESS_LOG_FILE=/var/log/genieacs/genieacs-cwmp-access.log
GENIEACS_NBI_ACCESS_LOG_FILE=/var/log/genieacs/genieacs-nbi-access.log
GENIEACS_FS_ACCESS_LOG_FILE=/var/log/genieacs/genieacs-fs-access.log
GENIEACS_UI_ACCESS_LOG_FILE=/var/log/genieacs/genieacs-ui-access.log
GENIEACS_DEBUG_FILE=/var/log/genieacs/genieacs-debug.yaml
NODE_OPTIONS=--enable-source-maps
GENIEACS_EXT_DIR=/opt/genieacs/ext
Continue by executing:
node -e "console.log(\"GENIEACS_UI_JWT_SECRET=\" + require('crypto').randomBytes(128).toString('hex'))" >> /opt/genieacs/genieacs.env
Set the appropriate ownership and permissions:
sudo chown genieacs:genieacs /opt/genieacs/genieacs.env
sudo chmod 600 /opt/genieacs/genieacs.env
Create the log directory and set ownership:
mkdir /var/log/genieacs
sudo chown genieacs:genieacs /var/log/genieacs


3.5. Create System Service Files

 

(1) Create the CWMP Service File:

touch /etc/systemd/system/genieacs-cwmp.service

Enter the following content:

[Unit]
Description=GenieACS CWMP
After=network.target

[Service]
User=genieacs
EnvironmentFile=/opt/genieacs/genieacs.env
ExecStart=/usr/bin/genieacs-cwmp

[Install]
WantedBy=default.target


(2) Create the FS Service File:

touch /etc/systemd/system/genieacs-fs.service

Enter the following content:

[Unit]
Description=GenieACS FS
After=network.target

[Service]
User=genieacs
EnvironmentFile=/opt/genieacs/genieacs.env
ExecStart=/usr/bin/genieacs-fs

[Install]
WantedBy=default.target


(3) Create the NBI Service File:

touch /etc/systemd/system/genieacs-nbi.service

Enter the following content:

[Unit]
Description=GenieACS NBI
After=network.target

[Service]
User=genieacs
EnvironmentFile=/opt/genieacs/genieacs.env
ExecStart=/usr/bin/genieacs-nbi

[Install]
WantedBy=default.target

 

(4) Create the UI Service File:

touch /etc/systemd/system/genieacs-ui.service

Enter the following content:

[Unit]
Description=GenieACS UI
After=network.target

[Service]
User=genieacs
EnvironmentFile=/opt/genieacs/genieacs.env
ExecStart=/usr/bin/genieacs-ui

[Install]
WantedBy=default.target


(5) Create the Logrotate Configuration:

touch /etc/logrotate.d/genieacs

Enter the following content:

/var/log/genieacs/*.log /var/log/genieacs/*.yaml {
    daily
    rotate 30
    compress
    delaycompress
    dateext
}


3.6. Configure Startup on Boot

sudo systemctl enable genieacs-cwmp
sudo systemctl enable genieacs-nbi
sudo systemctl enable genieacs-fs
sudo systemctl enable genieacs-ui


3.7. Start the System

sudo systemctl start genieacs-cwmp
sudo systemctl status genieacs-cwmp

sudo systemctl start genieacs-nbi
sudo systemctl status genieacs-nbi

sudo systemctl start genieacs-fs
sudo systemctl status genieacs-fs

sudo systemctl start genieacs-ui
sudo systemctl status genieacs-ui


3.8. Access the Web UI

Use the Chrome browser to visit http://[Ubuntu Server IP Address]:3000. Enter the username admin and password admin to log in.

 

 

 

4. Integrate Milesight Router with GenieACS

  • Navigate to the Service > TR-069 page of router web GUI, enable TR069 option.
  • In the ACS Setting URL field, enter http://[Ubuntu Server IP Address]:7547/.   Note: Ensure the port is 7547 and do not omit the trailing slash.
  • Enter ACS Username and Password both as admin.
  • Check the Enable Period Inform option under CPR Setting.
  • Click Save. At this point, the CPE Username and CPE Password will be filled in automatically without manual operation.

 

5. Result Verification

Wait for a moment, and the connected device information will be displayed in GenieACS's Devices section.

 

Click Show to view the parameter information pushed by the device.

 

 

-END-