First, thanks for this project, I was able to install OpenWrt on my TPLink RE450 in minutes
I am new to OpenWrt and have only a basic understanding of networking. It's not that I have no idea on how the things work, but there was never a need to dive to deep.
I am sorry if my question is already asked several times or is dump, but I was not able to find how to configure OpenWrt to redirect a global ip to a local one.
My problem is:
I have a couple of smart devices that communicate to a specific ip address (similar to 18.104.22.168), however I found that everyone out there is able to control these devices because the server is not really secured. So I want to forward the call to the server's ip address to a local one (eg 192.168.178.30) and run my own server on this device.
No, that line won't work. You can use /etc/hosts to associate a hostname with the addition IP address. But the address itself has to added in the network configuration. How it's done depends on the operating system, and method that's used.
No, and better use the UCI or Luci for that.
A SNAT will be needed as well.
I think the easiest way to do it in one shot is to make a redirect from wan to that IP and enable nat loopback so that traffic from lan going to that IP will also be redirected to the lan host. It will also create the necessary SNAT.
mikma, thank you again, I missed your comment...
The server is a Pi3 and I used this command as alternative: sudo ip addr add 22.214.171.124 dev wlan0
With this line executed, ping gives me the expected result from the pi/server. And "ip addr" shows:
Thank you all! @trendy configuration works perfectly after I have added an additional VLAN interface and configured wan.
Local DNS is not working for devices in the first router but I will investigate in this later.
Thanks for your patience with me!