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
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)