Skip to content

Install from source

Kleber Vieira Cardoso edited this page Jan 1, 2021 · 1 revision

Recommended environment

  • CPU: Intel i7 processor
  • RAM: 8 GB
  • Disk space: 160 GB
  • Operating System (OS): Linux Ubuntu 18.04 or 20.04 LTS
  • Kernel verstion: > 5.4 (important for UPF only).

The installation can be done directly in the host OS or inside a virtual machine (VM).

Requirements

Install the necessary packages available in Ubuntu repositories:

sudo apt update && sudo apt -y install gcc cmake autoconf build-essential libtool pkg-config libmnl-dev libyaml-dev wget git net-tools mongodb

Make sure that MongoDB is running:

sudo systemctl start mongodb

Install Go (assuming there is no previous version installed):

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 the proper version of Logrus and fatal:

go get -u github.com/sirupsen/logrus
go get -u github.com/calee0219/fatal

Install the proper version of the Linux kernel module 5G GTP-U:

git clone -b v0.1.0 https://github.com/PrinzOwO/gtp5g.git
cd gtp5g
make clean && make && sudo make install

Configure the Linux host to offer routing and NAT services. In the following, <DN_INT> must be substituted by the name of the interface used for Internet access, e.g., eth0 or enp0s3. The firewall service (i.e., ufw) is disabled to assure the communication of the 5G core with the outside networks.

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

5G core

Download the source code:

git clone https://github.com/my5G/my5G-core.git
cd my5G-core
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`

Install the dependencies:

go mod download

Compile the network functions:

make all

Done! The software is successfully installed.

Clone this wiki locally