OpenWRT GUI NAT Configuration

Dear Expert,

i am confused with the NAT setup in OpenWRT GUI. My setup as below:
Robot(192.168.1.100) -----------5G Modem with Static IP(10.70.1.110)-----<5G wireless> ----Application hosted in my VM server(10.11.1.11).

I need to allow robot to communicate to the VM and vice versa. My VM able to communicate to 5G modem, however when i tried ping to Robot from VM, it was not reachable. What could be wrong at my NAT configuration?

My NAT rule configuration at OpenwRT GUI:
Protocol: Any
Source Address: 10.11.1.11
Destination address: 192.168.1.100
Action: SNAT -Rewrite to specific source IP or port
Rewrite Ipaddress: 10.70.1.110

What is the right configuration for my VM to reach 5G modem and translate the IP to reach the Robot IP?

Any thing that i missed out here?

and lets see the results of 'ifconfig' from the device running the VMs

You need a redirect (DNAT) not SNAT.
An example for TCP port 443, outside zone is wan, inside zone is lan, adjust to your needs.

uci add firewall redirect
uci set firewall.@redirect[-1].dest='lan'
uci set firewall.@redirect[-1].target='DNAT'
uci set firewall.@redirect[-1].name='robot'
uci add_list firewall.@redirect[-1].proto='tcp'
uci set firewall.@redirect[-1].src='wan'
uci set firewall.@redirect[-1].src_dport='443'
uci set firewall.@redirect[-1].dest_ip='192.168.1.100'
uci set firewall.@redirect[-1].reflection='0'
uci set firewall.@redirect[-1].src_ip='10.11.1.11'
uci commit firewall
service firewall restart
1 Like