How do I configure Windows Defender Firewall for MATLAB to communicate with external hardware such as Speedgoat?

289 views (last 30 days)
There is an issue with the Windows Defender Firewall preventing access to my Speedgoat target computer, or other hardware that I connect using Ethernet. How do I configure Windows Defender Firewall to allow a connection between MATLAB (or my MATLAB-generated standalone application) and my hardware?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 4 Mar 2024
Edited: MathWorks Support Team on 4 Mar 2024
MATLAB, or any standalone applications generated with MATLAB, must be allowed to communicate on all types of networks through Windows Defender Firewall. 
This answer presents 3 possible solutions to allow MATLAB through Windows Defender Firewall:
  • Solution 1: Use Windows Defender Firewall Prompt on First Connection
  • Solution 2: Manually allow MATLAB through Windows Defender Firewall
  • Solution 3: Create inbound and outbound rules for MATLAB in Windows Defender Firewall
Important notes:
  1. We recommend going through the steps below with your IT team and/or a system administrator.
  2. When allowing access for a standalone application, use Solution 2 or 3. Make sure that the application (e.g. "slrt_app.exe") is added to your firewall exception list rather than "matlab.exe".
  3. You must repeat the procedure below for every installed version of MATLAB and every standalone application that you intend to use with external hardware. The same applies if you upgrade MATLAB to a newer version at any point in the future.
  4. The steps below may also have to be repeated after any company-wide IT rollouts or Windows Updates, as firewall settings may be reset as part of this. 

SOLUTION 1: Use Windows Defender Firewall Prompt on First Connection

When you first try to connect to a target computer from a certain MATLAB release, Windows Defender Firewall prompts you to allow MATLAB to communicate on Private and Public networks:
1) Make sure that all options, including Private and Public options, are selected. 
⚠️ If the Public network option is not available (disabled/grayed out) -- refer to the article: How can I establish communication with a Speedgoat target computer via an Ethernet interface configured as 'Public'?
2) Click Allow access.

SOLUTION 2: Manually allow MATLAB through Windows Defender Firewall

In case you missed the above prompt, or did not check all options when prompted, you can configure the firewall manually:
1) Find Allow an app through Windows Firewall by using the Windows search.
2) Click the Change settings button if necessary to unlock the panel.
⚠️ If the Change settings button is disabled for you, contact your IT helpdesk.
3) Click Allow another app.
4) Click Browse to browse for <matlabroot>\bin\win64\matlab.exe. Or, if configuring a standalone application, include the file path for your standalone executable. 
5) Click Network Types.
6) As the Network Type for MATLAB, select all options, including Private and Public.
⚠️ If the Public network option is not available (disabled/grayed out) -- refer to the article: How can I establish communication with a Speedgoat target computer via an Ethernet interface configured as 'Public'?
7) Click Add.

SOLUTION 3: Create inbound and outbound rules for MATLAB in Windows Defender Firewall

If the above solutions don't help, try to configure additional Inbound and Outbound Rules in the Advanced Windows Defender Firewall settings. We recommended getting help from your IT helpdesk for this solution:
1) Find Windows Defender Firewall with Advanced Security by using the Windows search.
2) Select Inbound Rules and New Rule.
3) For the Rule Type, select Program, and click Next.
4) Select This program path and browse for <matlabroot>\bin\matlab.exe. 
5) For the Action, select Allow the connection, and click Next.
6) For the Profile, select the DomainPrivate, and Public checkboxes, and click Next.
⚠️ If the Public network option is not available (disabled/grayed out) -- refer to the article: How can I establish communication with a Speedgoat target computer via an Ethernet interface configured as 'Public'?
7) For Name, provide a Name for this inbound rule (for example, Simulink Real-Time inbound), and click Finish.
8) Select Outbound Rules and click New Rule.
9) Repeat steps 3 through 7 for the custom outbound rule.
If any of the above options are not available due to IT policy, or the communication still fails, please contact your IT helpdesk to verify your firewall rules.

Further Troubleshooting

If the above instructions don't help resolve the communication issues with your Speedgoat hardware, refer to the following MATLAB Answers post for further troubleshooting steps:

More Answers (0)

Community Treasure Hunt

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

Start Hunting!