How the simulated UE provided by free5GC can ping

Yes. it shall do snat convert ,so that the ip routeing behind the interface can return back to ue.

Hi @thornton.
I followed your instructions to set it up, but when I ping the Internet from the UE(, I never get a ping response.

Is there something wrong with my configuration somewhere?
I would greatly appreciate it if you could tell me any mistakes or problems.

Here is a pdf and pcap file that describes my network configuration and the contents of my configuration file.

So many thanks.
koh.pdf (1.0 MB) (982.7 KB)

It looks internal tunnel worked already,and iptables already matched the package.
Did you ping in command line well?
Stop ufw and ip forward reactive again,it will affect the iptables’s working status.

Hi @thornton
Thanks for the confirmation!
I can successfully ping on the command line.
I stop ufw and ip forward reactive again, but I have yet to receive a ping response.

sometime, will restrict the response .so you can ping a local host inside your intranet.
it shall be work.
i just do a test to,failed. but it’s ok to a intranet host.

Hi @thornton
So, can’t I use ping to verify that the UE is communicating with the external internet (ex.

of course,it’s possible. you can use tcpdump on another host to capture the ip package,check whether there is response from the server. Some route/fw might restrict the icmp’s base on the site connectivity .anyway,5gc worked well in your case.

Hi @thornton
I was able to ping from UE by commenting out the following command sudo ip addr add dev lo.
Thank you so much!

Hi , according to this pdf, I can’t run after; reply:
HTTP server setup failed: %+v listen tcp bind: address already in use NRF=init

could you check the bind address .
sudo netstat -tupln |grep 29510 (if the 29510 link to others,you shall check which process bind on).
tcp 0 0* LISTEN 19284/./bin/nrf


I´m having the same problem of bind address for NFR. I also do not understand how and works. I can run the core with which will initiate all NFs. However with will initiate some NFs, they will perform their tests and later swich off. My question is how and are related and what is the purpose of running, first,, and later, That is what is giving me the error of binding address. Otherwise, test executed alone work for me well.

Hi koh, thronton,

I followed all your instructions in koh.pdf (except command sudo ip addr add dev lo)
Registration is successful.
However PDU session is not created. No User Plane Path is available.

UPF Routes:
INFO[2021-02-04T19:35:51+05:30] /home/user/free5gc/src/upf/src/upf_init.c:164 UpfInit() Config: /home/user/4Feb/free5gc/src/upf/build/config/upfcfg.test.yaml UPF=Util
INFO[2021-02-04T19:35:51+05:30] Set log level: info UPF=Util
INFO[2021-02-04T19:35:51+05:30] /home/user/free5gc/src/upf/src/up/up_path.c:40 UpRouteInit() APN routes added, main routing table: UPF=Util
INFO[2021-02-04T19:35:51+05:30] /home/user/free5gc/src/upf/lib/knet/src/route.c:202 KnetPrintRoutes() DstIp Gateway Iface Priority RtProto Type UPF=Util
INFO[2021-02-04T19:35:51+05:30] /home/user/free5gc/src/upf/lib/knet/src/route.c:237 KnetPrintRoutes() /0 enp4s0 100 dhcp unicast UPF=Util
INFO[2021-02-04T19:35:51+05:30] /home/user/free5gc/src/upf/lib/knet/src/route.c:237 KnetPrintRoutes() /8 enp4s0 0 kernel unicast UPF=Util
INFO[2021-02-04T19:35:51+05:30] /home/user/free5gc/src/upf/lib/knet/src/route.c:237 KnetPrintRoutes() /24 upfgtp0 0 static unicast UPF=Util
INFO[2021-02-04T19:35:51+05:30] /home/user/free5gc/src/upf/lib/knet/src/route.c:237 KnetPrintRoutes() /16 enp4s0 1000 boot unicast UPF=Util
INFO[2021-02-04T19:35:51+05:30] /home/user/free5gc/src/upf/lib/knet/src/route.c:237 KnetPrintRoutes() /16 docker0 0 kernel unicast UPF=Util
INFO[2021-02-04T19:35:51+05:30] /home/user/free5gc/src/upf/lib/knet/src/route.c:237 KnetPrintRoutes() /24 enp4s0 0 kernel unicast UPF=Util
INFO[2021-02-04T19:35:51+05:30] /home/user/free5gc/src/upf/lib/knet/src/route.c:237 KnetPrintRoutes() /24 enp4s0 100 kernel unicast UPF=Util
INFO[2021-02-04T19:35:51+05:30] /home/user/free5gc/src/upf/lib/knet/src/route.c:237 KnetPrintRoutes() /24 virbr0 0 kernel unicast UPF=Util

Below is the error logs,

INFO[2021-02-04T19:53:18+05:30]/home/user/4Feb/free5gc/src/smf/producer/pdu_session.go:137 free5gc/src/smf/producer.HandlePDUSessionSMContextCreate() SUPI[imsi-2089300007487] has no pre-config route SMF=pdu_session
ERRO[2021-02-04T19:53:18+05:30]/home/user/4Feb/free5gc/src/smf/context/user_plane_information.go:245 free5gc/src/smf/context.(*UserPlaneInformation).GenerateDefaultPath() Can’t find UPF with DNN [internet] SMF=Context
ERRO[2021-02-04T19:53:18+05:30]/home/user/4Feb/free5gc/src/smf/context/user_plane_information.go:178 free5gc/src/smf/context.GenerateDataPath() invalid path SMF=Context
TRAC[2021-02-04T19:53:18+05:30]/home/user/4Feb/free5gc/src/smf/context/datapath.go:308 free5gc/src/smf/context.(*DataPath).ActivateTunnelAndPDR() In ActivateTunnelAndPDR SMF=pdu_session
TRAC[2021-02-04T19:53:18+05:30]/home/user/4Feb/free5gc/src/smf/context/datapath.go:309 free5gc/src/smf/context.(*DataPath).ActivateTunnelAndPDR() DataPath Meta Information
Activated: false
IsDefault Path: true
Has Braching Point: false
Destination IP:
Destination Port:
DataPath Routing Information SMF=pdu_session
INFO[2021-02-04T19:53:18+05:30]/home/user/4Feb/free5gc/src/smf/producer/pdu_session.go:522 free5gc/src/smf/producer.SendPFCPRule() Send PFCP Rule SMF=pdu_session

It would be great, if you could tell me any mistakes or problems.
Please help.

Thanks & Regards


Solved this issue.
I was using a wrong folder /home/user/4Feb/free5GC
When I changed the folder to /home/user/free5GC, it started working.
Registration and PDU session establishment are successful.

Best Regards

Dear @thornton,
Thank you so much for the pdf.
I am very new to this world, when i type the first command,
sudo ifconfig enp0s31f6:amf up
I get the following error.
SIOCSIFADDR: No such device
enp0s31f6:amf: ERROR while getting interface flags: No such device
I am assuming I am missing a step of creating enp0s31f6, Am I correct? If so, how can I do that.
@thornton, @koh, @vikash , @lakshmi , please help me with this. if I am completely getting it wrong, Apologies. please let me know what to do.
Thanks so much in advance

the enp0s31f6 was laptop specific interface, you can get it by run “ifconfig” to check the wireless interface. then you replace it with yours.

1 Like

Hi Thronton,
Thank you. I got the setup working