open5gs/docs/_docs/platform/02-centos.md

149 lines
3.3 KiB
Markdown
Raw Normal View History

2019-04-27 15:01:51 +00:00
---
title: CentOS
head_inline: "<style> .blue { color: blue; } </style>"
---
This guide is based on **CentOS 8** Distribution.
2019-04-27 15:01:51 +00:00
{: .blue}
### Getting MongoDB
---
Create the MongoDB repository file.
```bash
$ sudo sh -c 'cat << EOF > /etc/yum.repos.d/mongodb-org-3.4.repo
[mongodb-org-3.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/\$releasever/mongodb-org/3.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc
EOF'
```
Install MongoDB with Package Manager.
```bash
sudo yum -y install mongodb-org
sudo systemctl start mongod (if '/usr/bin/mongod' is not running)
```
### Setting up TUN device (No persistent after rebooting)
---
Create the TUN device. Interface name will be `ogstun`.
2019-04-27 15:01:51 +00:00
```bash
$ sudo yum -y install iproute
$ sudo ip tuntap add name ogstun mode tun
2019-04-27 15:01:51 +00:00
$ ip link show
```
Then, to support IPv6-enabled UEs, you must configure your TUN device to support IPv6.
```bash
$ sysctl -n net.ipv6.conf.ogstun.disable_ipv6
2019-04-27 15:01:51 +00:00
1
$ sudo -w net.ipv6.conf.ogstun.disable_ipv6=0
2019-04-27 15:01:51 +00:00
$ sysctl -n net.ipv6.conf.ogstun.disable_ipv6
2019-04-27 15:01:51 +00:00
0
```
**Note:** If your TUN device already supports IPv6, you can skip this steps above.
{: .notice--warning}
You are now ready to set the IP address on TUN device.
```bash
2020-02-17 01:41:16 +00:00
$ sudo ip addr add 10.45.0.1/16 dev ogstun
$ sudo ip addr add cafe::1/64 dev ogstun
2019-04-27 15:01:51 +00:00
```
Make sure it is set up properly.
```bash
$ sudo ip link set ogstun up
2019-04-27 15:01:51 +00:00
$ ip link show
```
**Tip:** The script provided in [$GIT_REPO/misc/netconf.sh](https://github.com/{{ site.github_username }}/open5gs/blob/master/misc/netconf.sh) makes it easy to configure the TUN device as follows:
`$ sudo ./misc/netconf.sh`
2019-04-27 15:01:51 +00:00
{: .notice--info}
### Building Open5GS
2019-04-27 15:01:51 +00:00
---
Configure EPEL package.
```bash
$ sudo dnf install epel-release
```
Enable PowerTools.
```bash
$ sudo dnf install 'dnf-command(config-manager)'
$ sudo dnf config-manager --set-enabled PowerTools
$ sudo update
```
2019-04-27 15:01:51 +00:00
Install the depedencies for building the source code.
```bash
$ sudo dnf install python3 ninja-build gcc flex bison git lksctp-tools-devel libidn-devel gnutls-devel libgcrypt-devel openssl-devel cyrus-sasl-devel libyaml-devel iproute mongo-c-driver-devel
2019-04-27 15:01:51 +00:00
```
Install Meson using Python.
2019-04-27 15:01:51 +00:00
```bash
$ sudo pip3 install --upgrade pip
$ sudo pip install meson
2019-04-27 15:01:51 +00:00
```
Git clone.
2019-04-27 15:01:51 +00:00
```bash
$ git clone https://github.com/{{ site.github_username }}/open5gs
2019-04-27 15:01:51 +00:00
```
To compile with meson:
2019-04-27 15:01:51 +00:00
```bash
$ cd open5gs
$ meson build --prefix=`pwd`/install
$ ninja -C build
2019-04-27 15:01:51 +00:00
```
Check whether the compilation is correct.
```bash
$ ninja -C build test
2019-04-27 15:01:51 +00:00
```
2019-10-27 10:57:18 +00:00
**Tip:** You can also check the result of `ninja -C build test` with a tool that captures packets. If you are running `wireshark`, select the `loopback` interface and set FILTER to `s1ap || gtpv2 || diameter || gtp`. You can see the virtually created packets. [[testsimple.pcapng]]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testsimple.pcapng)
2019-08-25 11:50:01 +00:00
{: .notice--info}
2019-04-27 15:01:51 +00:00
You need to perform the **installation process**.
```bash
$ cd build
$ ninja install
2019-04-27 15:01:51 +00:00
```
### Building WebUI of Open5GS
2019-04-27 15:01:51 +00:00
---
[Node.js](https://nodejs.org/) is required to build WebUI of Open5GS
2019-04-27 15:01:51 +00:00
```bash
$ curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
$ sudo yum -y install nodejs
```
Install the dependencies to run WebUI
```bash
$ cd webui
$ npm install
2019-04-27 15:01:51 +00:00
```
The WebUI runs as an [npm](https://www.npmjs.com/) script.
```bash
$ npm run dev
2019-04-27 15:01:51 +00:00
```