OAI-5G搭建步骤

1.版本匹配关系

        lsb_release  -a

                Ubuntu 20.04.6.LTS安装成功

                 http://mirrors.ustc.edu.cn/ubuntu-releases/20.04/

                Ubuntu 22.04.4 LTS安装失败
        uname -r
        docker --version

        python 3.8.10

        docker 25.0.2

        docker compose v2.20.2

2.安装指导

https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed

oai / cn5g / oai-cn5g-fed · GitLab


 







https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed/-/blob/master/docs/DEPLOY_SA5G_BASIC_DEPLOYMENT.md

3.操作步骤

3.1 安装wireshark

        sudo add-apt-repository ppa:wireshark-dev/stable
        sudo apt install wireshark

        wireshark --version

        git config --global http.postBuffer 524288000

3.2 安装依赖

        3.2.1 安装git

               sudo apt install git
               git --version

                git version 2.25.1        

        3.2.2 安装python及pip

              参考:https://blog.csdn.net/heardlover/article/details/137384177?spm=1001.2014.3001.5502

              sudo apt install python3
              sudo apt install python3-pip
              python3 --version
              pip --version

                pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)

               sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1
              python --version

                Python 3.8.10

         

        3.2.2 docker26.0.0

            参考:
                https://blog.csdn.net/heardlover/article/details/137378706?spm=1001.2014.3001.5502

                sudo apt  install curl

                sudo apt install apt-transport-https ca-certificates curl software-properties-common

                curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

                sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

                sudo apt update

                sudo apt install docker-ce

                docker version
                        hzf@ubuntu:~$ docker version
                        Client: Docker Engine - Community
                         Version:           26.0.0
                         API version:       1.45
                         Go version:        go1.21.8
                         Git commit:        2ae903e
                         Built:             Wed Mar 20 15:17:51 2024
                         OS/Arch:           linux/amd64
                         Context:           default

        3.2.2 docker compose v2.21.0

                wget https://github.com/docker/compose/releases/download/v2.21.0/docker-compose-linux-x86_64

                sudo mv docker-compose-linux-x86_64 /usr/local/bin/docker-compose
                sudo chmod +x /usr/local/bin/docker-compose
                sudo docker-compose --version

                        hzf@ubuntu:~$ sudo docker-compose --version
                        Docker Compose version v2.21.0

         

        3.2.3 docker更换阿里源

               进入阿里云容器服务网站:https://cr.console.aliyun.com/

    

3.3 配置网络

        sudo sysctl net.ipv4.conf.all.forwarding=1
        sudo iptables -P FORWARD ACCEPT
        sudo docker network create --driver=bridge --subnet=192.168.70.128/26 -o "com.docker.network.bridge.name"="demo-oai" demo-oai-public-net
        ifconfig demo-oai

      

3.4 下载oai-cn5g-fed并容器化启动5GC

        https://gitee.com/openair5gcn/oai-cn5g-fed.git

        git clone https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed.git
        cd oai-cn5g-fed
        git checkout -f v2.0.1

        git config --global --add safe.directory /home/hzf/oai_5g/oai-cn5g-fed


         sudo git checkout master

         
         docker rm demo-oai-public-net
         docker network rm demo-oai-public-net
         python3 core-network.py --type start-basic
         python3 core-network.py --type stop-basic

        

         python3 core-network.py --type stop-basic

4.切换到2.0.1版本

4.1 参考

        https://blog.csdn.net/qq_41224270/article/details/128039734

4.2 删除1.5.0镜像

        docker images
        docker rmi ea2401730c48
        docker rmi 10a56b175c22 0d81ae632384 72904620cb99 460e3460c758 
        docker rmi 699af5f804e6 582adebfb03a 25b2571ffcd9 


4.3 下载核心网镜像

        docker pull oaisoftwarealliance/oai-spgwu-tiny:latest
        docker pull oaisoftwarealliance/oai-udm:v2.0.1
        docker pull oaisoftwarealliance/oai-udr:v2.0.1
        docker pull oaisoftwarealliance/oai-smf:v2.0.1
        docker pull oaisoftwarealliance/oai-amf:v2.0.1
        docker pull oaisoftwarealliance/oai-upf-vpp:v2.0.1
        docker pull oaisoftwarealliance/oai-nrf:v2.0.1
        docker pull oaisoftwarealliance/oai-nssf:v2.0.1
        docker pull oaisoftwarealliance/oai-pcf:v2.0.1
        docker pull oaisoftwarealliance/oai-ausf:v2.0.1
        docker pull oaisoftwarealliance/oai-upf-vpp:v2.0.1
        # Utility image to generate traffic
        docker pull oaisoftwarealliance/trf-gen-cn5g:latest

4.3 修改tag

        docker image tag oaisoftwarealliance/oai-spgwu-tiny:latest oai-spgwu-tiny:latest
        docker image tag oaisoftwarealliance/oai-udm:v2.0.1 oai-udm:v2.0.1
        docker image tag oaisoftwarealliance/oai-udr:v2.0.1 oai-udr:v2.0.1
        docker image tag oaisoftwarealliance/oai-smf:v2.0.1 oai-smf:v2.0.1
        docker image tag oaisoftwarealliance/oai-amf:v2.0.1 oai-amf:v2.0.1
        docker image tag oaisoftwarealliance/oai-upf-vpp:v2.0.1 oai-upf-vpp:v2.0.1
        docker image tag oaisoftwarealliance/oai-nrf:v2.0.1 oai-nrf:v2.0.1
        docker image tag oaisoftwarealliance/oai-nssf:v2.0.1 oai-nssf:v2.0.1
        docker image tag oaisoftwarealliance/oai-pcf:v2.0.1 oai-pcf:v2.0.1
        docker image tag oaisoftwarealliance/oai-ausf:v2.0.1 oai-ausf:v2.0.1
        docker image tag oaisoftwarealliance/oai-upf-vpp:v2.0.1 oai-upf-vpp:v2.0.1
        # Utility image to generate traffic
        docker image tag  oaisoftwarealliance/trf-gen-cn5g:latest trf-gen-cn5g:latest

4.4 修改tag   

         python3 core-network.py --type start-basic
         python3 core-network.py --type stop-basic

参考:

https://blog.csdn.net/charliewine/article/details/129026755

https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed/-/blob/master/docs/DEPLOY_SA5G_BASIC_DEPLOYMENT.md

https://blog.csdn.net/heardlover?type=blog

https://blog.csdn.net/weixin_44810982/article/details/129301416

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值