I am ready to help customers realize remote IoT control between different factories through VPN network as well as 5G router, the steps are as follows:
1. Install the OpenVPN server on the cloud server
2. Install the 5G router on the device side, and in the VPN settings on the 5G router, configure it as an openVPN client and connect to the openVPN server
3. Install the OpenVPN client on the computer running the host computer and connect to the OpenVPN server
4. After completing the above settings, the 5G router and the computer form a virtual private network, they are in the same network, you can get the IP of the same network segment, and achieve mutual communication, such as the IP of the 5G router is 10.8.0.10, and the IP of the computer is 10.8.0.6
5. The output output control module and the data acquisition module are connected to the 5G router in the following ways
a) Wi-Fi AP connected to the 5G router via Wi-Fi
b) Connect to the LAN port of the 5G router through the network cable
c) Connect to the RS485 interface of the 5G router through the RS485 communication line
6. Set the LAN port IP of the 5G router, such as 192.168.31.20
7. The IP of the network device connected to the router through Wi-Fi or LAN is also set to the same network segment as the LAN of the 5G router, such as 192.168.31.21, and the address of the default gateway is set to the LAN port address of the 5G router, which is 192.168.31.20
8. Set the port mapping rules of the 5G router so that remote computers can penetrate the 5G router to access devices on the internal network
For example, set the following port forwarding rules:
Protocol: TCP
Remote port: 8080
Local IP address: 192.168.31.21
Local port: 80
Enter 192.168.31.20:8080 on the browser of the remote computer to open the web page connected to the LAN port of the 5G router with the IP address 192.168.31.21 and the output and input control module;
Use a computer to perform simple and automated testing of the entire data path.
Open the network debugging assistant software on the computer, set up a TCP client and a TCP server,
The listening port of the TCP server is 80, and automatic callback is selected;
Set the remote IP address of the 5G router on the client to 10.8.0.10 and the remote port to 8080.
Enable 500ms automatic sending and send a test data to the remote address.
After receiving the packet on port 8080, the 5G router forwards the packet to a TCP socket with IP address 192.168.31.21 and port 80 according to the forwarding rules.
The TCP server established by the network debugging assistant on the computer will receive the packet and automatically transmit it back;
According to the default gateway address of the wired network port, the computer sends the returned packet to the 5G router, and the 5G router sends the packet to the computer through the VPN network, and the TCP client established by the network debugging assistant on the computer will receive the returned packet and print it in the display area.