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
119 views 2 comments
by anonymous
Dear all,

Please find one simple architecture and guide me how to configure NAT in our teltonika router.

What will be LAN and Gateway ip in out router? Etc...

I'm beginner in networking.

Thanks in advance.

1 Answer

0 votes
by anonymous
Hello,

Could you please provide more details about your objectives and requirements? What is it exactly that you are trying to achieve?

What exactly do you need to NAT?

What networks should be reachable and from what devices/networks?

It would also be helpful to know how you want the devices in the topology to access the internet.

Lastly, you mentioned the RUT300 device in the provided topology. Could you please clarify which device in the topology corresponds to the RUT300?

Kind Regards,

Andzej
by anonymous
Hi Mr. Andzejj,

Thanks for your answer.

As you see architecture, Consider that IP Series 192.168.100.2 & 192.168.100.3 for system - 1. There is another system - 2 with same IP series. That's why we want to convert this series network in 172.24.xxx.xxx.

Let me explain the system architecture again in details. (As previous architecture)

192.168.100.1 will be RUT300

192.168.100.2 will be Web box

192.168.100.3 will be HMI

Web box and HMI will be connect with RUT300 via LAN Cable.

Web box is interacting with 172.24.xxx.xx

172.24.xxx.xxx will be another server display.

I want to convert 192.168.100.xxx to 172.24.xxx.xxx.

Thank you.
by anonymous

Hello,

Sorry, I am not sure that if I understood everything. Though, it seems like you want to interconnect 2 sites (systems) with same IP networks.

If so, the RUT router should be in between networks to route traffic and the other side should be connected to the WAN port. 

If you're looking for 1-to-1 NAT between 192.168.100.x and 172.24.xxx.xxx , you can find a configuration example on our wiki page here.

In case you are looking to interconnect same networks (you mention that both systems have same IP), then you can also use NETMAP. Here's an example of NETMAP rules (change the IP addresses as you need):

Router1:

  • iptables -t nat -I POSTROUTING -s 192.168.100.0/24 -d 192.168.20.0/24 -j NETMAP --to 192.168.30.0/24
  • iptables -t nat -I PREROUTING -s 192.168.20.0/24 -j NETMAP --to 192.168.100.0/24

Router2:

  • iptables -t nat -I POSTROUTING -s 192.168.100.0/24 -d 192.168.30.0/24 -j NETMAP --to 192.168.20.0/24
  • iptables -t nat -I PREROUTING -s 192.168.30.0/24 -j NETMAP --to 192.168.100.0/24

These rules assume that the LAN networks are 192.168.100.x on both sites. For these devices in the LAN network to reach the other 192.168.100.x network, they will need to use 192.168.20.x destination addresses and the source IP will be mapped to192.168.100.x.

For example, if the devices will try to send a packet to 192.168.20.10, the IP address will be changed to 192.168.30.10 when leaving router 1, and then when router 2 will receive the packet, it will change 192.168.30.10 to 192.168.100.10 and pass it to it LAN. Hence, rules are needed on both routers.

Kind Regards,

Andzej