Building Open5GS from Sources

open5gs 安装和小的注意点

Getting MongoDB


Install MongoDB with package manager. It is used as database for NRF/PCF/UDR and PCRF/HSS.

$ sudo apt update
$ sudo apt install mongodb
$ sudo systemctl start mongodb (if '/usr/bin/mongod' is not running)
$ sudo systemctl enable mongodb (ensure to automatically start it on system boot)

Setting up TUN device (not persistent after rebooting)


Create the TUN device with the interface name ogstun.

$ sudo ip tuntap add name ogstun mode tun
$ sudo ip addr add 10.45.0.1/16 dev ogstun
$ sudo ip addr add 2001:db8:cafe::1/48 dev ogstun
$ sudo ip link set ogstun up

Building Open5GS 


Install the dependencies for building the source code.

$ sudo apt install python3-pip python3-setuptools python3-wheel ninja-build build-essential flex bison git libsctp-dev libgnutls28-dev libgcrypt-dev libssl-dev libidn11-dev libmongoc-dev libbson-dev libyaml-dev libnghttp2-dev libmicrohttpd-dev libcurl4-gnutls-dev libnghttp2-dev libtins-dev libtalloc-dev meson

Git clone.

$ git clone https://github.com/open5gs/open5gs

To compile with meson: 

此步骤最好挂代理安装

$ cd open5gs
$ meson build --prefix=`pwd`/install
$ ninja -C build

You need to perform the installation process.

$ cd build
$ ninja install
$ cd ../

You can also copy the binaries to /usr/bin to be able to run them from anywhere on the system.

$ cp open5gs* /usr/bin/


Building the WebUI of Open5GS


Node.js is required to build WebUI of Open5GS

$ sudo apt install curl
$ curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -
$ sudo apt install nodejs

Install the dependencies to run WebUI  ubuntu 必须使用root权限安装和运行

$ cd webui
$ npm ci --no-optional

The WebUI runs as an npm script.

$ npm run dev

Server listening can be changed by setting the environment variable HOSTNAME or PORT as below.

$ HOSTNAME=192.168.0.11 npm run dev
$ PORT=7777 npm run dev
 
 
posted @ 2022-05-15 11:02  后来里的老街  阅读(667)  评论(0编辑  收藏  举报