How to Automatically Close Remote Session in Provision Script for ONTs

Hello everyone,

I’m trying to write a provision script that opens a remote session on ONTs, but I want the session to automatically close after 10 minutes. Here’s the script I’m currently using:

declare("InternetGatewayDevice.UserInterface.RemoteAccess.Enable", t, {value: true});
declare("InternetGatewayDevice.UserInterface.RemoteAccess.Protocol", t, {value: "HTTP"});
declare("InternetGatewayDevice.UserInterface.RemoteAccess.Port", t, {value: 80});
declare("InternetGatewayDevice.User.1.Password", null, {value: 123456789});

I initially tried using setTimeout within the provision script to disable the remote access after 10 minutes, but it didn’t work as expected.

Next, I attempted to use an extension to await the script, as shown below:

declare("InternetGatewayDevice.UserInterface.RemoteAccess.Enable", t, {value: true});
declare("InternetGatewayDevice.UserInterface.RemoteAccess.Protocol", t, {value: "HTTP"});
declare("InternetGatewayDevice.UserInterface.RemoteAccess.Port", t, {value: 80});
declare("InternetGatewayDevice.User.1.Password", null, {value: 123456789});

// this just waits 10 minutes and then calls the callback
const res = ext("remove-remote", "removeRemote", "a");

declare("InternetGatewayDevice.UserInterface.RemoteAccess.Enable", t, {value: false});

Unfortunately, this introduced a configuration loop, and I suspect it’s related to this issue mentioned in the GenieACS documentation.

I’m looking for advice on how to properly implement an automatic closure of the remote session without causing a configuration loop. Any guidance or alternative approaches would be greatly appreciated!

Thanks in advance!

Create an ACL to restrict access to the web gui to just your server IP. Then you can leave the remote access enabled all the time. This is the approach I take.

Thanks for your answer, We do have ACL for some of our ONT’s but this feature is a crucial to us so we are looking to implement this auto-remote closing mechanism, please show me the correct path to take I’ll do it.

I was about to develop a simple API and connect it to the provision script using Extension but I’m looking for a native solution within GenieACS.

Thanks