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
148 views 0 comments
by anonymous
We want to use RUT240 as LTE router for our device(s).

External access to our devices shall be possible. Therefore, we need to add port forwarding for port 80 (or similar) to at least ONE of the connected devices. The user can then reach the other devices by using the Web-HMI of the first one.

As LTE router (product is called gateway) and our devices are sold separately, we cannot preconfigure anything.

=> We cannot add static DHCP leases, as we don't know, which MAC addresses the devices have, which the customer buys separately.

=> We cannot add default port forwarding, as we don't know, which IP-addresses the devices will get from the DHCP server.

Possible solutions, which I can think of:

(A) Make the DHCP server to always start with the same address, so that we are sure, that a fixed IP address will always by there in the network. => Then, we can add a default port forwarding to this IP address in our production.

(B) Run a script on the router, which adds port forwarding for the first or all DHCP leases dynamically. => But how to do this?

Maybe, there is an even simpler solution, which just does not come to my mind...

Thanks in advance!

Andreas

1 Answer

0 votes
by anonymous

Hello,

(A) option does not seem viable, as is is not possible to set the specific IP, which is to be leased first. It is only possible to set the first IP address as a starting point for a DHCP pool.

As for the script, I guess it would be possible, but I cannot provide you with the one. The idea would be to store the leased IP in a variable and use UCI to set options to configure port forwarding based on the Redirects section in the OpenWRT firewall configuration page

Commands to be executed can be written in /etc/rc.local file. You can find more details here.

Best regards,