Reference of installing free5gc
Reference of install ueransim(Unorganized)
Note
The note was tested based on v3.3.0 with some updated info, so the dependencies using here are for v3.3.0.
Reference
The release v4.0.0 of free5GC upgrade the SBI server/consumer implementaions for All of NFs (except for NEF) to 3GPP R17 standards.
The NEF upgrade is ongoing, and the R17 support will be released in v4.0.1.
The release v3.4.5 of free5GC fixed a series of bugs, which including:
Besides, the version v3.4.5 is the final release for 3GPP R15.
We're no longer maintain the 3GPP R15 branch, any technical issue/vulnerability/feature will be added in the 3GPP R17 branch only.
The release of free5GC v3.4.4 includes several new features, including default profile values in the Webconsole, a search bar for profiles and subscribers, NEF support for Traffic Influence, and NAT-T support for N3IWUE in N3IWF. The N3IWF configuration file has been refactored. Bug fixes address SMF ULCL charging issues, AMF authentication procedures, UE RAT type determination, and a UDM SUCI profile B decrypt error, along with other issues reported on GitHub and the free5GC forum.
[Features]
[Refactor]
[Bugs]
The release of free5GC v3.4.3 includes several new features, such as new network function TNGF, support for an empty SD value in SNSSAI, and the ability to disable CGF in CHF. It also features a refactored Subscriber Modal Page in the Webconsole. Additionally, several bugs have been fixed, including issues with double registration with N3IWF and unauthorized UE context releases, along with other bug fixes reported via GitHub issues and the free5GC forum.
[Features]
[Refactor]
[Bugs]
The free5GC v3.4.2 includes a Go version update to 1.21 and refactoring all Network Functions. New features include setting static IPs for UEs and OAuth2 authentication for the webconsole, plus a ULCL example in free5gc-compose. Bug fixes and a new commit message check are also included.
[Refactor]
[Features]
[Bugs]
[Chore]
In free5GC v3.4.1, Convergent Charging on PDU Session will be fully supported!
Users will see the data usage on the webconsole after the PDU Session is created (please note that: The charging method (Online/Offline) needs to be determined during the subscription creation).
If you're interested in the implementation details, please visit the CHF design document.
We are delighted to unveil the release of free5GC v3.4.0! In this latest version, free5GC now boasts support for OAuth within the Service-Based Architecture (SBA), marking a significant advancement in its capabilities. Furthermore, we have diligently addressed several issues and bugs that were reported by the Open-Source community, ensuring a smoother and more reliable user experience.
Now the newest version is : free5GC github
ubuntu@ubuntu:~$ uname -r
5.4.0-166-generic
ubuntu@ubuntu:~$ go version
go version go1.17.8 linux/amd64
# this assumes your current version of Go is in the default location:
sudo rm -rf /usr/local/go
wget https://dl.google.com/go/go1.18.10.linux-amd64.tar.gz
sudo tar -C /usr/local -zxvf go1.18.10.linux-amd64.tar.gz
sudo rm -rf /usr/local/go
wget https://dl.google.com/go/go1.21.8.linux-amd64.tar.gz
sudo tar -C /usr/local -zxvf go1.21.8.linux-amd64.tar.gz
ubuntu@ubuntu:~$ sudo rm -rf /usr/local/go
[sudo] password for ubuntu:
ubuntu@ubuntu:~$ wget https://dl.google.com/go/go1.18.10.linux-amd64.tar.gz
--2023-12-26 08:48:08-- https://dl.google.com/go/go1.18.10.linux-amd64.tar.gz
Resolving dl.google.com (dl.google.com)... 142.251.43.14, 2404:6800:4012::200e
Connecting to dl.google.com (dl.google.com)|142.251.43.14|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 141977100 (135M) [application/x-gzip]
Saving to: ‘go1.18.10.linux-amd64.tar.gz’
go1.18.10.linux-amd64.tar.gz 100%[=====================================================================================================================>] 135.40M 35.3MB/s in 3.8s
2023-12-26 08:48:12 (35.7 MB/s) - ‘go1.18.10.linux-amd64.tar.gz’ saved [141977100/141977100]
ubuntu@ubuntu:~$ sudo tar -C /usr/local -zxvf go1.18.10.linux-amd64.tar.gz
......
wget https://dl.google.com/go/go1.18.10.linux-amd64.tar.gz
sudo tar -C /usr/local -zxvf go1.18.10.linux-amd64.tar.gz
mkdir -p ~/go/{bin,pkg,src}
# The following assume that your shell is bash:
echo 'export GOPATH=$HOME/go' >> ~/.bashrc
echo 'export GOROOT=/usr/local/go' >> ~/.bashrc
echo 'export PATH=$PATH:$GOPATH/bin:$GOROOT/bin' >> ~/.bashrc
echo 'export GO111MODULE=auto' >> ~/.bashrc
source ~/.bashrc
sudo apt -y update
sudo apt -y install mongodb wget git
sudo systemctl start mongodb
lscpu | grep avx
grep avx /proc/cpuinfo
[ERRO][WEBUI][CTX] RestfulAPIGetMany err: server selection error: server selection timeout, current topology: { Type: Unknown, Servers: [{ Addr: localhost:27017, Type: Unknown, Last error: connection() error occured during connection handshake: dial tcp 127.0.0.1:27017: connect: connection refused }, ] }
[GIN-debug] [WARNING] You trusted all proxies, this is NOT safe. We recommend you to set a value.
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
sudo systemctl disable ufw # prevents the firewall to wake up after a OS reboot
For v3.4 :
ifconfig
if a
ubuntu@ubuntu:~$ sudo sysctl -w net.ipv4.ip_forward=1
net.ipv4.ip_forward = 1
ubuntu@ubuntu:~$ sudo iptables -t nat -A POSTROUTING -o <dn_interface> -j MASQUERADE
-bash: dn_interface: No such file or directory
ubuntu@ubuntu:~$ ifconfig
ens18: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.217 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::456:bfff:fea3:777 prefixlen 64 scopeid 0x20<link>
inet6 fd27:41a0:607c:0:456:bfff:fea3:777 prefixlen 64 scopeid 0x0<global>
inet6 fdb8:b8d5:b0cd:1:456:bfff:fea3:777 prefixlen 64 scopeid 0x0<global>
inet6 fdb8:b8d5:b0cd:0:456:bfff:fea3:777 prefixlen 64 scopeid 0x0<global>
ether 06:56:bf:a3:07:77 txqueuelen 1000 (Ethernet)
RX packets 226027698 bytes 19968242014 (19.9 GB)
RX errors 0 dropped 7809507 overruns 0 frame 0
TX packets 3794680 bytes 655133874 (655.1 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 7560650 bytes 1670967143 (1.6 GB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 7560650 bytes 1670967143 (1.6 GB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
tailscale0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1280
inet 100.92.61.138 netmask 255.255.255.255 destination 100.92.61.138
inet6 fd7a:115c:a1e0:ab12:4843:cd96:625c:3d8a prefixlen 128 scopeid 0x0<global>
inet6 fe80::de4f:420e:573e:a56b prefixlen 64 scopeid 0x20<link>
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 500 (UNSPEC)
RX packets 154047 bytes 8606483 (8.6 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 250982 bytes 33744840 (33.7 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ubuntu@ubuntu:~$ sudo iptables -t nat -A POSTROUTING -o ens18 -j MASQUERADE
ubuntu@ubuntu:~$ sudo iptables -A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --set-mss 1400
ubuntu@ubuntu:~$ sudo systemctl stop ufw
ubuntu@ubuntu:~$ sudo systemctl disable ufw # prevents the firewall to wake up after a OS reboot
Synchronizing state of ufw.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install disable ufw
Removed /etc/systemd/system/multi-user.target.wants/ufw.service.
ubuntu@ubuntu:~$
git clone --recursive -b v3.3.0 -j `nproc` https://github.com/free5gc/free5gc.git
cd ~/free5gc
git checkout main
git submodule sync
git submodule update --init --jobs `nproc`
git submodule foreach git checkout main
git submodule foreach git pull --jobs `nproc`
# Build all
cd ~/free5gc
make
# Build individually
make amf
......
# Build the UPF (you may skip this step if you built all network functions above)
make upf
ubuntu@ubuntu:~/free5gc$ make
Start building amf....
cd NFs/amf/cmd && \
CGO_ENABLED=0 go build -gcflags "" -ldflags "-X github.com/free5gc/util/version.VERSION=v3.3.0 -X github.com/free5gc/util/version.BUILD_TIME=2023-12-26T09:31:05Z -X github.com/free5gc/util/version.COMMIT_HASH=7907d3c0 -X github.com/free5gc/util/version.COMMIT_TIME=2023-05-20T15:04:00Z" -o /home/ubuntu/free5gc/bin/amf main.go
Start building ausf....
cd NFs/ausf/cmd && \
CGO_ENABLED=0 go build -gcflags "" -ldflags "-X github.com/free5gc/util/version.VERSION=v3.3.0 -X github.com/free5gc/util/version.BUILD_TIME=2023-12-26T09:31:22Z -X github.com/free5gc/util/version.COMMIT_HASH=64f47ebe -X github.com/free5gc/util/version.COMMIT_TIME=2023-05-11T08:11:05Z" -o /home/ubuntu/free5gc/bin/ausf main.go
Start building nrf....
cd NFs/nrf/cmd && \
CGO_ENABLED=0 go build -gcflags "" -ldflags "-X github.com/free5gc/util/version.VERSION=v3.3.0 -X github.com/free5gc/util/version.BUILD_TIME=2023-12-26T09:31:28Z -X github.com/free5gc/util/version.COMMIT_HASH=db4c0f90 -X github.com/free5gc/util/version.COMMIT_TIME=2023-05-11T08:14:48Z" -o /home/ubuntu/free5gc/bin/nrf main.go
Start building nssf....
cd NFs/nssf/cmd && \
CGO_ENABLED=0 go build -gcflags "" -ldflags "-X github.com/free5gc/util/version.VERSION=v3.3.0 -X github.com/free5gc/util/version.BUILD_TIME=2023-12-26T09:31:37Z -X github.com/free5gc/util/version.COMMIT_HASH=28cd7936 -X github.com/free5gc/util/version.COMMIT_TIME=2023-05-11T08:20:43Z" -o /home/ubuntu/free5gc/bin/nssf main.go
Start building pcf....
cd NFs/pcf/cmd && \
CGO_ENABLED=0 go build -gcflags "" -ldflags "-X github.com/free5gc/util/version.VERSION=v3.3.0 -X github.com/free5gc/util/version.BUILD_TIME=2023-12-26T09:31:40Z -X github.com/free5gc/util/version.COMMIT_HASH=17f2a8fc -X github.com/free5gc/util/version.COMMIT_TIME=2023-05-11T08:21:46Z" -o /home/ubuntu/free5gc/bin/pcf main.go
Start building smf....
cd NFs/smf/cmd && \
CGO_ENABLED=0 go build -gcflags "" -ldflags "-X github.com/free5gc/util/version.VERSION=v3.3.0 -X github.com/free5gc/util/version.BUILD_TIME=2023-12-26T09:31:45Z -X github.com/free5gc/util/version.COMMIT_HASH=8eb6843b -X github.com/free5gc/util/version.COMMIT_TIME=2023-05-31T04:43:19Z" -o /home/ubuntu/free5gc/bin/smf main.go
Start building udm....
cd NFs/udm/cmd && \
CGO_ENABLED=0 go build -gcflags "" -ldflags "-X github.com/free5gc/util/version.VERSION=v3.3.0 -X github.com/free5gc/util/version.BUILD_TIME=2023-12-26T09:31:54Z -X github.com/free5gc/util/version.COMMIT_HASH=f9aad0ef -X github.com/free5gc/util/version.COMMIT_TIME=2023-05-11T08:24:25Z" -o /home/ubuntu/free5gc/bin/udm main.go
Start building udr....
cd NFs/udr/cmd && \
CGO_ENABLED=0 go build -gcflags "" -ldflags "-X github.com/free5gc/util/version.VERSION=v3.3.0 -X github.com/free5gc/util/version.BUILD_TIME=2023-12-26T09:31:58Z -X github.com/free5gc/util/version.COMMIT_HASH=a8ef9d9f -X github.com/free5gc/util/version.COMMIT_TIME=2023-05-11T08:26:37Z" -o /home/ubuntu/free5gc/bin/udr main.go
Start building n3iwf....
cd NFs/n3iwf/cmd && \
CGO_ENABLED=0 go build -gcflags "" -ldflags "-X github.com/free5gc/util/version.VERSION=v3.3.0 -X github.com/free5gc/util/version.BUILD_TIME=2023-12-26T09:32:02Z -X github.com/free5gc/util/version.COMMIT_HASH=22988ee2 -X github.com/free5gc/util/version.COMMIT_TIME=2023-06-07T05:56:10Z" -o /home/ubuntu/free5gc/bin/n3iwf main.go
Start building upf....
cd NFs/upf/cmd && \
CGO_ENABLED=0 go build -gcflags "" -ldflags "-X github.com/free5gc/util/version.VERSION=v3.3.0 -X github.com/free5gc/util/version.BUILD_TIME=2023-12-26T09:32:08Z -X github.com/free5gc/util/version.COMMIT_HASH=4474dc86 -X github.com/free5gc/util/version.COMMIT_TIME=2023-06-08T03:37:39Z" -o /home/ubuntu/free5gc/bin/upf main.go
## For Free5GC v3.3.0, v3.2.1
git clone -b v0.8.3 https://github.com/free5gc/gtp5g.git
## For Free5GC v3.4.2, v3.3.0
git clone -b v0.8.6 https://github.com/free5gc/gtp5g.git
## For Free5GC v3.4.5
git clone -b v0.9.5 https://github.com/free5gc/gtp5g.git
cd gtp5g
make
sudo make install
## Do this to re-compile
If reinstall and re-compile new new version of gtp5g is not useful, try these command.
## 確認目前載入的 gtp5g 版本
modinfo gtp5g
##手動移除舊的 gtp5g 模組
sudo rmmod gtp5g
## 強制卸載
sudo rmmod -f gtp5g
## 重新載入 gtp5g 模組
sudo modprobe gtp5g
ubuntu@ubuntu:~$ git clone -b v0.8.3 https://github.com/free5gc/gtp5g.git
fatal: destination path 'gtp5g' already exists and is not an empty directory.
ubuntu@ubuntu:~$ cd gtp5g
ubuntu@ubuntu:~/gtp5g$ make
make -C /lib/modules/5.4.0-166-generic/build M=/home/ubuntu/gtp5g modules
make[1]: Entering directory '/usr/src/linux-headers-5.4.0-166-generic'
Building modules, stage 2.
MODPOST 1 modules
make[1]: Leaving directory '/usr/src/linux-headers-5.4.0-166-generic'
ubuntu@ubuntu:~/gtp5g$ sudo make install
[sudo] password for ubuntu:
cp gtp5g.ko /lib/modules/5.4.0-166-generic/kernel/drivers/net
modprobe udp_tunnel
/sbin/depmod -a
modprobe gtp5g
echo "gtp5g" >> /etc/modules
ubuntu@ubuntu:~/gtp5g$
Compile here again if you have this kind of problem.
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 update
sudo apt install -y nodejs yarn
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt update
sudo apt install -y nodejs
corepack enable # setup yarn automatically
cd ~/free5gc
make webconsole
cd ~/free5gc/webconsole/frontend
yarn install
yarn build
rm -rf ../public
cp -R build ../public
cd ..
go build -o bin/webconsole server.go
Start building webconsole....
cd webconsole/frontend && \
yarn install && \
yarn build && \
rm -rf ../public && \
cp -R build ../public
yarn install v1.22.19
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > eslint-config-react-app@2.1.0" has incorrect peer dependency "babel-eslint@^7.2.3".
warning " > react-bootstrap-table@4.3.1" has incorrect peer dependency "react@^15.0.0 || ^16.0.0".
warning "react-bootstrap-table > react-modal@3.11.2" has incorrect peer dependency "react@^0.14.0 || ^15.0.0 || ^16".
warning "react-bootstrap-table > react-modal@3.11.2" has incorrect peer dependency "react-dom@^0.14.0 || ^15.0.0 || ^16".
warning "react-bootstrap-table > react-s-alert@1.4.1" has incorrect peer dependency "react@^15.0.0 || ^16.0.0".
warning "react-bootstrap-table > react-s-alert@1.4.1" has incorrect peer dependency "react-dom@^15.0.0 || ^16.0.0".
warning " > react-redux@5.1.2" has incorrect peer dependency "react@^0.14.0 || ^15.0.0-0 || ^16.0.0-0".
warning " > redux-form@7.4.2" has incorrect peer dependency "react@^15.0.0-0 || ^16.0.0-0".
[4/4] Building fresh packages...
Done in 15.51s.
yarn run v1.22.19
$ NODE_PATH=./src node scripts/build.js
Creating an optimized production build...
Warning: React version not specified in eslint-plugin-react settings. See https://github.com/yannickcr/eslint-plugin-react#configuration .
Deprecation Warning: Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0.
Recommendation: math.div(15, 16) or calc(15 / 16)
More info and automated migrator: https://sass-lang.com/d/slash-div
╷
2 │ $ct-scales: ((1), (15/16), (8/9), (5/6), (4/5), (3/4), (2/3), (5/8), (1/1.618), (3/5), (9/16), (8/15), (1/2), (2/5), (3/8), (1/3), (1/4)) !default;
│ ^^^^^
╵
src/assets/styles/base/mixins/_chartist.scss 2:20 @import
src/assets/styles/base/_mixins.scss 22:9 @import
stdin 4:9 root stylesheet
Deprecation Warning: Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0.
Recommendation: math.div(8, 9) or calc(8 / 9)
More info and automated migrator: https://sass-lang.com/d/slash-div
╷
2 │ $ct-scales: ((1), (15/16), (8/9), (5/6), (4/5), (3/4), (2/3), (5/8), (1/1.618), (3/5), (9/16), (8/15), (1/2), (2/5), (3/8), (1/3), (1/4)) !default;
│ ^^^
╵
src/assets/styles/base/mixins/_chartist.scss 2:29 @import
src/assets/styles/base/_mixins.scss 22:9 @import
stdin 4:9 root stylesheet
Deprecation Warning: Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0.
Recommendation: math.div(5, 6) or calc(5 / 6)
More info and automated migrator: https://sass-lang.com/d/slash-div
╷
2 │ $ct-scales: ((1), (15/16), (8/9), (5/6), (4/5), (3/4), (2/3), (5/8), (1/1.618), (3/5), (9/16), (8/15), (1/2), (2/5), (3/8), (1/3), (1/4)) !default;
│ ^^^
╵
src/assets/styles/base/mixins/_chartist.scss 2:36 @import
src/assets/styles/base/_mixins.scss 22:9 @import
stdin 4:9 root stylesheet
Deprecation Warning: Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0.
Recommendation: math.div(4, 5) or calc(4 / 5)
More info and automated migrator: https://sass-lang.com/d/slash-div
╷
2 │ $ct-scales: ((1), (15/16), (8/9), (5/6), (4/5), (3/4), (2/3), (5/8), (1/1.618), (3/5), (9/16), (8/15), (1/2), (2/5), (3/8), (1/3), (1/4)) !default;
│ ^^^
╵
src/assets/styles/base/mixins/_chartist.scss 2:43 @import
src/assets/styles/base/_mixins.scss 22:9 @import
stdin 4:9 root stylesheet
Deprecation Warning: Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0.
Recommendation: math.div(3, 4) or calc(3 / 4)
More info and automated migrator: https://sass-lang.com/d/slash-div
╷
2 │ $ct-scales: ((1), (15/16), (8/9), (5/6), (4/5), (3/4), (2/3), (5/8), (1/1.618), (3/5), (9/16), (8/15), (1/2), (2/5), (3/8), (1/3), (1/4)) !default;
│ ^^^
╵
src/assets/styles/base/mixins/_chartist.scss 2:50 @import
src/assets/styles/base/_mixins.scss 22:9 @import
stdin 4:9 root stylesheet
Warning: 12 repetitive deprecation warnings omitted.
Compiled successfully.
File sizes after gzip:
314.18 KB build/static/js/main.5cd6c424.js
31.76 KB build/static/css/main.e1d396c1.css
The project was built assuming it is hosted at the server root.
To override this, specify the homepage in your package.json.
For example, add this to build it for GitHub Pages:
"homepage" : "http://myname.github.io/myapp",
The build folder is ready to be deployed.
You may serve it with a static server:
yarn global add serve
serve -s build
Done in 16.74s.
cd webconsole && \
CGO_ENABLED=0 go build -ldflags "-X github.com/free5gc/util/version.VERSION=v3.3.0 -X github.com/free5gc/util/version.BUILD_TIME=2024-05-15T07:43:10Z -X github.com/free5gc/util/version.COMMIT_HASH=2b9cc4c3 -X github.com/free5gc/util/version.COMMIT_TIME=2023-05-31T04:51:46Z" -o /home/jimmy/free5gc/webconsole/bin/webconsole ./server.go
cd ~
git clone https://github.com/aligungr/UERANSIM
cd UERANSIM
## if using free5GC v3.3.0 or below
git checkout 3a96298
## if using free5GC v3.4.0 or above
git checkout e4c492d
sudo apt update
sudo apt upgrade
sudo apt install make
sudo apt install g++
sudo apt install libsctp-dev lksctp-tools
sudo apt install iproute2
sudo snap install cmake --classic
cd ~/UERANSIM
make
sudo apt remove cmake
sudo snap remove cmake
sudo snap install cmake --classic
go: not found Makefile:45: recipe for target 'bin/amf' failed make: *** [bin/amf] Error 127
path was not set right!
need to type every command
sudo apt install npm
npm cache clean -f
sudo npm install -g n
## For Free5GC v3.3.0, v3.2.1
sudo n 16.20.2
## For Free5GC v3.4.2, v3.4.5
sudo n 18.12.0
node -v
sudo apt remove node // if the old version from apt install is still there.
n rm <node-version>
https://kiiuo.com/archives/3220/node-紀錄更新-node-js-與-npm-更新的方式/
https://medium.com/企鵝也懂程式設計/node版本管理的最佳工具-n-52f90b6bc91f
https://stackoverflow.com/questions/72921215/getting-glibc-2-28-not-found
sudo rm -rf /usr/local/go
wget https://dl.google.com/go/go1.17.8.linux-amd64.tar.gz
sudo tar -C /usr/local -zxvf go1.17.8.linux-amd64.tar.gz
mkdir -p ~/go/{bin,pkg,src}
# The following assume that your shell is bash
echo 'export GOPATH=$HOME/go' >> ~/.bashrc
echo 'export GOROOT=/usr/local/go' >> ~/.bashrc
echo 'export PATH=$PATH:$GOPATH/bin:$GOROOT/bin' >> ~/.bashrc
echo 'export GO111MODULE=auto' >> ~/.bashrc
source ~/.bashrc
sudo rm -rf go1.17.8.linux-amd64.tar.gz.1
sudo rm -rf go1.17.8.linux-amd64.tar.gz.2
sudo rm -rf go1.17.8.linux-amd64.tar.gz.3
nano to files below to check if the ip has been changed :
...
ngapIpList: # the IP list of N2 interfaces on this AMF
- 192.168.1.217 # 127.0.0.1
...
interfaces: # Interface list for this UPF
- interfaceType: N3 # the type of the interface (N3 or N9)
endpoints: # the IP address of this N3/N9 interface on this UPF
- 192.168.1.217 # 127.0.0.8
...
gtpu:
forwarder: gtp5g
# The IP list of the N3/N9 interfaces on this UPF
# If there are multiple connection, set addr to 0.0.0.0 or list all the addresses
ifList:
- addr: 192.168.1.217 # 127.0.0.8
type: N3
The plmnid(mcc&mnc) also needs to be checked if they are same as gnb :
- Note that pcf, udm, udr and upf dont have to change.
- Working slice of sst=1, sd=010203.
- The value of tac=1.
- What mentioned here keeping default is OK.
...
servedGuamiList: # Guami (Globally Unique AMF ID) list supported by this AMF
# <GUAMI> = <MCC><MNC><AMF ID>
- plmnId: # Public Land Mobile Network ID, <PLMN ID> = <MCC><MNC>
mcc: 208 # Mobile Country Code (3 digits string, digit: 0~9)
mnc: 93 # Mobile Network Code (2 or 3 digits string, digit: 0~9)
amfId: cafe00 # AMF identifier (3 bytes hex string, range: 000000~FFFFFF)
supportTaiList: # the TAI (Tracking Area Identifier) list supported by this AMF
- plmnId: # Public Land Mobile Network ID, <PLMN ID> = <MCC><MNC>
mcc: 208 # Mobile Country Code (3 digits string, digit: 0~9)
mnc: 93 # Mobile Network Code (2 or 3 digits string, digit: 0~9)
tac: 000001 # Tracking Area Code (3 bytes hex string, range: 000000~FFFFFF)
plmnSupportList: # the PLMNs (Public land mobile network) list supported by this AMF
- plmnId: # Public Land Mobile Network ID, <PLMN ID> = <MCC><MNC>
mcc: 208 # Mobile Country Code (3 digits string, digit: 0~9)
mnc: 93 # Mobile Network Code (2 or 3 digits string, digit: 0~9)
...
...
plmnSupportList: # the PLMNs (Public Land Mobile Network) list supported by this AUSF
- mcc: 208 # Mobile Country Code (3 digits string, digit: 0~9)
mnc: 93 # Mobile Network Code (2 or 3 digits string, digit: 0~9)
...
...
DefaultPlmnId:
mcc: 208 # Mobile Country Code (3 digits string, digit: 0~9)
mnc: 93 # Mobile Network Code (2 or 3 digits string, digit: 0~9)
serviceNameList: # the SBI services provided by this NRF, refer to TS 29.510
...
...
supportedPlmnList: # the PLMNs (Public land mobile network) list supported by this NSSF
- mcc: 208 # Mobile Country Code (3 digits string, digit: 0~9)
mnc: 93 # Mobile Network Code (2 or 3 digits string, digit: 0~9)
supportedNssaiInPlmnList: # Supported S-NSSAI List for each PLMN
- plmnId: # Public Land Mobile Network ID, <PLMN ID> = <MCC><MNC>
mcc: 208 # Mobile Country Code (3 digits string, digit: 0~9)
mnc: 93 # Mobile Network Code (2 or 3 digits string, digit: 0~9)
supportedSnssaiList: # Supported S-NSSAIs of the PLMN
- sst: 1 # Slice/Service Type (uinteger, range: 0~255)
sd: 010203 # Slice Differentiator (3 bytes hex string, range: 000000~FFFFFF)
...
...
plmnList: # the list of PLMN IDs that this SMF belongs to (optional, remove this key when unnecessary)
- mcc: 208 # Mobile Country Code (3 digits string, digit: 0~9)
mnc: 93 # Mobile Network Code (2 or 3 digits string, digit: 0~9)
...
go run server.go
./free5gc/webconsole/bin/webconsole
# You can run this code to refresh the cache of 5gc before ./run.sh
./force_kill.sh
cd ~/free5gc
./run.sh
cd ~/UERANSIM
build/nr-gnb -c config/free5gc-gnb.yaml
sudo build/nr-ue -c config/free5gc-ue.yaml
# for multiple-UEs, use -n and -t for number and delay
Reboot your VM can deal with some annoying problems that you dont have a solution.
sudo reboot
Some errors messages likes this :
Failed to setup an association with UPF[127.0.0.8], error:Request Transaction
or others I didnt record.
Solusion
After rebooting, you need to type these commands to set Linux Host Network Settings.
sudo sysctl -w net.ipv4.ip_forward=1
sudo iptables -t nat -A POSTROUTING -o ens18 -j MASQUERADE
sudo iptables -A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --set-mss 1400
sudo systemctl stop ufw
And also this one:
sudo iptables -I FORWARD 1 -j ACCEPT
Error massage :
...adress already in use
or others.
Solutions:
lsmod | grep <8000,tcp,udp,amf,upf...>
kill -9 <ID>
ps nux | grep <open,free,listen>
ss -ltcp
sudo lsof <-i:80,8000,...>
./force_kill.sh
Error massage from 5gc :
Cannot find Served TAI in AMF
Error massage from gnb :
NG Setup procedure is failed. Cause: misc/unknown-PLMN
Wrong command in running gnb, remember to check it's not open5gs :
build/nr-gnb -c config/open5gs-gnb.yaml
2024/06
sudo ifconfig rename2:0 192.168.0.101
在裝3.1版本測試時webconsole出問題:
Solution:用chrome的無痕分頁開啟webconsole就成功了,所以是cookie出了問題
Problem:
CreateSmContextRequest Error: undefined response type
Solution:
Reinstall the ubuntu18.04.
重灌之後重新安裝free5gc_v3.2就成功連線
In this link, I install the VNC so I can do remote work.
sudo apt-get install x11vnc -y
The first code, I got a problem in getting the vnc, then I knew the command apt-get need update, after updating it worked.
sudo x11vnc -storepasswd /etc/x11vnc.pass
sudo nano /etc/systemd/system/x11vnc.service
[Unit]
Description=Start x11vnc at startup.
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -auth /run/user/1000/gdm/Xauthority -forever -loop -noxdamage -repeat -rfbauth /etc/x11vnc.pass -rfbport 5900 -shared
[Install]
WantedBy=multi-user.target
sudo systemctl enable x11vnc
sudo service x11vnc start
Then kept doing the instructions to set password, give the config, enable it.
ifconfig
sudo apt install net-tool
Installing net-tool, so we can get the information of network interface card.Then take a look in rename3, the inet 192.168.31.18 is what we need to connect this computer in LAN with VNC.
How about doing that in diffrent network doamin, with Annie's help, set the ip 140.118.121.99:1111 for WAN use by entering Xiaomi router setting page(192.168.31.1).
sudo apt-get upgrade
sudo apt-get update
sudo apt-get install openssh-service
(sudo apt-get install -y openssh-service)
sudo nano /etc/ssh/sshd_config
sudo /etc/init.d/ssh restart
The other option to do remote work is by SSH terminal, then we enabled it in this computer too.
When using sudo apt install wireshark, I got this error:
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 4000 (apt)
Wait a minute and type again, because there is another app installing.
After command like this :
wireshark
The window of wireshark will jump out on your computer but there doesnt have your network interface.
sudo dpkg-reconfigure wireshark-common
sudo usermod -a -G wireshark <ubuntu,$user,...>
Then log out and log back in (or reboot), and Wireshark should work correctly without needing additional privileges. Finally, if the problem is still not resolved, it may be that dumpcap was not correctly configured, or there is something else preventing it from operating correctly. In this case, you can set the setuid bit for dumpcap so that it always runs as root.
sudo chmod 4711 `which dumpcap`
One some distros you might get the following error when you execute the command above:
chmod: missing operand after ‘4711’
Try 'chmod --help' for more information.
In this case try running
sudo chmod 4711 `sudo which dumpcap`
Solution
Keyboard doesnt work in wireshark
==>winecfg,change to win10 and save.
==>Change the input source to English(US).
mongo
show dbs
use free5gc
db
db.stats()
show collections
db.<collection_name>.insertOne({ <document } })
db.<collection_name>.find({ <query> })
db.<collection_name>.updateOne({ <query> }, { $set: { <update> } })
db.<collection_name>.deleteOne({ <query> })
db.<collection_name>.drop()
db.dropDatabase()
sudo nano /etc/mongo.conf
sudo systemctl restart mongodb.service
wget https://downloads.mongodb.com/compass/mongodb-compass_1.43.0_amd64.deb
sudo dpkg -i mongodb-compass_1.43.0_amd64.deb
mongodb-compass