debian安装Open5GS

  1. 环境说明

  2. 安装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
  3. 安装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
  4. 安装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: 'react-jsonschema-form@0.50.1',
      	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 npm@11.2.0
      	npm notice
      
      	> open5gs@2.7.0 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

  5. 配置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
  6. 启动和停止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
相关推荐
XIAOHEZIcode1 天前
Linux系统鼠标偏移常见原因以及修复方案
linux·运维·游戏
用户0328472220702 天前
如何搭建本地yum源(上)
运维
大树885 天前
金刚石散热越强,管路越先见顶
大数据·运维·服务器·人工智能·ai
摇滚侠5 天前
Linux CentOS7 rpm 安装 MySQL 5.7
linux·运维·mysql
霸道流氓气质5 天前
领域驱动设计(DDD)在 Spring Boot 微服务中的实践指南
运维·spring boot·微服务
Inhand陈工5 天前
基于台达PLC与映翰通IG502的智慧水产养殖精准投喂与远程运维解决方案
运维·人工智能·物联网·阿里云·信息与通信
酣大智5 天前
ARP代理--工作原理
运维·网络·arp·arp代理
shushangyun_5 天前
2026年快消品B2B系统推荐:支持终端门店订货、促销政策自动化的工具?
java·运维·网络·数据库·人工智能·spring·自动化
施努卡机器视觉5 天前
SNK施努卡侧滑门锁上滑轮总成自动化装配线,从零件到组件,全流程精密制造方案
运维·自动化·制造
AC赳赳老秦5 天前
用 OpenClaw 搭建服务器故障应急响应系统,自动处理 80% 常见运维故障
android·运维·服务器·python·rxjava·deepseek·openclaw