UPF not connecting to internet

Tried many configurations, but it seems the data packets get stuck at UPF and UPF is not connecting to internet.
PDU Session is successfully established via gNB.
From UE if I ping 8.8.8.8, it reaches upfgtp (checked in wireshark), but not beyond UPF and ping returns 100% packet loss.

Any pointers for this be appreciated.

Thanks,
Pradnya

Did you do the Linux network settings as below:

  1. Linux Host Network Settings
    sudo sysctl -w net.ipv4.ip_forward=1
    sudo iptables -t nat -A POSTROUTING -o <dn_interface> -j MASQUERADE
    sudo systemctl stop ufw

Make sure your ip_forward setting with “sudo sysctl -p” and your iptables setting with “iptables-save”.
Besides, here is a similar issue: How the simulated UE provided by free5GC can ping google.com - #4 by vikash, that might help with your problem. If it doesn’t work, please provide us with your environment description, and trace files like PCAP file, Config file, log file, so that we can figure out the bug.