srsran / srsRAN_Project

Open source O-RAN 5G CU/DU solution from Software Radio Systems (SRS) https://docs.srsran.com/projects/project
https://www.srsran.com
GNU Affero General Public License v3.0
523 stars 178 forks source link

no UE internet connection: UE connected to [BladeRF xA4] connected to [srsRAN (docker)] connected to [open5gs (docker)] #657

Closed MamdouhEgy closed 5 months ago

MamdouhEgy commented 5 months ago

Issue Description

I followed open5gs.

Setup Details

Host OS: Ubuntu20.04 bladeRF: micro xA4 SIM cards: SysmoISIM-SJA2 UE: Xiaomi 11 Lite 5G NE

I followed this sequence of commands: docker build --target open5gs -t open5gs-docker . #create the image from the dockerfile

docker network create --subnet=10.53.1.0/24 open5gsnet #create the container network switch

docker run --net open5gsnet --ip 10.53.1.2 --env-file open5gs.env --privileged --publish 3000:3000 open5gs-docker ./build/tests/app/5gc -c open5gs-5gc.yml # create container based on the above created image and passing some arguments to it like to have specific ip and to mirror port 3000 between host and container

docker run -it --device=/dev/bus/usb/002/003 --network open5gsnet 3c8dd6ec0655 /bin/bash #here i run a container from customised pavonis/srs-gnb-blade images, in which i adjusted the file gnb_rf_b200_tdd_n78_20mhz.yml gnb_rf_b200_tdd_n78_20mhz.yml

cd /opt/srsRAN_Project/configs

gnb -c gnb_rf_b200_tdd_n78_20mhz.yml

then i get that for the srsRAN container: srsRAN container

and get for the Open5gs container: Open5gs container

then i disable the aeroplane mode in my UE and i got an IP that i predefined in the open5gs.env as follows: open5gs env and also defined it in add_users.py file as follows:

add_users1 py add_users2 py

In my UE i got that:

UE screenshoot

In Open5GS container i got (u see the Open5gs recognized the UE and the IP address is the same as in the previous screenshot):

Open5gs container after UE connected

when access localhost:3000, these are the configurations:

srsapn

Expected Behavior

I expect internet connection on my UE

Actual Behaviour

no internet connection as in the UE screenshots

Additional Information

i followed this guide but i think it didnot help. (step1-3 are right as in screenhots, step 4: Restart all Open5GS services and try again, i restarted the open5gs container then again started the srsRAN container but didnot help)

screenshot of ip address command on my host: Screenshot at 15-27-17

screenshot of ping 10.45.0.4 command (to ping the UE from the open5gs container): ping

in the open5gs container i executed this command ip ro to be sure that the default routing is sending to the GW 10.53.1.1 :

root@55f7fa2a26cd:/open5gs# ip ro default via 10.53.1.1 dev eth0

Also in my host PC: route host

Also i noticed that i always getting this notification on my UE and when i click on it, it starting to search for mobile networks then find open5gs 5G then i can connect to it but no internet as before: SIM no service

pgawlowicz commented 5 months ago

Please follow our tutorial: https://docs.srsran.com/projects/project/en/latest/tutorials/source/cotsUE/source/index.html

In addition, you will need to enable IP forwaring on the PC running open5gs. Please check open5gs tutorial: https://open5gs.org/open5gs/docs/guide/01-quickstart/

It should work with:

sudo sysctl -w net.ipv4.ip_forward=1
sudo iptables -t nat -A POSTROUTING -o <IFNAME> -j MASQUERADE

Where <IFNAME> is the name of the interface connected to the internet.
MamdouhEgy commented 5 months ago

@pgawlowicz Thanks!! this was the solution and now everything worked as expected.