CodeShepherd
Community Moderator
Options
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
03-06-2023
09:30 AM
Content
This expert guide shows how to configure the ctrlX COREvirtual and your network to communicate to external applications via TCP using Node-RED. This can be adapted to different IP based protocols.
Requirements
- Know how about network architecture and communication
- ctrlX WORKS (1.18.1) installed on host PC
- ctrlX CORE - Node-RED app (1.18.0) installed on control
- No active VPN on host operating system
Use cases
- ctrlX COREvirtual in port forwarding mode communicating to a device on the network
- Two ctrlX COREvirtual in port forwarding mode communicating to each other
- ctrlX COREvirtual network adapter mode communicating with network device
Explanation
1 ctrlX COREvirtual in port forwarding mode communicating to a device on the network
- For sending a request from ctrlX COREvirtual to a server on a network device
- start ctrlX COREvirtual in port forwarding mode and set IP (e.g. 192.168.2.2) to a different subnet as the real network device e.g. ctrlX CORE (e.g. 192.168.1.1) connected to your PC, so data is routed correctly via the standard gateway in ctrlX COREvirtual
- Choose a port you like to communicate over e.g. 1111 and use IP of your network device e.g. 192.168.1.1
- start ctrlX COREvirtual in port forwarding mode and set IP (e.g. 192.168.2.2) to a different subnet as the real network device e.g. ctrlX CORE (e.g. 192.168.1.1) connected to your PC, so data is routed correctly via the standard gateway in ctrlX COREvirtual
- For sending a request from a network device to a server ctrlX COREvirtual
- enter in ctrlX WORKS in the ctrlX COREvirtual port forwarding settings one additional port you like to communicate over e.g. "8022:22,8443:443,8740:11740,4840:4840,2222:2222"
- Add an inbound rule to your Windows firewall for chosen port to let the data path through
- Use chosen port e.g. 2222 and IP address of the network adapter of your PC the network device is connected to e.g. 192.168.1.87
- Start communication in both directions:
1.1 ctrlX COREvirtual in port forwarding mode communicating to ctrlX COREvirtual in network adapter mode
See use case 1 "ctrlX COREvirtual in port forwarding mode communicating to a device on the network"
2 Two ctrlX COREvirtual in port forwarding mode communicating to each other
- Enter in ctrlX WORKS in one ctrlX COREvirtual port forwarding settings one additional port you like to communicate over e.g. "8022:22,8443:443,8740:11740,4840:4840,2222:2222"
- The other one needs completely different ports e.g. add a one in front of all standard ports and add one additional for communication e.g. "18022:22,18443:443,18740:11740,14840:4840,1111:1111"
- Use on both sides an IP of one of a active network adapter of your host operating system for communication e.g. 192.168.0.120, so the data is rooted via the standard gateway
- Start communication in both directions:
3 ctrlX COREvirtual network adapter mode communicating with network device
At least two ways are possible:
- Forwarding ports in Windows netsh portproxy:
- start ctrlX COREvirtual in network adapter mode and set IP (e.g. 192.168.2.2) to a different subnet as the real network device e.g. ctrlX CORE (e.g. 192.168.1.1) connected to your PC. Beware that the IP of the Windows network adapter the ctrlX CORE is connected to needs to be adjusted accordingly e.g. 192.168.2.3, to be able to communicate again.
- Choose ports to communicate to virtual control e.g. 2222 and to real control e.g. 1111
- Use command line tool to setup host operating system (see example code batch file attached)
- Add an inbound rule to your Windows firewall for chosen ports to let the data path through
netsh advfirewall firewall add rule name=portproxy-2222 dir=in action=allow protocol=TCP localport=2222 netsh advfirewall firewall add rule name=portproxy-1111 dir=in action=allow protocol=TCP localport=1111
- Add forwarding rule to Windows portproxy interface that gets all packages coming from the IP of the Windows network adapter the real ctrlX CORE is connected to and forward it to the ctrlX COREvituals IP
netsh interface portproxy add v4tov4 listenaddress=192.168.1.3 listenport=2222 connectaddress=192.168.2.2 connectport=2222
-
Add forwarding rule to Windows portproxy interface that gets all packages coming from the IP of the Windows network adapter the ctrlX COREvirtuals is connected to and forward it to the real ctrlX CORE IP
netsh interface portproxy add v4tov4 listenaddress=192.168.2.3 listenport=1111 connectaddress=192.168.1.1 connectport=1111
- Add an inbound rule to your Windows firewall for chosen ports to let the data path through
- Start communication in both directions:
- Bridging Windows network adapters (could be restricted by network administrator):
- Start ctrlX COREvirtual in network adapter mode and set IP (e.g. 192.168.1.2) to the same subnet as the real ctrlX CORE (e.g. 192.168.1.1) connected to your PC
- Bridge in your Windows network connections, the virtual network adapter with the real one, so data is routed between both correctly
- To get access to the devices again enter a IPv4 address to the network bridge in the same subnet as your devices e.g. 192.168.1.3
- Start communication in both directions:
3.1 Two ctrlX CORE in network adapter mode communicating to each other
See use case 3 "ctrlX COREvirtual network adapter mode communicating with network device"
3.2 Two external Network devices communicating to each other
See use case 3 "ctrlX COREvirtual network adapter mode communicating with network device"
Related information
- For some general information about network functionality of the mechanism ctrlX COREvirtual is using in port forwarding mode see this external page https://wiki.qemu.org/.
- How to: Connect ctrlX COREvirtual to the internet
CodeShepherd
Technical sales support from Bosch Rexroth
1 Comment