-
环境说明
- 系统:debian11 64bit
- Open5GS:2.7.0 点击下载源码
- MongoDB:6.0.0
-
安装MongoDB
-
安装必要的包
sudo apt install gnupg curl
-
导入MongoDB公钥
curl -fsSL https://www.mongodb.org/static/pgp/server-6.0.asc | sudo gpg --dearmor -o /usr/share/keyrings/mongodb-archive-keyring.gpg
-
创建MongoDB源列表文件
echo "deb [signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/debian bullseye/mongodb-org/6.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
-
更新包列表并安装MongoDB
sudo apt update sudo apt install mongodb-org
-
启动并设置开机启动
sudo systemctl start mongod sudo systemctl enable mongod
-
检查服务状态
sudo systemctl status mongod
-
创建管理员用户
执行mongosh进入MongoDB shell 切换到admin数据库并创建管理员用户: use admin db.createUser({ user: "admin", pwd: "admin", roles: [ { role: "userAdminAnyDatabase", db: "admin" } ] })
-
配置MongoDB安全设置
编辑MongoDB配置文件:sudo vi /etc/mongod.conf security: authorization: enabled 重启生效:sudo systemctl restart mongod
-
验证是否生效
mongosh -u admin -p --authenticationDatabase admin
-
-
安装Open5GS
wget -qO - https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/Debian_10/Release.key | sudo apt-key add - sudo sh -c "echo 'deb https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/Debian_11/ ./' > /etc/apt/sources.list.d/open5gs.list" sudo apt update sudo apt install open5gs
-
安装Open5GS的WebUI
-
安装Node.js
# Download and import the Nodesource GPG key sudo apt install -y ca-certificates curl gnupg sudo mkdir -p /etc/apt/keyrings curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg # Create deb repository echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list # Run Update and Install sudo apt update sudo apt install nodejs -y
-
安装WebUI:(方法1)
curl -fsSL https://open5gs.org/open5gs/assets/webui/install | sudo -E bash - 输出: ============================================================================================================================== ## Download the Open5GS Source Code (v2.7.0)... + curl -sLf 'https://github.com/open5gs/open5gs/archive/v2.7.0.tar.gz' | tar zxf - ## Build the Open5GS WebUI... + cd ./open5gs-2.7.0/webui && npm clean-install && npm run build npm warn EBADENGINE Unsupported engine { npm warn EBADENGINE package: '[email protected]', npm warn EBADENGINE required: { node: '>=6', npm: '^2.14.7' }, npm warn EBADENGINE current: { node: 'v20.19.0', npm: '10.8.2' } npm warn EBADENGINE } added 813 packages, and audited 814 packages in 1m 19 packages are looking for funding run `npm fund` for details 94 vulnerabilities (5 low, 8 moderate, 42 high, 39 critical) To address issues that do not require attention, run: npm audit fix To address all issues (including breaking changes), run: npm audit fix --force Run `npm audit` for details. npm notice npm notice New major version of npm available! 10.8.2 -> 11.2.0 npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.2.0 npm notice To update run: npm install -g [email protected] npm notice > [email protected] build > next build > Using external babel configuration > Location: "/home/hslong/open5gs-2.7.0/webui/.babelrc" ## Install the Open5GS WebUI... + mkdir -p /usr/lib/node_modules + mv ./open5gs-2.7.0/webui /usr/lib/node_modules/open5gs + chown -R open5gs:open5gs /usr/lib/node_modules/open5gs + cat << EOF > /lib/systemd/system/open5gs-webui.service [Unit] Description=Open5GS WebUI Wants=mongodb.service mongod.service [Service] Type=simple WorkingDirectory=/usr/lib/node_modules/open5gs Environment=NODE_ENV=production ExecStart=/usr/bin/node server/index.js Restart=always RestartSec=2 [Install] WantedBy=multi-user.target EOF + systemctl daemon-reload + systemctl enable open5gs-webui Created symlink /etc/systemd/system/multi-user.target.wants/open5gs-webui.service → /lib/systemd/system/open5gs-webui.service. + deb-systemd-invoke start open5gs-webui ## Default Administrator Account [Username:admin, Password:1423]... + mongosh open5gs ./open5gs-2.7.0/docs/assets/webui/mongo-init.js + rm -rf ./open5gs-2.7.0 ==============================================================================================================================
-
安装WebUI:(方法2)
-
wget https://github.com/open5gs/open5gs/archive/v2.7.0.tar.gz
-
tar xvf v2.7.0.tar.gz
-
mv open5gs-2.7.0 /opt
-
cd /opt/open5gs-2.7.0/webui
-
npm clean-install && npm run build
-
前台运行:node server/index.js
-
系统自启动:
sudo vi /etc/systemd/system/open5gs-webui.service [Unit] Description=Open5GS WebUI After=network.target [Service] User=root WorkingDirectory=/opt/open5gs-2.7.0/webui ExecStart=/usr/bin/node server/index.js Restart=always [Install] WantedBy=multi-user.target
-
systemctl daemon-reload
-
systemctl enable open5gs-webui
-
查看webui服务状态:systemctl status open5gs-webui
-
查看启动日志:sudo tail -f /var/log/syslog
-
-
登录WebUI
- http://localhost:9999
- 账号:admin
- 密码:1423
-
-
配置Open5GS
-
各个组件默认配置
MongoDB = 127.0.0.1 (subscriber data) - http://localhost:9999 MME-s1ap = 127.0.0.2 :36412 for S1-MME MME-gtpc = 127.0.0.2 :2123 for S11 MME-frDi = 127.0.0.2 :3868 for S6a SGWC-gtpc = 127.0.0.3 :2123 for S11 SGWC-pfcp = 127.0.0.3 :8805 for Sxa SMF-gtpc = 127.0.0.4 :2123 for S5c SMF-gtpu = 127.0.0.4 :2152 for N4u (Sxu) SMF-pfcp = 127.0.0.4 :8805 for N4 (Sxb) SMF-frDi = 127.0.0.4 :3868 for Gx auth SMF-sbi = 127.0.0.4 :7777 for 5G SBI (N7,N10,N11) AMF-ngap = 127.0.0.5 :38412 for N2 AMF-sbi = 127.0.0.5 :7777 for 5G SBI (N8,N12,N11) SGWU-pfcp = 127.0.0.6 :8805 for Sxa SGWU-gtpu = 127.0.0.6 :2152 for S1-U, S5u UPF-pfcp = 127.0.0.7 :8805 for N4 (Sxb) UPF-gtpu = 127.0.0.7 :2152 for S5u, N3, N4u (Sxu) HSS-frDi = 127.0.0.8 :3868 for S6a, Cx PCRF-frDi = 127.0.0.9 :3868 for Gx NRF-sbi = 127.0.0.10:7777 for 5G SBI SCP-sbi = 127.0.0.200:7777 for 5G SBI SEPP-sbi = 127.0.0.250:7777 for 5G SBI SEPP-n32 = 127.0.0.251:7777 for 5G N32 SEPP-n32f = 127.0.0.252:7777 for 5G N32-f AUSF-sbi = 127.0.0.11:7777 for 5G SBI UDM-sbi = 127.0.0.12:7777 for 5G SBI PCF-sbi = 127.0.0.13:7777 for 5G SBI NSSF-sbi = 127.0.0.14:7777 for 5G SBI BSF-sbi = 127.0.0.15:7777 for 5G SBI UDR-sbi = 127.0.0.20:7777 for 5G SBI
-
-
启动和停止open5GS
-
重启
sudo systemctl restart open5gs-mmed sudo systemctl restart open5gs-sgwcd sudo systemctl restart open5gs-smfd sudo systemctl restart open5gs-amfd sudo systemctl restart open5gs-sgwud sudo systemctl restart open5gs-upfd sudo systemctl restart open5gs-hssd sudo systemctl restart open5gs-pcrfd sudo systemctl restart open5gs-nrfd sudo systemctl restart open5gs-scpd sudo systemctl restart open5gs-seppd sudo systemctl restart open5gs-ausfd sudo systemctl restart open5gs-udmd sudo systemctl restart open5gs-pcfd sudo systemctl restart open5gs-nssfd sudo systemctl restart open5gs-bsfd sudo systemctl restart open5gs-udrd sudo systemctl restart open5gs-webui
-
停止
sudo systemctl stop open5gs-mmed sudo systemctl stop open5gs-sgwcd sudo systemctl stop open5gs-smfd sudo systemctl stop open5gs-amfd sudo systemctl stop open5gs-sgwud sudo systemctl stop open5gs-upfd sudo systemctl stop open5gs-hssd sudo systemctl stop open5gs-pcrfd sudo systemctl stop open5gs-nrfd sudo systemctl stop open5gs-scpd sudo systemctl stop open5gs-seppd sudo systemctl stop open5gs-ausfd sudo systemctl stop open5gs-udmd sudo systemctl stop open5gs-pcfd sudo systemctl stop open5gs-nssfd sudo systemctl stop open5gs-bsfd sudo systemctl stop open5gs-udrd sudo systemctl stop open5gs-webui
-
debian安装Open5GS
韩搏2025-03-20 8:16
相关推荐
IT小饕餮1 小时前
Linux 安装apache服务大叔是90后大叔3 小时前
Centos编译升级libcurl3分云计算3 小时前
苹果电脑mac M1 15.0 安装虚拟机以及Debian系统 |Debian优化汉化中文 |Debian换阿里下载源 |Debian新建用户爱喝水的鱼丶4 小时前
SAP-ABAP:SAP外网接口调用技术全景指南wangchen_04 小时前
进程间通信(1)——管道竹竿袅袅4 小时前
Tomcat - Session 会话保持奶油话梅糖4 小时前
LS-NET-001-什么是承载网,核心网和接入网nfenghklibra5 小时前
Jenkins自动化部署pigx项目的实践总结网硕互联的小客服5 小时前
如何排查和修复 MSSQL 数据库连接失败的问题高hongyuan5 小时前
Nginx 代理访问一个 Web 界面时缺少内容