--- title: Building Open5GS from Sources head_inline: "" --- This post explains how to compile and install the source code on **Debian/Ubuntu** based Linux Distribution. {: .blue} ### Getting MongoDB --- Install MongoDB with package manager. It is used as database for the HSS and PCRF. ```bash $ sudo apt update $ sudo apt install mongodb $ sudo systemctl start mongodb (if '/usr/bin/mongod' is not running) $ sudo systemctl enable mongodb (ensure to automatically start it on system boot) ``` ### Setting up TUN device (not persistent after rebooting) --- Create the TUN device with the interface name `ogstun`. ```bash $ sudo ip tuntap add name ogstun mode tun $ sudo ip addr add 10.45.0.1/16 dev ogstun $ sudo ip addr add cafe::1/64 dev ogstun $ sudo ip link set ogstun up ``` **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` {: .notice--info} ### Building Open5GS --- Install the dependencies for building the source code. ```bash $ sudo apt install python3-pip python3-setuptools python3-wheel ninja-build build-essential flex bison git libsctp-dev libgnutls28-dev libgcrypt-dev libssl-dev libidn11-dev libmongoc-dev libbson-dev libyaml-dev libmicrohttpd-dev libcurl4-gnutls-dev meson ``` Git clone. ```bash $ git clone https://github.com/{{ site.github_username }}/open5gs ``` To compile with meson: ```bash $ cd open5gs $ meson build --prefix=`pwd`/install $ ninja -C build ``` Check whether the compilation is correct. ```bash $ ./build/tests/attach/attach ## EPC Only $ ./build/tests/registration/registration ## 5G Core Only ``` Run all test programs as below. ```bash $ cd build $ meson test -v ``` **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 || pfcp || diameter || gtp || ngap || http`. You can see the virtually created packets. [testattach.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testattach.pcapng)/[testregistration.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testregistration.pcapng) {: .notice--info} You need to perform the **installation process**. ```bash $ cd build $ ninja install $ cd ../ ``` ### Configure Open5GS --- From now on, we'll use MCC-MNC of 901-70 and set the IP address as below. _Cloud Authentication and Session Management Server_ ``` MongoDB = 127.0.0.1 (subscriber data) - http://localhost:3000 MME-s1ap = 10.10.0.2 :36412 (authVPN) for S1-MME MME-gtpc = 127.0.0.2 :any for S11 MME-frDi = 127.0.0.2 :3868 for S6a auth SGWC-gtpc = 127.0.0.3 :2123 for S11 SGWC-pfcp = 10.10.0.3 :8805 (authVPN) for Sxa SMF-gtpc = 127.0.0.4 :2123 for S5/8c, N11 SMF-pfcp = 10.10.0.4 :8805 (authVPN) for N4 SMF-frDi = 127.0.0.4 :3868 for Gx auth SMF-sbi = 127.0.0.4 :7777 for 5G SBI (N7,N10,N11) AMF-ngap = 10.10.0.5 :36412 (authVPN) for N2 AMF-sbi = 127.0.0.5 :7777 for 5G SBI (N8,N12,N11) HSS-frDi = 127.0.0.8 :3868 for S6a auth PCRF-frDi = 127.0.0.9 :3868 for Gx auth NRF-sbi = 127.0.0.10:7777 for 5G SBI AUSF-sbi = 127.0.0.11:7777 for 5G SBI UDM-sbi = 127.0.0.12:7777 for 5G SBI UDR-sbi = 127.0.0.13:7777 for 5G SBI ``` _Cloud Userplane Server (to host IMS etc)_ ``` SGWU-pfcp = 10.10.0.6 :8805 (authVPN) for Sxa SGWU-gtpu = 10.11.0.6 :2152 (userplaneVPN) for S1-U, S5/8u UPF-pfcp = 10.10.0.7 :8805 (authVPN) for N4 UPF-gtpu = 10.11.0.7 :2152 (userplaneVPN) for S5/8u, N3 ``` You can refer to the network settings at [{{ site.url }}{{ site.baseurl }}/assets/Open5GS-Diagram.pdf]({{ site.url }}{{ site.baseurl }}/assets/Open5GS-Diagram.pdf) provided by [@kbarlee](https://github.com/kbarlee) in issue [#528](https://github.com/{{ site.github_username }}/open5gs/issues/528) {: .notice--danger} 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. ```diff $ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml --- mme.yaml.old 2020-08-22 11:36:40.512418765 -0400 +++ mme.yaml 2020-08-22 11:36:27.081466682 -0400 @@ -204,20 +204,20 @@ mme: freeDiameter: /home/acetcom/Documents/git/open5gs/install/etc/freeDiameter/mme.conf s1ap: - addr: 127.0.0.2 + addr: 10.10.0.2 gtpc: addr: 127.0.0.2 gummei: plmn_id: - mcc: 001 - mnc: 01 + mcc: 901 + mnc: 70 mme_gid: 2 mme_code: 1 tai: plmn_id: - mcc: 001 - mnc: 01 - tac: 7 + mcc: 901 + mnc: 70 + tac: 1 security: integrity_order : [ EIA1, EIA2, EIA0 ] ciphering_order : [ EEA0, EEA1, EEA2 ] ``` Modify [install/etc/open5gs/sgwc.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/sgwc.yaml.in) to set the PFCP IP address. ```diff $ diff -u /etc/open5gs/sgwc.yaml.old /etc/open5gs/sgwc.yaml @@ -49,7 +49,7 @@ gtpc: addr: 127.0.0.3 pfcp: - addr: 127.0.0.3 + addr: 10.10.0.3 # # sgwu: @@ -100,7 +100,7 @@ # sgwu: pfcp: - addr: 127.0.0.6 + addr: 10.10.0.6 # # parameter: ``` Modify [install/etc/open5gs/smf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/smf.yaml.in) to set the PFCP IP address. ```diff $ diff -u /etc/open5gs/smf.yaml.old /etc/open5gs/smf.yaml --- smf.yaml.old 2020-08-22 11:37:39.990816411 -0400 +++ smf.yaml 2020-08-22 11:38:18.647999952 -0400 @@ -187,8 +187,7 @@ - addr: 127.0.0.4 - addr: ::1 pfcp: - - addr: 127.0.0.4 - - addr: ::1 + - addr: 10.10.0.4 pdn: - addr: 10.45.0.1/16 - addr: cafe::1/64 @@ -282,7 +281,7 @@ # upf: pfcp: - - addr: 127.0.0.7 + - addr: 10.10.0.7 # # parameter: ``` 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. ```diff diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/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/sgwu.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/sgwu.yaml.in) to set the GTP-U and PFCP IP address. ```diff $ diff -u /etc/open5gs/sgwu.yaml.old /etc/open5gs/sgwu.yaml --- sgwu.yaml.old 2020-08-22 11:41:09.214670723 -0400 +++ sgwu.yaml 2020-08-22 11:41:27.433937124 -0400 @@ -51,9 +51,9 @@ # sgwu: gtpu: - addr: 127.0.0.6 + addr: 10.11.0.6 pfcp: - addr: 127.0.0.6 + addr: 10.10.0.6 # # sgwc: ``` 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 and PFCP IP address. ```diff $ diff -u /etc/open5gs/upf.yaml.old /etc/open5gs/upf.yaml --- upf.yaml.old 2020-08-22 11:42:57.781750067 -0400 +++ upf.yaml 2020-08-22 11:43:13.268901616 -0400 @@ -59,11 +59,9 @@ # upf: pfcp: - - addr: 127.0.0.7 + - addr: 10.10.0.7 gtpu: - - addr: - - 127.0.0.7 - - ::1 + - addr: 10.11.0.7 pdn: - addr: 10.45.0.1/16 - addr: cafe::1/64 ``` If you modify the config files while Open5GS daemons are running, please restart them ### Running Open5GS --- Specify the absolute path to the shared library as follows. ```bash $ echo $(cd $(dirname ./install/lib/x86_64-linux-gnu/) && pwd -P)/$(basename ./install/lib/x86_64-linux-gnu/) /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu $ export LD_LIBRARY_PATH=/home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu $ ldd ./install/bin/open5gs-amfd ... libogsapp.so.1 => /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu/libogsapp.so.1 (0x00007f161ab51000) libogscore.so.1 => /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu/libogscore.so.1 (0x00007f161a922000) libogssctp.so.1 => /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu/libogssctp.so.1 (0x00007f161a71d000) libogss1ap.so.1 => /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu/libogss1ap.so.1 (0x00007f161a519000) ... ``` If you want to set the shared library path permanently, you can use ldconfig. ```bash $ sudo sh -c "echo /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu > /etc/ld.so.conf.d/open5gs.conf" $ sudo ldconfig ``` Now let's get started. ```bash $ cd install/bin/ $ ./install/bin/open5gs-mmed Open5GS daemon v1.3.0-213-gd190548+ 08/21 22:53:47.328: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/mme.yaml' (../src/main.c:54) 08/21 22:53:47.328: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/mme.log' (../src/main.c:57) 08/21 22:53:47.365: [app] INFO: MME initialize...done (../src/mme/app-init.c:33) 08/21 22:53:47.365: [gtp] INFO: gtp_server() [127.0.0.2]:2123 (../lib/gtp/path.c:32) 08/21 22:53:47.365: [gtp] INFO: gtp_connect() [127.0.0.3]:2123 (../lib/gtp/path.c:59) 08/21 22:53:47.366: [mme] INFO: s1ap_server() [127.0.0.2]:36412 (../src/mme/s1ap-sctp.c:57) $ ./install/bin/open5gs-sgwcd Open5GS daemon v1.3.0-213-gd190548+ 08/21 22:54:43.059: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/sgwc.yaml' (../src/main.c:54) 08/21 22:54:43.059: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/sgwc.log' (../src/main.c:57) 08/21 22:54:43.065: [app] INFO: SGW-C initialize...done (../src/sgwc/app.c:31) 08/21 22:54:43.066: [gtp] INFO: gtp_server() [127.0.0.3]:2123 (../lib/gtp/path.c:32) 08/21 22:54:43.066: [pfcp] INFO: pfcp_server() [127.0.0.3]:8805 (../lib/pfcp/path.c:32) 08/21 22:54:43.066: [pfcp] INFO: ogs_pfcp_connect() [127.0.0.6]:8805 (../lib/pfcp/path.c:60) $ ./install/bin/open5gs-smfd Open5GS daemon v1.3.0-213-gd190548+ 08/21 22:54:56.000: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/smf.yaml' (../src/main.c:54) 08/21 22:54:56.000: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/smf.log' (../src/main.c:57) 08/21 22:54:56.050: [gtp] INFO: gtp_server() [127.0.0.4]:2123 (../lib/gtp/path.c:32) 08/21 22:54:56.050: [app] INFO: SMF initialize...done (../src/smf/app.c:31) 08/21 22:54:56.050: [gtp] INFO: gtp_server() [::1]:2123 (../lib/gtp/path.c:32) 08/21 22:54:56.050: [pfcp] INFO: pfcp_server() [127.0.0.4]:8805 (../lib/pfcp/path.c:32) 08/21 22:54:56.050: [pfcp] INFO: pfcp_server() [::1]:8805 (../lib/pfcp/path.c:32) 08/21 22:54:56.050: [pfcp] INFO: ogs_pfcp_connect() [127.0.0.7]:8805 (../lib/pfcp/path.c:60) 08/21 22:54:56.051: [sbi] INFO: sbi_server() [127.0.0.4]:7777 (../lib/sbi/server.c:298) $ ./install/bin/open5gs-amfd Open5GS daemon v1.3.0-213-gd190548+ 08/21 22:55:14.015: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/amf.yaml' (../src/main.c:54) 08/21 22:55:14.015: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/amf.log' (../src/main.c:57) 08/21 22:55:14.039: [app] INFO: AMF initialize...done (../src/amf/app.c:33) 08/21 22:55:14.040: [sbi] INFO: sbi_server() [127.0.0.5]:7777 (../lib/sbi/server.c:298) 08/21 22:55:14.040: [amf] INFO: ngap_server() [127.0.0.5]:38412 (../src/amf/ngap-sctp.c:56) $ ./install/bin/open5gs-sgwud Open5GS daemon v1.3.0-213-gd190548+ 08/21 22:54:10.357: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/sgwu.yaml' (../src/main.c:54) 08/21 22:54:10.357: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/sgwu.log' (../src/main.c:57) 08/21 22:54:10.360: [pfcp] INFO: pfcp_server() [127.0.0.6]:8805 (../lib/pfcp/path.c:32) 08/21 22:54:10.360: [app] INFO: SGW-U initialize...done (../src/sgwu/app.c:31) 08/21 22:54:10.361: [gtp] INFO: gtp_server() [127.0.0.6]:2152 (../lib/gtp/path.c:32) $ ./install/bin/open5gs-upfd Open5GS daemon v1.3.0-213-gd190548+ 08/21 22:54:21.596: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/upf.yaml' (../src/main.c:54) 08/21 22:54:21.596: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/upf.log' (../src/main.c:57) 08/21 22:54:21.601: [pfcp] INFO: pfcp_server() [127.0.0.7]:8805 (../lib/pfcp/path.c:32) 08/21 22:54:21.601: [app] INFO: UPF initialize...done (../src/upf/app.c:31) 08/21 22:54:21.601: [gtp] INFO: gtp_server() [127.0.0.7]:2152 (../lib/gtp/path.c:32) 08/21 22:54:21.601: [gtp] INFO: gtp_server() [::1]:2152 (../lib/gtp/path.c:32) $ ./install/bin/open5gs-hssd Open5GS daemon v1.3.0-213-gd190548+ 08/21 22:57:17.450: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/hss.yaml' (../src/main.c:54) 08/21 22:57:17.450: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/hss.log' (../src/main.c:57) 08/21 22:57:17.451: [dbi] INFO: MongoDB URI: 'mongodb://localhost/open5gs' (../lib/dbi/ogs-mongoc.c:99) 08/21 22:57:17.519: [app] INFO: HSS initialize...done (../src/hss/app-init.c:31) $ ./install/bin/open5gs-pcrfd Open5GS daemon v1.3.0-213-gd190548+ 08/21 22:57:45.894: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/pcrf.yaml' (../src/main.c:54) 08/21 22:57:45.894: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/pcrf.log' (../src/main.c:57) 08/21 22:57:45.896: [dbi] INFO: MongoDB URI: 'mongodb://localhost/open5gs' (../lib/dbi/ogs-mongoc.c:99) 08/21 22:57:45.997: [app] INFO: PCRF initialize...done (../src/pcrf/app-init.c:31) $ ./install/bin/open5gs-nrfd Open5GS daemon v1.3.0-213-gd190548+ 08/21 22:56:35.472: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/nrf.yaml' (../src/main.c:54) 08/21 22:56:35.472: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/nrf.log' (../src/main.c:57) 08/21 22:56:35.472: [app] INFO: NRF initialize...done (../src/nrf/app.c:31) 08/21 22:56:35.473: [sbi] INFO: sbi_server() [127.0.0.10]:7777 (../lib/sbi/server.c:298) 08/21 22:56:35.473: [sbi] INFO: sbi_server() [::1]:7777 (../lib/sbi/server.c:298 $ ./install/bin/open5gs-ausfd Open5GS daemon v1.3.0-213-gd190548+ 08/21 22:55:41.899: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/ausf.yaml' (../src/main.c:54) 08/21 22:55:41.899: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/ausf.log' (../src/main.c:57) 08/21 22:55:41.900: [app] INFO: AUSF initialize...done (../src/ausf/app.c:31) 08/21 22:55:41.900: [sbi] INFO: sbi_server() [127.0.0.11]:7777 (../lib/sbi/server.c:298) $ ./install/bin/open5gs-udmd Open5GS daemon v1.3.0-213-gd190548+ 08/21 22:56:02.154: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/udm.yaml' (../src/main.c:54) 08/21 22:56:02.154: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/udm.log' (../src/main.c:57) 08/21 22:56:02.155: [app] INFO: UDM initialize...done (../src/udm/app.c:31) 08/21 22:56:02.155: [sbi] INFO: sbi_server() [127.0.0.12]:7777 (../lib/sbi/server.c:298) $ ./install/bin/open5gs-udrd Open5GS daemon v1.3.0-213-gd190548+ 08/21 22:56:15.810: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/udr.yaml' (../src/main.c:54) 08/21 22:56:15.810: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/udr.log' (../src/main.c:57) 08/21 22:56:15.813: [dbi] INFO: MongoDB URI: 'mongodb://localhost/open5gs' (../lib/dbi/ogs-mongoc.c:99) 08/21 22:56:15.813: [app] INFO: UDR initialize...done (../src/udr/app.c:31) 08/21 22:56:15.813: [sbi] INFO: sbi_server() [127.0.0.13]:7777 (../lib/sbi/server.c:298) ``` Several command line options are provided. ```bash $ ./install/bin/open5gs-amfd -h Usage: ./install/bin/open5gs-amfd [options] Options: -c filename : set configuration file -l filename : set logging file -e level : set global log-level (default:info) -m domain : set log-domain (e.g. mme:sgw:gtp) -d : print lots of debugging information -t : print tracing information for developer -D : start as a daemon -v : show version number and exit -h : show this message and exit ``` You can also copy the binaries to /usr/bin to be able to run them from anywhere on the system. ```bash $ cp open5gs* /usr/bin/ ``` For convenience, you can execute all NFs at once by using the following command. ```bash $ ./build/tests/app/5gc ## 5G Core Only with ./build/config/sample.yaml $ ./build/tests/app/epc -c ./build/config/srslte.yaml ## EPC Only with ./build/config/srslte.yaml $ ./build/tests/app/app ## Both 5G Core and EPC with ./build/config/sample.yaml ``` ### Building the WebUI of Open5GS --- [Node.js](https://nodejs.org/) is required to build WebUI of Open5GS ```bash $ sudo apt install curl $ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - $ sudo apt install nodejs ``` Install the dependencies to run WebUI ```bash $ cd webui $ npm install ``` The WebUI runs as an [npm](https://www.npmjs.com/) script. ```bash $ npm run dev ``` ### Register Subscriber Information --- Connect to `http://localhost:3000` and login with **admin** account. > Username : admin > Password : 1423 **Note:** 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 restarting any daemon. {: .notice--warning} ### IP routing + NAT for UE internet connectivity --- To allow your phones to connect to the internet, you must run the following command on the host running Open5GS-PGW: ```bash ### Check IP Table 'forward' $ 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 IP Table 'nat' $ 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 $ sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward" ### Add NAT Rule $ sudo iptables -t nat -A POSTROUTING -s 10.45.0.0/16 ! -o ogstun -j MASQUERADE ``` **Note:** The above assumes you do not have any existing rules in the filter and nat tables. If a program such as docker has already set up rules, you may need to add the Open5GS related rules differently. {: .notice--danger} ### Turn on your eNodeB and Phone --- - You can see actual traffic through wireshark -- [[srsenb.pcapng]]({{ site.url }}{{ site.baseurl }}/assets/pcapng/srsenb.pcapng). - You can view the log at `$INSTALL_PREFIX/var/log/open5gs/*.log`. ### Troubleshooting --- Debugging tools can help you troubleshoot problems. - [GDB](https://www.gnu.org/software/gdb/) can be used as below: ```bash $ gdb ./open5gs-amfd ``` - On *Mac OS X*, you can use the [LLDB](https://lldb.llvm.org/). ```bash $ lldb ./open5gs-amfd ``` You can use the command line option[`-d`] to record more logs. ```bash $ ./tests/app/app -d Open5GS daemon v1.3.0-213-gd190548+ 08/21 23:01:54.246: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/build/configs/sample.yaml' (../src/main.c:54) 08/21 23:01:54.246: [thread] DEBUG: [0x7f8de4d25018] worker signal (../lib/core/ogs-thread.c:66) 08/21 23:01:54.246: [thread] DEBUG: [0x7f8de4d25018] thread started (../lib/core/ogs-thread.c:101) Open5GS daemon v1.3.0-213-gd190548+ 08/21 23:01:54.254: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/build/configs/sample.yaml' (../src/main.c:54) 08/21 23:01:54.254: [thread] DEBUG: [0x7ff8d13be818] worker signal (../lib/core/ogs-thread.c:66) 08/21 23:01:54.254: [nrf] DEBUG: nrf_state_initial(): INIT (../src/nrf/nrf-sm.c:25) 08/21 23:01:54.254: [nrf] DEBUG: nrf_state_operational(): ENTRY (../src/nrf/nrf-sm.c:50) 08/21 23:01:54.254: [thread] DEBUG: [0x7ff8d13be818] thread started (../lib/core/ogs-thread.c:101) 08/21 23:01:54.254: [app] INFO: NRF initialize...done (../src/nrf/app.c:31) 08/21 23:01:54.255: [sbi] INFO: sbi_server() [127.0.0.10]:7777 (../lib/sbi/server.c:298) 08/21 23:01:54.255: [sbi] INFO: sbi_server() [::1]:7777 (../lib/sbi/server.c:298) 08/21 23:01:54.296: [thread] DEBUG: [0x7f8de4d25098] worker signal (../lib/core/ogs-thread.c:66) 08/21 23:01:54.296: [thread] DEBUG: [0x7f8de4d25098] thread started (../lib/core/ogs-thread.c:101) Open5GS daemon v1.3.0-213-gd190548+ 08/21 23:01:54.315: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/build/configs/sample.yaml' (../src/main.c:54) 08/21 23:01:54.319: [dbi] INFO: MongoDB URI: 'mongodb://localhost/open5gs' (../lib/dbi/ogs-mongoc.c:99) 08/21 23:01:54.332: [app] INFO: PCRF initialize...done (../src/pcrf/app-init.c:31) 08/21 23:01:54.347: [thread] DEBUG: [0x7f8de4d25118] worker signal (../lib/core/ogs-thread.c:66) 08/21 23:01:54.347: [thread] DEBUG: [0x7f8de4d25118] thread started (../lib/core/ogs-thread.c:101) Open5GS daemon v1.3.0-213-gd190548+ ... ```