Hello All,
I currently have an industrial application where we are trying to NAT local PLCs to our industrial network. The “Public” IP is still local, the DHCP server resides on premise, but we assign static to the PLCs we want to access.
Test Setup:
PC1 - resides on separate connection to network, DHCP IP 10.101.54.22/15, Gateway 10.100.0.1
- direct connection via ether5 through separate NIC for Mikrotik Winbox connection (IP 169.254.62.184, Mask 255.255.0.0, GW = n/a) - also route table does not route traffic through this connection.
PC2 (acting as a PLC for testing only) - resides inside MT network, Static IP 192.168.1.10/24, No Gateway (want “public” IP to be 10.100.198.41)
MT RB750R2 - RouterOS 7.14.3. Has Netmask of 255.254.0.0 (/15) and Gateway of 10.100.0.1
What Works:
Ping from PC2->PC1 successful
- Wireshark sees packet both PC2 and PC1
/tool sniffer quick ip-protocol=icmp ip-address=10.101.54.22
Columns: INTERFACE, TIME, NUM, DIR, SRC-MAC, DST-MAC, VLAN, SRC-ADDRESS, DST-ADDRESS, PROTOCOL, SIZE, CPU
INTERFACE TIME NUM DIR SRC-MAC DST-MAC VLAN SRC-ADDRESS DST-ADDRESS PROTOCOL SIZE CPU
ether2 4.237 1 <- 10:65:30:EF:F3:4A 18:FD:74:67:6B:59 192.168.1.10 10.101.54.22 ip:icmp 74 0
Bridge 4.237 2 <- 10:65:30:EF:F3:4A 18:FD:74:67:6B:59 5 192.168.1.10 10.101.54.22 ip:icmp 78 0
vl5 4.237 3 <- 10:65:30:EF:F3:4A 18:FD:74:67:6B:59 192.168.1.10 10.101.54.22 ip:icmp 74 0
ether1 4.237 4 -> 18:FD:74:67:6B:58 D4:81:D7:B1:B7:9D 10.100.198.41 10.101.54.22 ip:icmp 74 0
ether1 4.238 5 <- 18:4C:08:70:A3:C0 18:FD:74:67:6B:58 10.101.54.22 10.100.198.41 ip:icmp 74 0
vl5 4.238 6 -> 18:FD:74:67:6B:59 10:65:30:EF:F3:4A 10.101.54.22 192.168.1.10 ip:icmp 74 0
Bridge 4.238 7 -> 18:FD:74:67:6B:59 10:65:30:EF:F3:4A 5 10.101.54.22 192.168.1.10 ip:icmp 78 0
ether2 4.238 8 -> 18:FD:74:67:6B:59 10:65:30:EF:F3:4A 10.101.54.22 192.168.1.10 ip:icmp 74 0
The Issue:
Unable to ping from PC1->PC2
- Wireshark sees packet but results in timeout on both PC1 and PC2.
- makes no difference if eth5 is disconnected
/tool sniffer quick ip-protocol=icmp ip-address=10.101.54.22
Columns: INTERFACE, TIME, NUM, DIR, SRC-MAC, DST-MAC, VLAN, SRC-ADDRESS, DST-ADDRESS, PROTOCOL, SIZE, CPU
INTERFACE TIME NUM DIR SRC-MAC DST-MAC VLAN SRC-ADDRESS DST-ADDRESS PROTOCOL SIZE CPU
ether1 3.409 1 <- 18:4C:08:70:A3:C0 18:FD:74:67:6B:58 10.101.54.22 10.100.198.41 ip:icmp 74 0
vl5 3.41 2 -> 18:FD:74:67:6B:59 10:65:30:EF:F3:4A 10.101.54.22 192.168.1.10 ip:icmp 74 0
Bridge 3.41 3 -> 18:FD:74:67:6B:59 10:65:30:EF:F3:4A 5 10.101.54.22 192.168.1.10 ip:icmp 78 0
ether2 3.41 4 -> 18:FD:74:67:6B:59 10:65:30:EF:F3:4A 10.101.54.22 192.168.1.10 ip:icmp 74 0
What has been tried:
Current Configuration:
/export hide-sensitive
# 1970-01-02 00:24:39 by RouterOS 7.14.3
# software id = xxx
#
# model = RB750r2
# serial number = xxx
/interface bridge
add name=Bridge vlan-filtering=yes
/interface vlan
add comment=SCADA-INSIDE interface=Bridge name=vl5 vlan-id=5
/ip hotspot profile
set [ find default=yes ] html-directory=hotspot
/interface bridge port
add bridge=Bridge comment=SCADA-INSIDE interface=ether2 pvid=5
add bridge=Bridge comment=SCADA-INSIDE interface=ether3 pvid=5
add bridge=Bridge comment=SCADA-INSIDE interface=ether4 pvid=5
add bridge=Bridge comment=SCADA-INSIDE interface=ether5 pvid=5
add bridge=Bridge comment=SCADA-OUTSIDE disabled=yes interface=ether1
/ip neighbor discovery-settings
set discover-interface-list=all
/interface bridge vlan
add bridge=Bridge comment=SCADA-INSIDE tagged=Bridge untagged=ether2,ether3,ether5,ether4 vlan-ids=5
/ip address
add address=192.168.1.1/24 comment=SCADA-INSIDE interface=vl5 network=192.168.1.0
add address=10.100.198.41/15 comment=SCADA-OUTSIDE interface=ether1 network=10.100.0.0
/ip firewall filter
add action=accept chain=input
add action=accept chain=output
add action=accept chain=forward
/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether1
add action=netmap chain=srcnat out-interface=ether1 src-address=192.168.1.10 to-addresses=10.100.198.41
add action=netmap chain=dstnat dst-address=10.100.198.41 in-interface=ether1 to-addresses=192.168.1.10
/ip route
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=10.100.0.1 pref-src=0.0.0.0 routing-table=main scope=30 suppress-hw-offload=no target-scope=10
/system note
set show-at-login=no
From everything I have been learning, netmap should be the 1:1 mapping method. When I review the packet counters, and ping from PC1->PC2, Firewall Filter-> Forward rule increments as does dstnat rule (but only 1 time until idle for ~10 seconds). This would have me believe it was routing correctly, however it does not return to PC1 and results in a timeout.
On a ping from PC2->PC1, I don’t see any counters increment masq, srcnat, or dstnat - and yet it feeds it through and back to PC2, and I get a valid ping response - I expected to see srcnat rule increment, as it came from local 192.168.1.10 NAT’d to 10.100.198.41 out to 10.101.54.22 and back.
Anyone have any ideas what could be the main cause of PC1->PC2 not getting back to complete the ping?
Please advise if anything else can be shared that would help troubleshoot this.
Thank you,
AlphaWolfXV