开发记录:Ubantu虚拟机中的仿真基站无法接入服务器5G核心网【已解决】

问题描述:

Ubantu操作系统与服务器核心网连接以及虚拟机与服务器连接存在相同的问题:基站无法正常连接,但能够ping通核心网demo-oai网桥但无法ping通核心网中的网元,问题截屏如下

基站侧:

核心网侧:(basic核心网能正常启动,健康状态检查也没有问题,但是其各个网桥的ip却缺失)

问题解决:

1,重启服务器即可解决ip地址缺失的问题,应该是程序出现了bug,重启之后即可解决

2,基站接入

        2.1 服务器自带的仿真基站接入测试:

gnb可以直接接入,ue就不再做测试,接入流程见我的b站视频

v1.4.0

抓包验证:

在添加了路由转发之后先ping以下demo-oai的ip之后首先ping以下核心网网桥70.129

Good!

接下来尝试接入基站:

接下来我们就开始照猫画虎,尝试在虚拟机上接入基站

         2.2 Ubantu操作系统接入仿真基站:

首先是GNB的配置文件 尝试接入,寄:

可以发现没有找到192.168.70.132的ip地址,ARP请求无应答。

问题解决

其实出错原因特别简单,之前我们配置虚拟机和服务器的网络都是通过网络设置的Ui界面直接设置的,虽然这种设置类似于windows一样简单容易操作,但是在我们的项目中却会使两设备间的数据包传输出现问题,配置网络还是需要使用netplan来配置每一台设备的静态ip地址,这里就不过多赘述。配置文件如下:

----------------------------------------------------------------------------
-Date 2022/11/10
-Device Dell R740; Ubantu physic device
-Version V1.0
----------------------------------------------------------------------------
--------------------------------------------OAI-----------------------------
python3 core-network.py --help
sudo sysctl net.ipv4.conf.all.forwarding=1
sudo iptables -P FORWARD ACCEPT
--------------------------------------------GNB--------------------------------

sudo ip route add 192.168.70.128/26 via 192.168.12.3 dev enp2s0

build/nr-gnb -c config/on5gs-gnb.yaml

sudo build/nr-ue -c config/open5gs-ue.yaml


stasus   configurayion
—————————————————————————OAI————————————————————————————————
# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager
  ethernets:
     eno2:
       addresses: [192.168.12.3/24]
       #gateway4: 192.168.12.1
       dhcp4: no
       #nameservers:
             #addresses: [8.8.8.8, 114.114.114.114, 255.255.255.255]


---------------------amf-————————————————————————————
  - INT_ALGO_LIST=["NIA1" , "NIA2"]
  - CIPH_ALGO_LIST=["NEA1" , "NEA2"]

————————————————————————————GNB————————————————————
# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager
  ethernets:
     enp2s0:         #配置的网卡名称
       addresses: [192.168.12.2/24]
       #gateway4: 192.168.12.4      #设置网关
       dhcp4: no
       #nameservers: #add 10/26
              #addresses: [114.114.114.114,8.8.8.8,225.225.225.5] #add 10/26



——————————————————————————ueransim  gnb——————————————————
mcc: '208'          # Mobile Country Code value
mnc: '95'           # Mobile Network Code value (2 or 3 digits)

nci: '0x000000010'  # NR Cell Identity (36-bit)
idLength: 32        # NR gNB ID length in bits [22...32]
tac: 40960              # Tracking Area Code

linkIp: 127.0.0.1   # gNB's local IP address for Radio Link Simulation (Usually same with local IP)
ngapIp: 192.168.12.2  # gNB's local IP address for N2 Interface (Usually same with local IP)
gtpIp: 192.168.12.2    # gNB's local IP address for N3 Interface (Usually same with local IP)

# List of AMF address information
amfConfigs:
  - address: 192.168.70.132
    port: 38412

# List of supported S-NSSAIs by this gNB
slices:
  - sst: 1
 
# Indicates whether or not SCTP stream number errors should be ignored.
ignoreStreamIds: true

——————————————————————————ueransim  ue————————————————————
# IMSI number of the UE. IMSI = [MCC|MNC|MSISDN] (In total 15 digits)
supi: 'imsi-208950000000131'
# Mobile Country Code value of HPLMN
mcc: '208'
# Mobile Network Code value of HPLMN (2 or 3 digits)
mnc: '95'

# Permanent subscription key
key: '0C0A34601D4F07677303652C0462535B'
# Operator code (OP or OPC) of the UE
op: '63bfa50ee6523365ff14c1f45f88737d'
# This value specifies the OP type and it can be either 'OP' or 'OPC'
opType: 'OPC'
# Authentication Management Field (AMF) value
amf: '8000'
# IMEI number of the device. It is used if no SUPI is provided
imei: '356938035643803'
# IMEISV number of the device. It is used if no SUPI and IMEI is provided
imeiSv: '4370816125816151'

# List of gNB IP addresses for Radio Link Simulation
gnbSearchList:
  - 192.168.12.2

# UAC Access Identities Configuration
uacAic:
  mps: false
  mcs: false

# UAC Access Control Class
uacAcc:
  normalClass: 0
  class11: false
  class12: false
  class13: false
  class14: false
  class15: false

# Initial PDU sessions to be established
sessions:
  - type: 'true'
    apn: 'internet'
    slice:
      sst: 1

# Configured NSSAI for this UE by HPLMN
configured-nssai:
  - sst: 1

# Default Configured NSSAI for this UE
default-nssai:
  - sst: 1
    sd: 1

# Supported integrity algorithms by this UE
integrity:
  IA1: true
  IA2: true
  IA3: true

# Supported encryption algorithms by this UE
ciphering:
  EA1: true
  EA2: true
  EA3: true

# Integrity protection maximum data rate for user plane
integrityMaxRate:
  uplink: 'full'
  downlink: 'full'

服务器:

基站:

 网关、DNS全部都关闭

但是现在还有个问题:基站ping百度的话还是无法解析域名【待解决】

        2.3虚拟机基站接入核心网

同理,先修改静态ip:(60条消息) 【Linux】ubuntu18.04修改IP为静态IP并能够上网(傻瓜式教学)_DedicationYu的博客-CSDN博客_ubuntu18.04修改ip地址

由于是局域网,因此我们不设置网关和DNS,参数配置如下:

 注意我们这里dhcp4设置为no,意思是不分配动态ip,默认是静态ip

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值