Accessing Cadence/Synopsys/Mentor/FlexLM License Server via SSH Port Forwarding
Wednesday, March 19th, 2008 by laneIf your Cadence license server is behind a firewall, and you want to access that license server to run Cadence on a machine outside that firewall, you can do it using ssh port forwarding. You will need to have ssh access to a machine on the internal network. Let’s call that machine machine.example.com. Following are the instructions on how to set this up.
If you can, you should setup the cadence license file so that the cdslmd daemon port does not roam. If you cannot do this, then follow the directions below for finding the port that the license server daemon is using, but then every time the license server is updated, this port will change and will require repeating the steps to find the daemon port to update your .ssh/config file to match. To fix the cdslmd daemon port and prevent it from roaming, add the following line to your license file:
DAEMON cdslmd [cds_root]/tools/bin/cdslmd port=5281
This line will need added every time a new license file is obtained. Then you can setup your ~/.ssh/config file as follows:
Host machine.example.com
LocalForward 5280 license_server_hostname:5280
LocalForward 5281 license_server_hostname:5281
If you cannot fix the daemon port, then you can connect to machine.example.com and run the following commands to find the daemon port the license server is using.
lmstat -a -c $CDS_LIC_FILE netstat | grep -i license_server_hostname
You may not need the -c $CDS_LIC_FILE if your setup uses the $LM_LICENSE_FILE environment variable instead. There maybe several port connections listed by the netstat command. You may need to try different ones until you get the right one. I have noticed that Cadence ports are usually in the 30,000 range.
Now add the license server daemon port to your ~/.ssh/config file. For example, suppose that 32916 is the daemon port, then your .ssh/config file would have a section like this:
Host machine.example.com
LocalForward 5280 license_server_hostname:5280
LocalForward 32916 license_server_hostname:32916
Now on your local machine, you need to setup the $LM_LICENSE_FILE or the $CDS_LIC_FILE to point to localhost:5280. Now ssh into machine.example.com and test your connection with an lmstat command.
The 5280 port listed in the above commands may also be different in your setup if the lmgrd daemon listens on a different port. Check your $CDS_LIC_FILE or $LM_LICENSE_FILE environment variable on machine.example.com to see what port that is listening on.