open5gs/docs/_docs/guide/01-quickstart.md

343 lines
10 KiB
Markdown
Raw Normal View History

2019-04-27 15:01:51 +00:00
---
2019-06-12 09:15:11 +00:00
title: Quickstart
2019-04-27 15:01:51 +00:00
---
**Note:** Open5GS supports installation of packages in *Debian/Ubuntu and openSUSE* environments. *CentOS, Fedora, FreeBSD, and Mac OSX* require you to [build with source code]({{ site.url }}{{ site.baseurl }}/docs/guide/02-building-open5gs-from-sources)
2019-04-27 15:01:51 +00:00
{: .notice--warning}
### Install Open5GS with a Package Manager
2019-04-27 15:01:51 +00:00
---
2020-07-10 20:50:23 +00:00
#### Ubuntu
2020-02-07 06:51:36 +00:00
*Ubuntu* makes it easy to install Open5GS as shown below,
2019-04-27 15:01:51 +00:00
```bash
$ sudo apt update
$ sudo apt install software-properties-common
2019-04-29 13:26:52 +00:00
$ sudo add-apt-repository ppa:open5gs/latest
2019-04-27 15:01:51 +00:00
$ sudo apt update
$ sudo apt install open5gs
2019-04-27 15:01:51 +00:00
```
2020-07-10 20:50:23 +00:00
#### Debian
The Open5GS packages for Debian are available on [OBS](https://build.opensuse.org/project/show/home:acetcom:open5gs). If you want to use the latest Debian version like *Debian* 10(Buster), you need to install MongoDB first.
2019-04-29 13:26:52 +00:00
2020-02-07 06:51:36 +00:00
```bash
$ sudo apt update
$ sudo apt install wget gnupg
2020-07-10 20:50:23 +00:00
$ wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -
2020-02-07 06:51:36 +00:00
$ echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/4.2 main" | sudo tee /etc/apt/sources.list.d/mongodb-org.list
2020-07-10 20:50:23 +00:00
$ wget -qO - https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/Debian_10/Release.key | sudo apt-key add -
2019-10-29 09:22:48 +00:00
$ sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/Debian_10/ ./' > /etc/apt/sources.list.d/open5gs.list"
2019-04-27 15:01:51 +00:00
$ sudo apt update
2020-07-10 20:50:23 +00:00
$ sudo apt install mongodb-org
$ sudo apt install open5gs
2019-04-27 15:01:51 +00:00
```
2019-04-29 13:26:52 +00:00
2020-02-07 06:51:36 +00:00
Other distributions can be installed by changing the path.
2019-04-29 13:26:52 +00:00
2019-04-27 15:01:51 +00:00
```
2020-07-10 21:49:33 +00:00
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/Debian_10/
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/Debian_Testing/
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/Debian_Unstable/
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/Raspbian_10/
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_18.04/
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_19.04/
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_19.10/
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_20.04/
```
Nightly package build are provided by [Osmocom](https://osmocom.org) on [OBS](https://build.opensuse.org/package/show/network:osmocom:nightly/open5gs).
```
https://download.opensuse.org/repositories/network:/osmocom:/nightly/Debian_10/
https://download.opensuse.org/repositories/network:/osmocom:/nightly/Debian_Testing/
https://download.opensuse.org/repositories/network:/osmocom:/nightly/Debian_Unstable/
https://download.opensuse.org/repositories/network:/osmocom:/nightly/Raspbian_10/
https://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_18.04/
https://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_18.10/
https://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_19.04/
https://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_19.10/
2019-04-27 15:01:51 +00:00
```
2020-07-10 20:50:23 +00:00
#### openSUSE
[Martin Hauke](https://build.opensuse.org/user/show/mnhauke) packaged Open5GS for *openSUSE* on [OBS](https://build.opensuse.org/package/show/home:mnhauke:open5gs/open5gs).
2019-04-27 15:01:51 +00:00
```bash
$ sudo zypper addrepo -f obs://home:mnhauke:open5gs home:mnhauke:open5gs
2019-04-27 15:01:51 +00:00
$ sudo zypper install mongodb-server mongodb-shell
$ sudo zypper install open5gs
2019-04-27 15:01:51 +00:00
```
### Configure Open5GS
2019-04-27 15:01:51 +00:00
---
2020-08-22 03:33:45 +00:00
#### 5G Core
Modify [install/etc/open5gs/amf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/amf.yaml.in) to set the NGAP IP address, PLMN ID, TAC and NSSAI.
In the below example we
- use MCC-MNC of 901-70, as this is the home network of the default IMSIs of the sysmoUSIM-SJS1 cards.
- use 10.10.0.5 for the NGAP connection of AMF to the gNB
- use 10.11.0.7 for the GTP-U connection of UPF to the gNB
```diff
diff -u amf.yaml.old amf.yaml
--- amf.yaml.old 2020-06-21 23:34:14.643114779 -0400
+++ amf.yaml 2020-06-21 23:34:28.718482095 -0400
@@ -67,25 +67,25 @@
- addr: 127.0.0.5
port: 7777
ngap:
- - addr: 127.0.0.5
+ - addr: 10.10.0.5
guami:
- plmn_id:
- mcc: 001
- mnc: 01
+ mcc: 901
+ mnc: 70
amf_id:
region: 2
set: 1
tai:
- plmn_id:
- mcc: 001
- mnc: 01
- tac: 7
+ mcc: 901
+ mnc: 70
+ tac: 1
plmn:
- plmn_id:
- mcc: 001
- mnc: 01
+ mcc: 901
+ mnc: 70
s_nssai:
- sst: 1
- - sd: 2
security:
integrity_order : [ NIA1, NIA2, NIA0 ]
ciphering_order : [ NEA0, NEA1, NEA2 ]
```
Modify [install/etc/open5gs/upf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/upf.yaml.in) to set the GTP-U IP address.
```diff
diff -u upf.yaml.old upf.yaml
--- upf.yaml.old 2020-06-21 23:35:54.378631781 -0400
+++ upf.yaml 2020-06-21 23:36:02.978245251 -0400
@@ -61,6 +61,7 @@
pfcp:
- addr: 127.0.0.7
gtpu:
- - addr: 127.0.0.7
+ - addr: 10.11.0.7
pdn:
```
After changing conf files, please restart Open5GS daemons.
```bash
$ sudo systemctl restart open5gs-amfd
$ sudo systemctl restart open5gs-upfd
```
#### EPC
Modify [install/etc/open5gs/mme.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/mme.yaml.in) to set the S1AP IP address, PLMN ID, and TAC.
In the below example we
- use MCC-MNC of 901-70, as this is the home network of the default IMSIs of the sysmoUSIM-SJS1 cards.
- use 10.10.0.2 for the S1AP connection of MME to the eNB
- use 10.11.0.6 for the GTP-U connection of SGW-U to the eNB
2019-04-27 15:01:51 +00:00
```diff
diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
--- mme.yaml.old 2018-04-15 18:28:31.000000000 +0900
+++ mme.yaml 2018-04-15 19:53:10.000000000 +0900
2020-08-22 03:33:45 +00:00
@@ -204,20 +204,20 @@ logger:
2019-04-27 15:01:51 +00:00
mme:
2020-08-22 03:33:45 +00:00
freeDiameter: @sysconfdir@/freeDiameter/mme.conf
2019-04-27 15:01:51 +00:00
s1ap:
2020-08-22 03:33:45 +00:00
- addr: 127.0.0.2
+ addr: 10.10.0.2
2019-04-27 15:01:51 +00:00
gtpc:
2020-08-22 03:33:45 +00:00
addr: 127.0.0.2
gummei:
2019-04-27 15:01:51 +00:00
plmn_id:
- mcc: 001
- mnc: 01
+ mcc: 901
+ mnc: 70
mme_gid: 2
mme_code: 1
tai:
plmn_id:
- mcc: 001
- mnc: 01
2020-08-22 03:33:45 +00:00
- tac: 7
2019-04-27 15:01:51 +00:00
+ mcc: 901
+ mnc: 70
2020-08-22 03:33:45 +00:00
+ tac: 1
2019-04-27 15:01:51 +00:00
security:
integrity_order : [ EIA1, EIA2, EIA0 ]
ciphering_order : [ EEA0, EEA1, EEA2 ]
2020-08-22 03:33:45 +00:00
2019-04-27 15:01:51 +00:00
```
2020-08-22 03:33:45 +00:00
Modify [install/etc/open5gs/sgwu.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/sgwu.yaml.in) to set the GTP-U IP address.
2019-04-27 15:01:51 +00:00
```diff
2020-08-22 03:33:45 +00:00
diff -u /etc/open5gs/sgwu.yaml.old /etc/open5gs/sgwu.yaml
--- sgwu.yaml.old 2018-04-15 18:30:25.000000000 +0900
+++ sgwu.yaml 2018-04-15 18:30:30.000000000 +0900
@@ -51,7 +51,7 @@ logger:
#
sgwu:
2019-04-27 15:01:51 +00:00
gtpu:
2020-08-22 03:33:45 +00:00
- addr: 127.0.0.6
+ addr: 10.11.0.6
pfcp:
addr: 127.0.0.6
2019-04-27 15:01:51 +00:00
```
2020-08-22 03:33:45 +00:00
After changing conf files, please restart Open5GS daemons.
2019-04-27 15:01:51 +00:00
```bash
$ sudo systemctl restart open5gs-mmed
2020-08-22 03:33:45 +00:00
$ sudo systemctl restart open5gs-sgwud
2019-04-27 15:01:51 +00:00
```
### Install WebUI of Open5GS
2019-04-27 15:01:51 +00:00
---
[Node.js](https://nodejs.org/) is required to install WebUI of Open5GS
2019-04-27 15:01:51 +00:00
1. *Debian and Ubuntu* based Linux distributions can install [Node.js](https://nodejs.org/) as follows:
```bash
$ sudo apt update
2019-04-27 15:01:51 +00:00
$ sudo apt install curl
2019-05-26 08:18:56 +00:00
$ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
2019-04-27 15:01:51 +00:00
$ sudo apt install nodejs
```
2. To install [Node.js](https://nodejs.org/) on *openSUSE*, run the following:
```bash
$ sudo zypper install nodejs8
```
You can now install WebUI of Open5GS.
2019-04-27 15:01:51 +00:00
```bash
$ curl -sL {{ site.url }}{{ site.baseurl }}/assets/webui/install | sudo -E bash -
2019-04-27 15:01:51 +00:00
```
### Register Subscriber Information
---
Connect to `http://localhost:3000` and login with **admin** account.
> Username : admin
> Password : 1423
**Tip:** You can change the password in _Account_ Menu.
{: .notice--info}
To add subscriber information, you can do WebUI operations in the following order:
1. Go to `Subscriber` Menu.
2. Click `+` Button to add a new subscriber.
3. Fill the IMSI, security context(K, OPc, AMF), and APN of the subscriber.
4. Click `SAVE` Button
**Tip:** This addition immediately affects Open5GS without restaring any daemon.
2019-04-27 15:01:51 +00:00
{: .notice--info}
### Adding a route for UE to have Internet connectivity {#UEInternet}
2019-04-27 15:01:51 +00:00
---
If your phone can connect to internet, you must run the following command in Open5GS-PGW installed host.
2019-04-27 15:01:51 +00:00
```bash
2019-06-01 15:32:32 +00:00
### Check IP Tables
$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
### Check NAT Tables
$ sudo iptables -L -t nat
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
### Enable IPv4 Forwarding
2019-04-27 15:01:51 +00:00
$ sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
2019-06-01 15:32:32 +00:00
### Add NAT Rule
2020-02-17 01:41:16 +00:00
$ sudo iptables -t nat -A POSTROUTING -s 10.45.0.0/16 ! -o ogstun -j MASQUERADE
2019-04-27 15:01:51 +00:00
```
2019-06-01 15:32:32 +00:00
**Note:** For the first time, it is a good condition if you do not have any rules in the IP/NAT tables. If a program such as docker has already set up a rule, you will need to add a rule differently.
2019-04-27 15:01:51 +00:00
{: .notice--danger}
### Turn on your eNodeB and Phone
---
2019-06-12 09:15:11 +00:00
- Connect your eNodeB to the IP of your server via the standard S1AP port of SCTP 36412 (for MME)
2019-04-27 15:01:51 +00:00
- You can see actual traffic through wireshark -- [[srsenb.pcapng]]({{ site.url }}{{ site.baseurl }}/assets/pcapng/srsenb.pcapng).
- You can view the log at `/var/log/open5gs/*.log`.
2019-04-27 15:01:51 +00:00
### Uninstall Open5GS and WebUI
2019-04-27 15:01:51 +00:00
How to remove Open5GS package:
2019-04-27 15:01:51 +00:00
2020-07-10 20:50:23 +00:00
1. On *Ubuntu/Debian*:
2019-04-27 15:01:51 +00:00
```bash
$ sudo apt purge open5gs
$ sudo apt autoremove
2019-04-27 15:01:51 +00:00
```
2. On *openSUSE*:
```bash
$ sudo zypper rm open5gs
2019-04-27 15:01:51 +00:00
```
You may need to remove manually `/var/log/open5gs` unless it is empty.
2019-04-27 15:01:51 +00:00
```bash
$ sudo rm -Rf /var/log/open5gs
2019-04-27 15:01:51 +00:00
```
The WebUI of Open5GS can be removed as follows:
2019-04-27 15:01:51 +00:00
```bash
curl -sL {{ site.url }}{{ site.baseurl }}/assets/webui/uninstall | sudo -E bash -
```