How the simulated UE provided by free5GC can ping google.com

Dear ,
I was following the tesh.sh script , and i saw that we are running all the components such as UPF, runCN, N3IWF, then UE is getting started to run.
now my question is how this UE would be able to ping the Data network i.e, google.com in my case.

Thanks
vikash

hi,
if you are familiar with the oneinall OAI project,you can setup a local site connectivity like that.then use run.sh(do a little change),and change the connectivity data in test.sh. and modify the registration_test.go .
and add the snat use iptables. i have made it work. In real world,the 5gc shall run separate,and connect with gnb.
5gcPingbyGtp.pcap (4.6 KB)
br,thornton.

You might modify the ping IP inside src/test/registration_test.go

Dear thornton,

Are you using RFSIMULATOR provided by OAI to set up the communication with free5GC?

Thanks a lot. I will look into it.

It seems similar issue to the one below.
Did you make a modification on the configuration?

Dear,
i am getting the below error when i am running $ ./test.sh TestRegistration

=== RUN TestRegistration
— FAIL: TestRegistration (0.01s)
registration_test.go:96:
Error Trace: registration_test.go:96
Error: Expected nil, but got: 0x6f
Test: TestRegistration
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xa3b72f]

goroutine 250 [running]:
testing.tRunner.func1(0xc0015dee00)
/usr/local/go/src/testing/testing.go:830 +0x392
panic(0x1338fc0, 0x2317770)
/usr/local/go/src/runtime/panic.go:522 +0x1b5
git.cs.nctu.edu.tw/calee/sctp.(*SCTPConn).fd(…)
/home/nano/go/src/git.cs.nctu.edu.tw/calee/sctp/sctp.go:373
git.cs.nctu.edu.tw/calee/sctp.(*SCTPConn).SCTPWrite(0x0, 0xc003168000, 0x39, 0x40, 0x0, 0x0, 0x0, 0x1)
/home/nano/go/src/git.cs.nctu.edu.tw/calee/sctp/sctp_linux.go:88 +0x4f
git.cs.nctu.edu.tw/calee/sctp.(*SCTPConn).Write(…)
/home/nano/go/src/git.cs.nctu.edu.tw/calee/sctp/sctp.go:385
free5gc/src/test_test.TestRegistration(0xc0015dee00)
/home/nano/go/src/free5gc/src/test/registration_test.go:105 +0x295
testing.tRunner(0xc0015dee00, 0x1574b78)
/usr/local/go/src/testing/testing.go:865 +0xc0
created by testing.(*T).Run
/usr/local/go/src/testing/testing.go:916 +0x35a
exit status 2
FAIL free5gc/src/test 1.688s

Dear,
No, I didn’t modify any configurations. i can see only this “TestNon3GPP” Test is getting passed, others are getting failed.

My ngapIpList is blow:
info:
version: 1.0.0
description: AMF initial local configuration

configuration:
amfName: free5GC-AMF
ngapIpList:
- 127.0.0.1
sbi:
scheme: http
ipv4Addr: 127.0.0.1
port: 29518
serviceNameList:
- namf-comm
- namf-evts
- namf-mt
- namf-loc
- namf-oam
servedGuamiList:
- plmnId:
mcc: 208
mnc: 93
amfId: cafe00
supportTaiList:
- plmnId:
mcc: 208
mnc: 93
tac: 1
plmnSupportList:
- plmnId:
mcc: 208
mnc: 93
snssaiList:
- sst: 1
sd: 010203
- sst: 1
sd: 112233
supportDnnList:
- internet
nrfUri: http://localhost:29510
security:
integrityOrder:
- NIA2
- NIA0
cipheringOrder:
- NEA2
- NEA0
networkName:
full: free5GC
short: free
t3502: 720
t3512: 3600
non3gppDeregistrationTimer: 3240

Can you please test again by replacing the command git.cs.nctu.edu.tw/calee/sctp to github.com/ishidawataru/sctp and check whether the issue will be resolve.

I tried to replace sctp as per your instruction but still problem not got resolved.

hi.
i use the test script(but i didn’t use the netns),you can change the destination of ping in the registration_test.go. and the most important is the iptables(you can do it by snat, your UE ip to your Gi interface).
br,thornton.

hi.
here it is.
br,thornton
5g sa topo (2).pdf (92.8 KB)

What is the error message?

if the error is similar to the one above, you can try it again by replacing this command git.cs.nctu.edu.tw/calee/sctp to github.com/ishidawataru/sctp.

Dear @thornton
Thanks for the PDF instruction!

I don’t know what gi addres in instruction means.
Is the gi address some kind of IP address assigned to the UPF by free5GC?
How can I find the gi address?

hi
it’s the interface to connect to internet.
br,thornton.

Hi @thornton.
In other words, is the gi address the IP address associated with wlp2s0, which is set to natifname in instruction?

Try this solution

1 Like

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

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