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