# Conducting the First 5G Test with free5GC

After successfully installing free5GC, let's proceed with our first 5G user test, where the UE will perform 5G registration and establish a PDU session connection.

As we confirmed in the previous article, our 5G core network functions are up and running. The good news is that all 5G core functions are preconfigured, allowing us to begin testing right away.

```bash
docker compose ps -a
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1725109832832/5a916307-88a5-45e6-802e-5d9aac80b7cd.png align="center")

In order to perform the test we only need:

* To ensure that 5G subscriber information of our 5G test UE is correctly provisioned in `UDM`.
    
* A 5G UE and 5G RAN (gNB): the container named `UERANSIM` is used to simulate UE and RAN functions. UE and RAN are also preconfigured, so we only need to start the UE (i.e. turning on our 5G test UE).
    

So let's get started.

`WEBUI` container can be used to manage subscribers data via GUI (we can think of it as a simple Web UI of the `UDM`).

`WEBUI` container is externally accessible on port `5000`, so all we need to do is to open the web browser and type the URL `http://YOUR_MACHINE_IP_ADDRESS:5000`. In case you are running free5GC locally in your machine, you can use `localhost` or your loopback IP `127.0.0.1` as `YOUR_MACHINE_IP_ADDRESS`. If you are using a remote machine, type the IP address of the machine or domain name (if available).

The WEBUI GUI will be shown as below.

The default user name is `admin` and the default password is `free5gc` (you can change it after login).

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1725029101367/d539d991-4529-4093-b26c-057c0ce14927.png align="center")

After a successful login, the following page will be displayed. In the left side of the page, click on `SUBSCRIBERS`.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1725029365091/3017fb37-0a83-4eea-949d-d2e1178e9bf2.png align="center")

Initially there is no subscribers data available as shown below. Let's provision our first test 5G subscriber by clicking on create.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1725029481065/841d9469-1eb9-4586-aa36-ce237894b5ac.png align="center")

Once we click on create, a form will be displayed with fields about 5G subscriber needed information such as (SUPI/IMSI, MSISDN, PLMNID, Authentication Key, UE subscribed slices, Data Network Names `DNN`, etc...).

We will notice that the fields are already auto filled with some information, which is the same UE information preconfigured inside `UERANSIM` container. We can change it of course, but we will need to change UE configuration as well in this case, so let's keep everything simple for now and create the subscriber with the auto filled information.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1725031821752/f9b71aa8-f7ae-4fe0-acbc-c9beab1f313f.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1725032146807/f16dd115-a21d-4ff7-99d5-f3cc662c4ce9.png align="center")

Scroll down the page and click `CREATE` to provision the subscriber.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1725032198634/5f19f12b-016d-4eef-b763-cf1f519fe8bc.png align="center")

Once created, it will be shown in the subscribers list.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1725032378367/c38de33b-cbba-4464-83af-2d6f2c1cd7a1.png align="center")

Next let's turn on our 5G test UE.

We will need to start the UE from inside `UERANSIM` container, `docker exec` command can be used to get access to a container shell in order to run commands inside container.

```bash
docker exec -it ueransim bash
```

Once executed we will get bash terminal access inside `UERANSIM` container. You will notice that the prompt has changed to `root@CONTAINER_ID:/ueransim#` which indicates that we are currently running commands inside container.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1725032789208/a79b6a96-ef96-41f5-9434-8067f5c9a327.png align="center")

If we list the contents of the current directory using `ls -ltr` command, we will find (among other stuff) two executable files named `nr-ue` and `nr-gnb` which are actually the programs that simulates 5G UE and 5G RAN respectively.

Moreover, a directory named `config` is listed which contains two configuration files `uecfg.yaml` and `gnbcfg.yaml` for 5G UE and 5G RAN configuration.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1725033745093/e53f8f83-88ad-4278-bbe1-1a619cd48f04.png align="center")

Let's check the contents of `uecfg.yaml` file as it should have the same UE information that we provisioned earlier in `UDM` via `WEBUI`.

```bash
cat config/uecfg.yaml
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1725034098930/9ee1bf46-58df-434d-9319-2bbd992c2bba.png align="center")

As shown above, the information inside `uecfg.yaml` file is identical with subscriber information that was previously provisioned in `UDM`.

Let now power on our 5G test UE using the following command. Once executed, the logs about UE `initial registration` and `PDU session establishment` will be displayed.

```bash
./nr-ue -c config/uecfg.yaml
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1725053805135/2deba0b2-0609-4376-a123-82a1fb33b30f.png align="center")

From the logs it is shown that the UE has successfully registered under 5G network and it has also established two PDU sessions.

A linux `tun` interface will be created inside the container for each PDU session (`uesimtun0` and `uesimtun1`) with the IP address assigned to the UE during PDU establishment. To verify this, let's start another terminal session inside `UERANSIM` container and list the interfaces using the following command

```bash
ip address show
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1725054889577/7e344e6e-f54b-4b26-b05f-c5f8233d9de9.png align="center")

Let's now try to ping internet from the `tun` interface

```bash
ping -I uesimtun0 google.com
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1725055075772/176f5faf-2209-45e0-a53d-565e6cb40602.png align="center")

```bash
ping -I uesimtun1 google.com
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1725055233957/a33a7209-19f3-4e0b-b42f-5f48325bc67b.png align="center")

🥳 Yaay! our UE can reach the internet!

If we check `REALTIME STATUS` in `WEBUI`, we will find that our test UE is shown in connected status.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1725110234195/9769184a-f5f4-4b45-9c43-58dd95eac18c.png align="center")

We can see more info by clicking on `SHOW INFO`

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1725110342610/5e770cfa-6220-405d-b773-4698ce8a0b61.png align="center")

We can also check the logs from 5G core side in order to see the interaction between 5G core NFs during the test. `docker logs` command can be used for this.

* NRF logs
    

```bash
docker logs nrf
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1725109059212/973cf568-ea9a-47c4-be64-f0ac5cdd8970.png align="center")

* NSSF logs
    

```bash
docker logs nssf
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1725109214417/70352e30-2322-4ef7-a871-5d82642ce4e5.png align="center")

* AMF logs
    

```bash
docker logs amf
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1725056321223/e8cd4582-82bc-4728-a12c-c0ca0c9ba5d7.png align="center")

* AUSF logs
    

```bash
docker logs ausf
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1725056483565/c7eab45d-6695-49b9-b034-bc8889def86e.png align="center")

* UDM logs
    

```bash
docker logs udm
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1725056667169/fa921345-7a76-4b2c-9458-3f4ea94321e8.png align="center")

* UDR logs
    

```bash
docker logs udr
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1725107915703/5e527030-88b0-4618-af6a-cdaf6258bd28.png align="center")

* SMF logs
    

```bash
docker logs smf
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1725108123747/af5152eb-5f00-42b0-bea1-6fd4db3be174.png align="center")

* PCF logs
    

```bash
docker logs pcf
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1725108272816/6fb037e6-dca8-4b32-b1cb-29dfa4f6a946.png align="center")

* CHF logs
    

```bash
docker logs chf
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1725108457141/61c5711a-87a8-4548-9d68-c90e23304efb.png align="center")

* UPF logs
    

```bash
docker logs upf
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1725108675518/32b777b9-d55a-4358-bf9a-26d44404b9f2.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1725108779412/cf39db5a-59cb-4d51-892c-b97efa89f3d0.png align="center")

That's all! In the next article, we will try to play with 5GC NFs config files and look closer into 5GC procedures.
