TCP communication doesn't work under VPN

조회 수: 3 (최근 30일)
Deja
Deja 2024년 11월 5일
답변: sidik 2024년 11월 5일
Hi
I'm using Simulink and TCP communication to transfer data from one computer to another. Both models of sender and receiver run under Simulink Desktop Real-TIme so I use Packet Input/Output block to configure TCP. When both computers are under same LAN, TCP communication works fine. I can receive data transfered by the sender computer. But when I use a VPN on the receiver computer, I cannot receive data any more. VPN acutally makes both computers still under the same LAN. I can ping the sender computer successfully.
When using VPN, I have three IPs. IP of sender computer (IP A), IP of VPN (IP B) and IP of receiver computer (IP C). How can I model and configure in Simulink to make TCP communication work again? Thank you!
  댓글 수: 2
Sumukh
Sumukh 2024년 11월 5일
Are you referring to the following example model?:
Deja
Deja 2024년 11월 5일
To Sumukh:
No. Actually I have two models running on two computers. One model uses Packet Input and the other uses Packet Output.

댓글을 달려면 로그인하십시오.

답변 (1개)

sidik
sidik 2024년 11월 5일
hello @Sumukh
I would like to ask why you would want to use a VPN when communicating over a local network. What specific goals do you aim to achieve with a VPN?
It's important to note that when using a VPN, the IP address used by Simulink for TCP communication might cause issues. Simulink could attempt to forward packets to an improperly configured address for the VPN tunnel. Here are some steps to resolve this issue:
1. Check the configuration of the Packet Input and Packet Output blocks in Simulink to ensure they use the IP address that is accessible via the VPN.
2. Verify the firewall settings to allow TCP traffic on the relevant ports for both computers.
3. If necessary, add static routes to ensure that traffic is directed through the VPN interface. You can execute the following command:
```
route add <IP_C> mask 255.255.255.255 <IP_B>
```
- `<IP_C>` is the receiver address.
- `<IP_B>` is the IP address of the VPN interface.
4. Review the VPN settings to ensure it is not blocking TCP traffic between the two addresses.

카테고리

Help CenterFile Exchange에서 Development Computer Setup에 대해 자세히 알아보기

태그

제품


릴리스

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by