#!/bin/bash ## Install dependencies sudo apt-get install ca-certificates -y sudo apt-get install curl -y sudo apt-get install gnupg -y sudo apt-get install lsb-release -y ## Installation Wireshark sudo add-apt-repository ppa:wireshark-dev/stable -y sudo apt update -y sudo apt install wireshark -y # Work directory path is the current directory WORK_DIR=`pwd` ## Configuration of the packer forwarding sudo sysctl net.ipv4.conf.all.forwarding=1 sudo iptables -P FORWARD ACCEPT ## Install docker and docker-compose sudo rm /etc/apt/sources.list.d/docker.list* sudo mkdir -p /etc/apt/keyrings -y 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 $(. /etc/os-release; echo "$UBUNTU_CODENAME") stable" sudo chmod a+r /etc/apt/keyrings/docker.gpg -y sudo apt-get update -y sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin -y sudo curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose ## Pulling the images from Docker Hub sudo docker pull oaisoftwarealliance/oai-amf:v1.5.0 sudo docker pull oaisoftwarealliance/oai-nrf:v1.5.0 sudo docker pull oaisoftwarealliance/oai-smf:v1.5.0 sudo docker pull oaisoftwarealliance/oai-udr:v1.5.0 sudo docker pull oaisoftwarealliance/oai-udm:v1.5.0 sudo docker pull oaisoftwarealliance/oai-ausf:v1.5.0 sudo docker pull oaisoftwarealliance/oai-spgwu-tiny:v1.5.0 sudo docker pull oaisoftwarealliance/trf-gen-cn5g:latest ## Tag Docker Images sudo docker image tag oaisoftwarealliance/trf-gen-cn5g:latest trf-gen-cn5g:latest sudo docker image tag oaisoftwarealliance/oai-amf:v1.5.0 oai-amf:v1.5.0 sudo docker image tag oaisoftwarealliance/oai-nrf:v1.5.0 oai-nrf:v1.5.0 sudo docker image tag oaisoftwarealliance/oai-smf:v1.5.0 oai-smf:v1.5.0 sudo docker image tag oaisoftwarealliance/oai-udr:v1.5.0 oai-udr:v1.5.0 sudo docker image tag oaisoftwarealliance/oai-udm:v1.5.0 oai-udm:v1.5.0 sudo docker image tag oaisoftwarealliance/oai-ausf:v1.5.0 oai-ausf:v1.5.0 sudo docker image tag oaisoftwarealliance/oai-spgwu-tiny:v1.5.0 oai-spgwu-tiny:v1.5.0 ## Clone OpenAirInterface 5G Core if [ -d "$WORK_DIR/oai-cn5g-fed" ]; then sudo rm -r $WORK_DIR/oai-cn5g-fed fi git clone https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed.git cd $WORK_DIR/oai-cn5g-fed git checkout -f v1.5.0 ## OAI CN5G Configuration files wget -O $WORK_DIR/oai-cn5g-fed/docker-compose/docker-compose-basic-nrf.yaml https://projetos.imd.ufrn.br/reginalab/sdran-openairinterface/-/raw/main/openairinterface5g/openairinterface-conf/docker-compose-basic-nrf.yaml?inline=false wget -O $WORK_DIR/oai-cn5g-fed/docker-compose/database/oai_db.sql https://gitlab.eurecom.fr/oai/openairinterface5g/-/raw/develop/doc/tutorial_resources/oai_db.sql?inline=false ## Synchronizing the tutorials sudo ./scripts/syncComponents.sh git submodule deinit --all --force git submodule init git submodule update ## Creating the bridge 5GC sudo docker network create --driver=bridge --subnet=192.168.70.128/26 -o "com.docker.network.bridge.name"="demo-oai" demo-oai-public-net ## Deploy the 5GC cd $WORK_DIR/oai-cn5g-fed/docker-compose sudo python3 core-network.py --type start-basic --scenario 1 ## Docker post-installation # Enabling current user to run docker commands sudo usermod -aG docker $USER