Installation
A. Pre-requisite
-
Required kernel version
5.0.0-23-generic
. This request is from the module gtp5g that we has used. Any more details please check here# Check kernel version $ uname -r 5.0.0-23-generic
-
Require go language
- If another version of Go is installed
- Please remove the previous Go version
sudo rm -rf /usr/local/go
- Install Go 1.14.4
wget https://dl.google.com/go/go1.14.4.linux-amd64.tar.gz sudo tar -C /usr/local -zxvf go1.14.4.linux-amd64.tar.gz
- Please remove the previous Go version
- Clean installation
- Install Go 1.14.4
wget https://dl.google.com/go/go1.14.4.linux-amd64.tar.gz sudo tar -C /usr/local -zxvf go1.14.4.linux-amd64.tar.gz mkdir -p ~/go/{bin,pkg,src} echo 'export GOPATH=$HOME/go' >> ~/.bashrc echo 'export GOROOT=/usr/local/go' >> ~/.bashrc echo 'export PATH=$PATH:$GOPATH/bin:$GOROOT/bin' >> ~/.bashrc source ~/.bashrc
- Install Go 1.14.4
- If another version of Go is installed
-
Required packages for control plane
sudo apt -y update sudo apt -y install mongodb wget git sudo systemctl start mongodb
-
Required packages for user plane
sudo apt -y update sudo apt -y install git gcc cmake autoconf libtool pkg-config libmnl-dev libyaml-dev go get -u github.com/sirupsen/logrus
-
Network Setting
sudo sysctl -w net.ipv4.ip_forward=1 sudo iptables -t nat -A POSTROUTING -o <dn_interface> -j MASQUERADE sudo systemctl stop ufw
B. Install Control Plane Entities
-
Clone free5GC project
cd ~ git clone --recursive -b v3.0.3 -j `nproc` https://github.com/free5gc/free5gc.git cd free5gc
(Optional) If you want to use the nightly version, runs:
cd ~/free5gc git checkout master git submodule sync git submodule update --init --jobs `nproc` git submodule foreach git checkout master git submodule foreach git pull --jobs `nproc`
-
Run the script to install dependent packages
cd ~/free5gc go mod download
In step 2, the folder name should remain free5gc. Please do not modify it or the compilation would fail.
-
Compile network function services in
free5gc
individually, e.g. AMF (redo this step for each NF), orcd ~/free5gc go build -o bin/amf -x src/amf/amf.go
To build all network functions in one command
./build.sh
C. Install User Plane Function (UPF)
-
Please check Linux kernel version if it is
5.0.0-23-generic
uname -r
Get Linux kernel module 5G GTP-U
git clone -b v0.1.0 https://github.com/PrinzOwO/gtp5g.git cd gtp5g make sudo make install
-
Build from sources
cd ~/free5gc/src/upf mkdir build cd build cmake .. make -j`nproc`
Note: UPF’s config is located at free5gc/src/upf/build/config/upfcfg.yaml