Skip to content

Commit 1e7f715

Browse files
committed
fixed typos and added more clear transitions between open5gs tutorial and our tutorial. added footnotes.
1 parent 378f06f commit 1e7f715

File tree

2 files changed

+55
-34
lines changed

2 files changed

+55
-34
lines changed

docs/tutorials/epc-setup.md

Lines changed: 52 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Step 1. LTE Core Network Setup
2+
title: Step 1. LTE EPC (Evolved Packet Core) Network Setup
33
---
44
# Introduction and Overview
55

@@ -17,7 +17,7 @@ You can find more detailed documentation and diagrams of the Open5GS software ar
1717

1818
## Operating System Support
1919

20-
In SCN we will typically perform these installation steps using a fresh install of Ubuntu 22.04 on an x86-64-based computer; however, any operating system that `open5gs` supports should work.
20+
In SCN we will typically perform these installation steps using a fresh install of Ubuntu 24.04 on an x86-64-based computer; however, any operating system that `open5gs` supports should work.
2121

2222
Note: When you're installing Ubuntu, we suggest choosing the "minimal install" option that doesn’t install extra unnecessary software. In prior installs this has led to version conflicts.
2323

@@ -35,54 +35,68 @@ As of November 2024, in the [Open5GS software package](https://github.com/open5g
3535

3636
We would also recommend running the optional WebUI (Web User Interface) service: `open5gs-webui.service`.
3737

38-
The following steps will walk you through this installation process.
38+
The following steps will walk you through this installation process.[^1]
3939

40-
# Step 1: Install Open5GS (Notes and Pointers)
40+
[^1]: A similar step-by-step tutorial to this one can be found [here](https://medium.com/networkers-fiit-stu/setting-up-open5gs-a-step-by-step-guide-or-how-we-set-up-our-lab-environment-5da1c8db0439).
4141

42-
Install Open5GS following the [Open5GS Quickstart documentation](https://open5gs.org/open5gs/docs/guide/01-quickstart/) based on your operating system and desired implementation (e.g. "bare metal" directly on the operating system vs. [Docker](https://github.com/wildeyedskies/docker-open5gs-basic-config)).
43-
There are even [VoLTE](https://open5gs.org/open5gs/docs/tutorial/02-VoLTE-setup/) and [Dockerized VoLTE](https://open5gs.org/open5gs/docs/tutorial/03-VoLTE-dockerized/) implementations of Open5GS.
44-
A similar step-by-step tutorial to this one can be found [here](https://medium.com/networkers-fiit-stu/setting-up-open5gs-a-step-by-step-guide-or-how-we-set-up-our-lab-environment-5da1c8db0439).
42+
# Step 1: Install Open5GS
4543

46-
In SCN we have run Open5GS successfully using Ubuntu 20.04 and 22.04, on bare metal or in Virtual Machines, installed via the `apt` package manager (see Step "2. Install Open5GS with a Package Manager" of the [Quickstart](https://open5gs.org/open5gs/docs/guide/01-quickstart/)).
44+
## Follow the [Open5GS Quickstart guide](https://open5gs.org/open5gs/docs/guide/01-quickstart/) to install Open5gs.
45+
46+
Complete at least Section 2 of the guide based on your operating system (OS) and desired implementation (e.g. "bare metal" directly on the OS vs. [Docker](https://github.com/wildeyedskies/docker-open5gs-basic-config)).[^2]
47+
48+
[^2]: There are even [VoLTE](https://open5gs.org/open5gs/docs/tutorial/02-VoLTE-setup/) and [Dockerized VoLTE](https://open5gs.org/open5gs/docs/tutorial/03-VoLTE-dockerized/) implementations of Open5GS.
49+
50+
In SCN we have run Open5GS successfully using Ubuntu 20.04, 22.04, and 24.04 (on bare metal or in Virtual Machines) and installed via the `apt` package manager (see Step "2. Install Open5GS with a Package Manager" of the [Quickstart](https://open5gs.org/open5gs/docs/guide/01-quickstart/)).
4751
First install MongoDB as described in the Quickstart. Then follow instructions under the "Ubuntu" section to install Open5GS via apt.
4852

49-
Note: If installing over a `ssh` connection, we recommend using `tmux` or another program in case you get disconnected from the session in the process.
53+
We also recommend Section 3, though it is not required.
54+
This will later allow you to register subscribers via the GUI steps provided in the "Register Subscriber Information" section of the Quickstart.
55+
56+
After these two sections of the Quickstart, you can mostly return to our tutorial here.
57+
However, later on in the Networking section we will also be completing the Quickstart steps to "enable forwarding and add the NAT rule" section called "Adding a route for the UE to have WAN connectivity," so you can complete them now if you wish.
58+
59+
_Note: If installing Open5GS over a_ `ssh` _connection, we recommend using_ `tmux` _or another program in case you get disconnected from the session in the process._
5060

51-
## Configure MME and SGWU
61+
# Step 2: Configure Open5gs Components (MME and SGWU)
5262

53-
Note that for our LTE setup, the MME and SGWU are the only components whose config files you will really need to change from the defaults.
63+
For our LTE setup, the MME and SGWU are the only components whose config files you will need to change from the defaults.
5464

55-
### MME
65+
## MME
5666
Edit the `/etc/open5gs/mme.yaml` file (as root or using `sudo`) as follows:
57-
- Under `mme:` -> `s1ap:` -> `server:` -> `address:`, set the IP address you will assign to the network interface (likely an ethernet port) on your EPC computer which will be connecting to the eNB. In this tutorial (to match with the Network Configuration section that follows), we will use `192.168.150.1`.
67+
- Under `mme:` -> `s1ap:` -> `server:` -> `address:`, set the IP address you will assign to the network interface (likely an ethernet port) on your EPC computer which will be connecting to the eNB. In this tutorial (to match with the Network Configuration section that follows), we will use `192.168.150.2`.
5868
- Under both `mme:` -> `gummei:` and `mme:` -> `tai:`, you will need to change the `plmn_id:` (`mcc:` and `mnc:` values) to match the PLMN you are using for your network. In SCN we use `315` for the MCC and `010` for the MNC, as explained in the "Quick explanation" below.
5969

6070
**Quick explanation:** "PLMN" refers to the [Public Land Mobile Network](https://en.wikipedia.org/wiki/Public_land_mobile_network), in which every network has to have a unique carrier ID defined by the 3-digit "mobile country code (MCC)" and a 2 or 3-digit "mobile network code (MNC)". Alternately, for iPhone compatibility in the US, SCN uses the CBRS "private LTE" PLMN assigned by Apple as described in [this doc](https://support.apple.com/guide/deployment/support-for-private-5g-and-lte-networks-depac6747317/web).
6171

6272
- Note that for the purposes of eNB config later, the Tracking Area Code (or TAC) listed under `mme:` -> `tai:` -> `tac:` will need to match the TAC number configured on the eNB (using the default of 1 is fine).
6373
- Optional: Edit `network_name:` (full and short) and `mme_name:` as desired. One of these names will show up on smartphones' lock screens as the "carrier" when the phone is attached to the network.
6474

65-
### SGWU
75+
## SGWU
6676
Edit the `/etc/open5gs/sgwu.yaml` file (as root or using `sudo`) as follows:
67-
- Under `sgwu:` -> `gtpu:` -> `server:` -> `address:`, set the IP address you will assign to the network interface on your EPC computer which will be connecting to the eNB (this should be the same as the IP address of the MME set above, if the MME and SGWU are running on the same machine). In this tutorial we will use `192.168.150.1`.
77+
- Under `sgwu:` -> `gtpu:` -> `server:` -> `address:`, set the IP address you will assign to the network interface on your EPC computer which will be connecting to the eNB (this should be the same as the IP address of the MME set above, if the MME and SGWU are running on the same machine). In this tutorial we will use `192.168.150.2`.
6878

6979
As mentioned in the Quickstart, after changing the config files, you will need to restart the corresponding Open5GS daemons:
7080
```bash
7181
sudo systemctl restart open5gs-mmed
7282
sudo systemctl restart open5gs-sgwud
7383
```
74-
However, the MME will likely not start correctly until networking is configured, as described below.
84+
However, the MME will not start correctly until networking is configured, as described below.
7585

76-
# Step 2: Configure Networking
86+
# Step 3: Configure Networking
7787

78-
Remember to follow all the network configuration steps in the [Open5GS Quickstart documentation](https://open5gs.org/open5gs/docs/guide/01-quickstart/). For SCN's Ubuntu machines, this means:
88+
Setting up networking can be the most finicky part of Open5GS configuration, and the source of most failures/bugs.
7989

80-
- Allowing IP forwarding on your machine, e.g. via the following command:
81-
```bash
82-
sudo sysctl -w net.ipv4.ip_forward=1
83-
```
90+
For SCN's Ubuntu machines, this means:
91+
92+
- Allowing IP forwarding on your machine, e.g. via the following options:
93+
- For immediate application, run the command
94+
```bash
95+
sudo sysctl -w net.ipv4.ip_forward=1
96+
```
97+
- For persistence, in `/etc/sysctl.conf` remove the `#` comment symbol from the front of the line that says `net.ipv4.ip_forward=1`
8498
- Using Netplan to configure network interfaces with IP addresses in the desired way.
85-
- Setting up NAT rules using `iptables` so that traffic from the eNB can reach the Internet and vice versa
99+
- Setting up NAT rules using `iptables` so that traffic from the eNB can reach the Internet and vice versa.
86100

87101
The latter two steps are explained in detail below.
88102

@@ -99,7 +113,7 @@ line. A list of network interfaces will appear in the terminal. Find the ones
99113
corresponding to your ethernet ports (their names usually start with “eth,”
100114
“enp,” or “enx”).
101115

102-
For Ubuntu 22.04, we're currently using the Netplan program to manage our network configuration.
116+
For Ubuntu 24.04, we're currently using the Netplan program to manage our network configuration.
103117
Create a file in the `/etc/netplan` directory (i.e. a folder) named
104118
`99-open5gs-config.yaml`, and add the following lines, substituting the correct
105119
interface names and subnets for your configuration:
@@ -155,7 +169,7 @@ route local traffic between the EPC and eNB.
155169
network:
156170
ethernets:
157171
enp1s0: # name of ethernet interface
158-
dhcp4: true
172+
dhcp4: yes
159173
addresses:
160174
- 192.168.150.2/24 # list all downstream networks
161175
- 192.168.151.2/24
@@ -175,7 +189,7 @@ recommended configuration above, you may need to connect that EPC ethernet port
175189
to something (e.g. the eNB, a switch, another machine) via an ethernet cable to
176190
wake the interface up (so that it becomes active and takes on the assigned IP
177191
addresses). This is because the open5gs MME needs to "bind" (or associate) its S1 interface to one of those IP
178-
addresses (in this case `192.168.0.2`). Until those IP addresses exist on your machine,
192+
addresses (in this case `192.168.150.2`). Until those IP addresses exist on your machine,
179193
the MME will continually throw errors if you try to run it.
180194
181195
## Setting `iptables` NAT rules to connect the eNB to the Internet
@@ -186,9 +200,11 @@ There might be an easier way to do this, but we've found the cleanest and most r
186200

187201
```bash
188202
sudo iptables -t nat -A POSTROUTING -s 192.168.151.0/24 -j MASQUERADE
203+
sudo iptables -t nat -A POSTROUTING -s 10.45.0.0/16 ! -o ogstun -j MASQUERADE
189204
```
190205

191206
**Quick explanation:** The `-t nat` option tells IPTables to install the rule in the correct "table" containing all the NAT rules, and the `-A` option means we're **A**dding the rule as opposed to **D**eleting it (`-D`). `POSTROUTING` is the "chain," or particular list of rules, that this type of NAT rule should go in (more on that [here](https://rlworkman.net/howtos/iptables/chunkyhtml/c962.html) and in this [diagram](https://upload.wikimedia.org/wikipedia/commons/3/37/Netfilter-packet-flow.svg) if you're interested). `-s 192.168.151.0/24` means that we're applying this rule to packets from the **S**ource IP addresses described by the subnet `192.168.151.0/24`. `-j MASQUERADE` means the action we'll be **J**umping to as a result of this rule is "masquerading" the source IP address as my EPC's WAN IP address.
207+
The second rule allows traffic from the LTE clients on the open5gs subnet to get routed out to the Internet as well.
192208
193209
### 'Persist' IPTables Configuration
194210
@@ -211,7 +227,7 @@ sudo iptables-save > /etc/iptables/rules.v4
211227
sudo iptables-restore < /etc/iptables/rules.v4
212228
```
213229
214-
# Step 3: Start and monitor Open5GS software services
230+
# Step 4: Start and monitor Open5GS software services
215231
216232
Ubuntu’s built-in logging and monitoring services can be used to monitor the core network services. For example, for seeing the output logs of the MME software component we described in the first section, run the following command in the Terminal:
217233
@@ -225,7 +241,7 @@ OR
225241
sudo systemctl status open5gs-mmed.service
226242
```
227243
228-
_Tab complete may be able to fill in the service name for systemctl at least._
244+
_Tab complete may be able to fill in the service name for_ `systemctl` _though often not for_ `journalctl`.
229245
230246
Learning to read output logs is really important for managing software infrastructure! Simply Googling output messages that seem important but that you don't understand can be a good first step to figuring out how a system is working. Another interesting tool to investigate is [Wireshark](https://www.wireshark.org/), which is essentially a graphical user interface (GUI) version of the [tcpdump](https://www.tcpdump.org/) command line tool that can show you the communications [packets](https://en.wikipedia.org/wiki/Network_packet) flowing through the various network cards on your computer.
231247

@@ -244,12 +260,14 @@ The following command will start only the systemd services required for LTE. How
244260
sudo systemctl start open5gs-hssd.service open5gs-mmed.service open5gs-sgwud.service open5gs-sgwcd.service open5gs-pcrfd.service open5gs-upfd.service open5gs-smfd.service
245261
```
246262

247-
### Install and Start the WebUI
263+
### Start the WebUI
248264

249-
The WebUI is another systemd service and runs by default on your local computer at port 9999.
250-
It requires some more dependencies to install, such as `nodejs` (see Step "3. Install the WebUI of Open5GS" in the [Quickstart](https://open5gs.org/open5gs/docs/guide/01-quickstart/)). You can reach it by navigating to `http://localhost:9999` in your web browser.
265+
The WebUI is another (optional) systemd service you may have chosen to install while following the Open5gs Quickstart.
266+
It is a web portal that runs by default on port 9999 on the EPC computer.
267+
You can reach it by navigating to `http://localhost:9999` in your web browser.
268+
It requires some more dependencies to install, such as `nodejs` (see Step "3. Install the WebUI of Open5GS" in the [Quickstart](https://open5gs.org/open5gs/docs/guide/01-quickstart/)).
251269

252-
If not already started, start it with the following command:
270+
If the service has not already started, start it with the following command:
253271

254272
```bash
255273
sudo systemctl start open5gs-webui.service
@@ -259,7 +277,7 @@ The default WebUI login credentials are as follows:
259277
- Username : admin
260278
- Password : 1423
261279

262-
# Step 4: Add Users to Open5GS database
280+
# Step 5: Add Users to Open5GS database
263281

264282
(Note that an important pre-condition to adding users is to have SIM cards or eSIMs to give to the users for authentication, along with their respective IMSIs and secret keys to register them onto the EPC. These must be procured separately.
265283
WIP- We will endeavor to make guides for these processes available soon.)
@@ -289,7 +307,7 @@ add_ue_with_apn {imsi key opc apn}: adds a user to the database with a specific
289307

290308
The help text also tells you that "default values are as follows: APN "internet", dl_bw/ul_bw 1 Gbps, PGW address is 127.0.0.3, IPv4 only".
291309

292-
# Step 5: Maintenance and Management
310+
# Step 6: Maintenance and Management
293311

294312
## Updating Open5GS
295313
WIP: We are working on an Ansible-based management script for updates and will post updates as they occur.

mkdocs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ theme: readthedocs
44
plugins:
55
- search
66
- awesome-pages
7+
8+
markdown_extensions:
9+
- markdown.extensions.footnotes

0 commit comments

Comments
 (0)