How to set up routing between Hosts (Linux/Windows) <-> LfC (Linux/Windows WSL2) <-> VCL <-> Lock - network?



#Configuration on LfC via webinterface:

#set static route to host OS

Interface: LAN

Host-IP: 192.168.100.0

Netmask: 255.255.255.0

Gateway: leave empty


#Configuration on Linux PLC / LfC-Host 

#Set up firewall to allow communication from Host-OS to Docker container:

iptables -I DOCKER-USER 1 -s 10.0.0.0/24 -i eth0 -j ACCEPT
iptables -I DOCKER-USER 1 -m state --state ESTABLISHED,RELATED -j ACCEPT
ip route add 10.10.10.0/24 via 10.10.32.2 (gone after reboot)


#Configuration on Windows machine wants to connect via local network through LfC:

#not permanent route (gone after reboot):

route add 10.10.10.0 mask 255.255.255.0 192.168.100.218


#permanent route:

route add -p 10.10.10.0 mask 255.255.255.0 192.168.100.218

--->#192.168.100.218 is the Host IP (LfC runs on)



#Configuration on VCL:

add LfC and Lock in same access group - allow communciation



#Functional test - ping from Laptop to Locks network device:

 C:\WINDOWS\system32>ping 10.10.10.244 -t

Pinging 10.10.10.244 with 32 bytes of data:
Reply from 10.10.10.244: bytes=32 time=19ms TTL=60
Reply from 10.10.10.244: bytes=32 time=27ms TTL=60
Reply from 10.10.10.244: bytes=32 time=20ms TTL=60

Ping statistics for 10.10.10.244:
{{ Packets: Sent = 3, Received = 3, Lost = 0 (0% loss),}}
Approximate round trip times in milli-seconds:
{{ Minimum = 19ms, Maximum = 27ms, Average = 22ms}}


#Statistics: Host-OS routing table:

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.100.254 0.0.0.0 UG 20 0 0 br0
10.10.10.0 10.10.32.2 255.255.255.0 UG 0 0 0 br-8d20aee35091
10.10.32.0 * 255.255.255.0 U 0 0 0 br-8d20aee35091
172.17.0.0 * 255.255.0.0 U 0 0 0 docker0
192.168.3.0 * 255.255.255.0 U 0 0 0 br1
192.168.100.0 * 255.255.255.0 U 0 0 0 br0
224.0.0.0 * 224.0.0.0 U 0 0 0 br1
224.0.0.0 * 224.0.0.0 U 0 0 0 br0
root@PFC200V3-45A375:/

 


#Statistics: Windows Laptop routing table:

On Windows Laptop:

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.101.254 192.168.101.54 306
0.0.0.0 0.0.0.0 192.168.100.254 192.168.100.33 35
10.10.10.0 255.255.255.0 192.168.100.218 192.168.100.33 36
127.0.0.0 255.0.0.0 On-link 127.0.0.1 331
127.0.0.1 255.255.255.255 On-link 127.0.0.1 331
127.255.255.255 255.255.255.255 On-link 127.0.0.1 331
172.23.240.0 255.255.240.0 On-link 172.23.240.1 271
172.23.240.1 255.255.255.255 On-link 172.23.240.1 271
172.23.255.255 255.255.255.255 On-link 172.23.240.1 271
192.168.100.0 255.255.255.0 On-link 192.168.100.33 291
192.168.100.33 255.255.255.255 On-link 192.168.100.33 291
192.168.100.255 255.255.255.255 On-link 192.168.100.33 291
192.168.101.0 255.255.255.0 On-link 192.168.101.54 306
192.168.101.54 255.255.255.255 On-link 192.168.101.54 306
192.168.101.255 255.255.255.255 On-link 192.168.101.54 306
224.0.0.0 240.0.0.0 On-link 127.0.0.1 331
224.0.0.0 240.0.0.0 On-link 192.168.100.33 291
224.0.0.0 240.0.0.0 On-link 192.168.101.54 306
224.0.0.0 240.0.0.0 On-link 172.23.240.1 271
255.255.255.255 255.255.255.255 On-link 127.0.0.1 331
255.255.255.255 255.255.255.255 On-link 192.168.100.33 291
255.255.255.255 255.255.255.255 On-link 192.168.101.54 306
255.255.255.255 255.255.255.255 On-link 172.23.240.1 271
===========================================================================
Persistent Routes:
Network Address Netmask Gateway Address Metric
0.0.0.0 0.0.0.0 192.168.101.254 Default
==========================================================================