Intel® Simics® Simulator for Intel® FPGAs: User Guide

ID 784383
Date 12/04/2023

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents Example of SSH Connection With Outgoing Port Forwarding

The following example shows an SSH connection from the simulated target system to the host PC. In this example, you are connecting through SSH from the target system serial console to the port 22 in host PC.

The setup is done using the connect-real-network-port-out command. Define the service node port as 4022. The Ethernet link corresponds to ethernet_swith0. For host PC side, define (target of forwarding ports) its IP for the target-IP argument, and the port to forward the outgoing messages is defined as 22.

HostPC | Target system
 Outgoing      22 <- 4022
#Intel Simics simulator CLI 

simics> connect-real-network-port-out service-node-port = 4022 ethernet-link 
= ethernet_switch0 target-ip= target-port=22 -tcp TCP port 4022 on link -> host
ff02::1:2 TCP port 4022 on link -> host
Warning: This can expose the target system on the host local network.
simics> list-port-forwarding-setup TCP port 4022 on link -> host
ff02::1:2 TCP port 4022 on link -> host
simics> run

Once you are done with the outgoing forwarding port setup, the SSH connection can be established from the simulated target system. The user is defined as simicsUser. In the example, the SSH connection in the target system always talks directly with the service node (service node IP and port 4022) regardless of the IP in the host PC. You can have a static configuration in the target software side, and the host IP is only used in the Intel® Simics® simulation set up when creating the forwarding port.

Once you input the ssh command, observe that you can connect to the host PC from the target system.

# Target Serial Console

root@psgdevice:~# ssh simicsUser@ -p 4022

SimicsUser@'s password: 
Welcome to Ubuntu 20.04.4 LTS (GNU/Linux 5.15.0-52-generic x86_64)
* Documentation:
* Management:
* Support:
Your Hardware Enablement Stack (HWE) is supported until April 2025.
Last login: Mon Nov 14 11:10:17 2022 from
simicsUser@simicsUser-linux-lab:~$ whoami
simicsUser@simicsUser-linux-lab:~$ exit
Connection to closed.