How to redirect traffic from UE to another network
For this, your UE instance must have tun_setup_script enabled.
If you want traffic arriving at UE instance side to be redirected to a physical network, here is what you must do.
Prerequisite
Let's call MyNET the physical network to use.The PC running UE simulator must have an interface connected to MyNet.
Let's call ethX the name of the interface and let's assume it is connectedon a X.X.X.X/24 subnet.
We assume you are using the default ue-ifup script provided within AmarisoftUE simulator release.
All the script lines will have to be added at the end of ue-ifup script.
Create interface for UE on MyNet
For each UE, will will create a macvlan interface.
As name must be unique, we will use $ue_id to make it work on each UE.
Add the following to ue-ifup script:
Configure interface
Each UE interface must have an IP address on MyNet.
You can use DHCP:
Or configure it manually:
Note that in static case, $virt_ip must be different for each UE.
Configure NAT
Then let's configure NAT on UE:
Add port forwarding
Port forwarding will allow IP traffic reaching UE to be forwarded toanother server on MyNET.
Let's try to reach SSH server on MySSH, which IP is x.x.x.x on MyNet.
Let's test
Let's assume UE got 192.168.3.2 as IP from HSS.
Will connect to SSH server MySSH through UE.