本次部署用到了两块飞腾的开发板,一块开发板用于跑free5GC,一块开发板用于跑UERANSIM,当然也可以用一块开发板进行操作。下图红色框部分运行在DT_D2008_2103-1开发板上,黄色部分运行在DT_2008_2103-2开发板上面。
欢迎多多交流共同学习进步!
rm -rf /var/lib/mongo/*
rm -rf /var/log/mongo/*
mongod --repair
pgrep mongo -l
node -v
sudo npm cache clean -f
sudo apt-get install npm
sudo npm install n -g
sudo n stable
此处所列为当前我使用的开发板软件资源,详细的要求可查看free5gc需要的最小资源
Software | Version |
---|---|
内核 | 5.4.18-53-generic |
OS | Kylin V10 SP1 |
gcc | gcc version 9.3.0 (Ubuntu 9.3.0-10kylin2) |
go | 1.15.7 or later |
mongodb | 4.4 |
此处所列为当前我使用的开发板硬件资源,详细的要求可查看free5gc需要的最小资源
Hardware | Version |
---|---|
CPU | Phytium,D2000/8 E8C |
RAM | 16G |
Hard drive | 512G |
NIC | 2*1Gbps Ethernet card supported in the Linux kernel |
sudo wget https://golang.google.cn/dl/go1.15.7.linux-arm64.tar.gz
export GOROOT=/usr/local/go/
export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
mkdir -p $GOPATH/src/golang.org/x
cd $GOPATH/src/golang.org/x
git clone https:/github.com/golang/sync.git
git clone https://github.com/golang/crypto.git
git clone https://github.com/golang/sys.git
go env -w GOPROXY=https://goproxy.cn,direct
go version
vim gohelloworld.go
package main
import (
"fmt"
)
func main(){
fmt.Printf("hello world\n")
}
go build gohelloworld.go
./gohelloworld
wget https://fastdl.mongodb.org/linux/mongodb-linux-aarch64-ubuntu2004-4.4.18.tgz
tar -zxvf mongodb-linux-aarch64-ubuntu2004-4.4.18.tgz
cp mongodb-linux-aarch64-ubuntu2004-4.4.18/bin/* /usr/local/bin/
sudo mkdir -p /var/lib/mongo
sudo mkdir -p /var/log/mongo
mongod --dbpath /var/lib/mongo --logpath /var/log/mongodb/mongod.log --fork
ps -ef | grep mongodb
cd ~
git clone -b v0.7.0 https://github.com/free5gc/gtp5g.git
cd gtp5g
make
sudo make install
sudo make uninstall
sudo apt -y update
sudo apt -y install git gcc g++ cmake autoconf libtool pkg-config libmnl-dev libyaml-dev
sudo sysctl -w net.ipv4.ip_forward=1
sudo iptables -t nat -A POSTROUTING -o <dn_interface> -j MASQUERADE
sudo iptables -A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --set-mss 1400
sudo systemctl stop ufw
cd ~
git clone --recursive -b v3.2.1 -j `nproc` https://github.com/free5gc/free5gc.git
cd free5gc
# 删除空文件夹
rm -rf ~/free5gc/NFs/*
# 切换到NFs目录下
cd ~/free5gc/NFs
# 重新手动git
git clone https://github.com/free5gc/amf.git
git clone https://github.com/free5gc/smf.git
git clone https://github.com/free5gc/pcf.git
git clone -b v1.1.1 -j `nproc` https://github.com/free5gc/ausf.git
git clone https://github.com/free5gc/nssf.git
git clone -b v1.1.1 -j `nproc` https://github.com/free5gc/nrf.git
git clone https://github.com/free5gc/udm.git
git clone https://github.com/free5gc/udr.git
git clone https://github.com/free5gc/go-upf.git
git clone https://github.com/free5gc/n3iwf.git
cd ~/free5gc
rm -rf ~/free5gc/webconsole # webconsole 文件夹也为空,和处理一样,重新手动git webconsole文件
git clone https://github.com/free5gc/webconsole.git
cd ~/free5gc
make
cd ~/free5gc
./test.sh TestRegistration
cd ~/free5gc
./bin/nrf
cd ~/free5gc
./run.sh
ps -ef
sudo apt remove cmdtest
sudo apt remove yarn
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update
sudo apt-get install -y nodejs yarn
cd ~/free5gc
make webconsole
cd ~/free5gc/webconsole
go run server.go
UERANSIM链接
git clone -b v3.2.6 https://github.com/aligungr/UERANSIM.git
sudo apt install snap snapd
vim /etc/profile
source /etc/profile
sudo apt install make
sudo apt install gcc
sudo apt install g++
sudo apt install libsctp-dev lksctp-tools
sudo apt install iproute2
sudo snap install cmake --classic
cd ~/UERANSIM
make
nr-gnb -c myconfig.yaml
nr-ue -c myconfig.yaml
nr-ue -c myconfig.yaml -n 10
nr-ue -c myconfig.yaml -n 10 -i imsi-286010000000001
nr-cli imsi-001010000000001
nr-cli --dump
commands
sudo sysctl -w net.ipv4.ip_forward=1
sudo iptables -I FORWARD 1 -j ACCEPT
sudo iptables -t nat -A POSTROUTING -o enaphyt4i0 -j MASQUERADE
sudo systemctl stop ufw
cd ~/free5gc
./run.sh
~/UERANSIM/config/myfree5gc-gnb.yaml
192.168.1.118
192.168.1.118
192.168.1.121
~/UERANSIM/config/myfree5gc-ue.yaml
~/UERANSIM
下执行命令cd ~/UERANSIM
./build/nr-gnb -c config/myfree5gc-gnb.yaml
~/UERANSIM
下执行命令cd ~/UERANSIM
./build/nr-ue -c config/myfree5gc-ue.yaml