5. Testing UERANSIM against free5GC - anhtien17/free5GC GitHub Wiki

1. Run on free5gc VM

  • Run network setting (must do everytime rebooting):

       sudo sysctl -w net.ipv4.ip_forward=1
       sudo iptables -t nat -A POSTROUTING -o enp0s3 -j MASQUERADE
       sudo systemctl stop ufw
       sudo iptables -I FORWARD 1 -j ACCEPT
    
  • Run free5gc:

       cd ~/free5gc
       ./run.sh
    

    At this time free5GC has been started.

2. Run on ueransim VM

  • Open a Terminal 1, execute nr-gnb and leave it running:

       cd ~/UERANSIM
       sudo build/nr-gnb -c config/free5gc-gnb.yaml
    
  • Open a Terminal 2, execute nr-ue and leave it running:

       cd ~/UERANSIM
       sudo build/nr-ue -c config/free5gc-ue.yaml
    
  • Open a Terminal 3, ping 192.168.31.101 to see free5gc is alive. Then, use ifconfig to see if the tunnel uesimtun0 has been created (by nr-ue).

  • Ping google.com via the tunnel uesimtun0 to test the connection to the internet via 5G core network.

       ping -I uesimtun0 google.com
    

    If ping gets replies, then free5GC is running properly. Congratulations!