Stage 3 free5gc-compose with UERANSIM, UE cannot connect to the internet

Hi!

I am following the installation in free5gc-compose github page and connected it to the UERANSIM. The docker-compose version of free5gc and UERANSIM are installed in the same PC. The free5gc-compose did not have any error and PDU session is established successfully, but I cannot ping google dot com using uesimtun0 interface.

After running ‘sudo docker-compose up’ and before I start UERANSIM, I also enter the following in my host PC

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

But still, I cannot ping google dot com using “ping -I uesimtun0 google dot com”. I attach pcap file of (possibly) N3 or N6 interface and uesimtun0 (new user can only put two links). But basically, they only have ICMP request but no response.

Does anyone know what is happening and how can I solve this? Thank you very much!!!
veth352170d.pcapng (23.5 KB)
uesimtun0.pcapng (2.1 KB)

Update: Not sure which steps are effective, but my case is solved by entering the bash of all UPFs and executing

iptables -t nat -A POSTROUTING -o enp4s0  -j MASQUERADE
iptables -I FORWARD 1 -j ACCEPT

I’d like to ask you a question
Build each NF docker compose manually, add parameters when run, no docker compose is used for management.
Free5GC runs normally, but AMF fails UE authentication, GNB is normal.

error

2021-04-05T12:19:28Z [ERRO][AMF][GMM][AMF_UE_NGAP_ID:1] Nausf_UEAU Authenticate Request Error: server no response
2021-04-05T12:19:28Z [ERRO][AMF][GMM] Authentication procedure failed

2021-04-05T12:19:47Z [INFO][AMF][NGAP][192.168.31.13:38371] UE Context Release Request
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xbf28f2]

I think you have to set these rules in the UPF container by setting the interface name to the name of the interface present in the UPF. You have also to check ip_forwarding is enabled in the UPF container.

Hi @Jqh,

This problem able to reproduce, and also fixed.

You can sync the latest code of free5gc/gtp5g and install it, and also make sure the driver version as “1.0.3a” loaded in your system.