TCP communication doesn't work under VPN

12 ビュー (過去 30 日間)
Deja vu
Deja vu 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 vu
Deja vu 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 Center および File ExchangeModel Preparation for Real-Time Simulation についてさらに検索

タグ

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by