MATLAB: Error 96 when using MATLAB on VPN network: Linux

error -96firewallvpn

I installed MATLAB on my laptop yesterday (Ubuntu 16.04).
I'm on an academic licence, so I need to be connected to my university network. I set it up yesterday on campus connected to their wifi and MATLAB was running fine after I installed it.
However today I have tried to open matlab in the same way I opened it on campus. The difference this time is I am not on campus and I am connected to their network via VPN.
I get the error:
License checkout failed.
License Manager Error -96
MATLAB is unable to connect to the license server.
Make sure that the MATLAB client machine can communicate with the hostname listed in the SERVER line
of the license file, and that the port listed in the SERVER line is not blocked by a firewall.
Troubleshoot this issue by visiting:
http://www.mathworks.com/support/lme/R2016b/96
Diagnostic Information:
Feature: MATLAB
License path: /home/<username/.matlab/R2016b_licenses:/home/<username/Matlab/licenses/license.dat:/home/<username>/Matlab
/licenses/network.lic
Licensing error: -96,7. System Error: 2
I'd like to add that I checked the VPN connection and it said the connection was established. Since MATLAB won't run on any device not connected to the network, there must be something (firewall maybe?) blocking this.

Best Answer

Ok so I entered the ping command, worked fine, Then I entered a netcat command and this also succeeded. I launched matlab again and it opened.
The commands were:
ping -c10 'server address from the "SERVER" line in the licence file'
netcat -vz 'server address from the "SERVER" line in the licence file' xxxxx
the xxxxx is a number that was in the server line also, there was a code before it, but that wasn't needed in the netcat command. Chances are your licence file's server line will be a different format, but mine was as follows: SERVER licsrvname.uni.ac.uk 00000000000Y xxxxx
so my netcat command was
netcat -vz licsrvname.uni.ac.uk xxxxx