FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
1,322 views 1 comments
by anonymous
Hi,

During configuration of an RUT240, we accidentally configured both the webGUI and a port forward on port :443 of the Teltonika, resulting in locking ourselves out of the webGUI over remote connection.

We still have remote access to the Teltonika over SSH on port 22. I was looking through the FAQ and wiki page but couldn't find any information on how to change port forwarding configuration through the CLI.

Alternatively (which might be easier), we could temporarily change the WebUI port to regain WebUI access and then use the WebUI to correct all port settings.

I was hoping someone on this board would know what procedure / commands to follow and use to remove/edit a port forwarding rule through the CLI?

Many thanks in advance for your help!

Best regards,

Django

1 Answer

0 votes
by anonymous

Hello

Thanks for contacting TELTONIKA | Crowd-support forum.

Please find below the commands to edit a port forwarding rule through the CLI:

Show the current configuration:

root@Teltonika-RUT240:~# uci show firewall.@redirect[0]

firewall.cfg163837=redirect

firewall.cfg163837.src='wan'

firewall.cfg163837.name='DEMO'

firewall.cfg163837.src_dport='443'

firewall.cfg163837.target='DNAT'

firewall.cfg163837.dest_ip='192.168.240.240'

firewall.cfg163837.proto='tcp'

firewall.cfg163837.dest='lan'

firewall.cfg163837.dest_port='80'

Edit external port:

root@Teltonika-RUT240:~# uci set  firewall.@redirect[0].src_dport='8080'

root@Teltonika-RUT240:~# uci commit

root@Teltonika-RUT240:~# /etc/init.d/firewall  restart

 Check the configuration again:

root@Teltonika-RUT240:~# uci show firewall.@redirect[0]

firewall.cfg163837=redirect

firewall.cfg163837.src='wan'

firewall.cfg163837.name='DEMO'

firewall.cfg163837.target='DNAT'

firewall.cfg163837.dest_ip='192.168.240.240'

firewall.cfg163837.proto='tcp'

firewall.cfg163837.dest='lan'

firewall.cfg163837.dest_port='80'

firewall.cfg163837.src_dport='8080'

More information can be found here.

Please note that it’s necessary to open a port different than 80 || 443.

80 and 443 are default port for RUT240  HTTP(S) access. In order to open a port, go to NETWORK > FIREWALL > TRAFFIC RULES and scroll down to the bottom of page, there’s a section for ADD NEW INSTANCE, select OPEN PORTS ON ROUTER and then specify which port should be opened on the EXTERNAL PORT field, for example 8080.

More information can be found here.

The Port forwarding section would be similar to:

- NAME: DEMO

- External port: 8080

- Internal IP address: IP address of end device

- Internal port: 80 || 443

More information can be found here.

The end device, default gateway IP should be specified in network configuration, without it, the port forward might not work. Although default gateway IP usually will be obtained by default if DHCP will be used between the RUT240 and end device

Should you need any additional information please let us know.

Best regards

Best answer
by anonymous
Hi,

Thanks for the quick and very complete response. We resolved the issue within 30min, great support!