Install and Build CN - SantiagoBH/5G-NSA-Network-with-Mosaic5g GitHub Wiki

Description

A Core Network (CN) typically consists of various network elements, Home Subscriber Server (HSS), Serving Gateway (SGW), Packet Data Network Gateway (PGW), and Policy and Charging Rules Function (PCRF), among others. These network elements work together to provide different functions, such as routing and switching of voice and data traffic, authentication and authorization of users, management of subscriber profiles, policy control and charging, and many others.

The CN is a critical component of mobile networks, and its architecture and functionality can vary depending on the type of network technology used. For example, in a 4G LTE network, the CN uses an IP-based architecture, while in a 5G network, the CN is based on a service-based architecture (SBA) that is designed to be more flexible and scalable.

Install OAI-CN

A network 4G has HSS (Home Subscriber Server Entity), MME (Mobility Management Entity), SPGWC and SPGWU.

# Install the OAI CN
cd mosaic5g/
./build_m5g -C v2

# Check if it has been successfully installed by searching oai-hss, oai-mme,oai-spgwc, and oai-spgwu in the output:
snap list

Configure HSS

# We need to grant permissions:
sudo snap connect oai-hss:log-observe
sudo snap connect oai-hss:process-control
sudo snap connect oai-hss:network-control
sudo oai-hss.init

We're going to configure file hss_rel14, it is necesarry to verify if the Identity is matching "<hostname>.openair5G.eur".

sudo gedit $(oai-hss.conf-get)

The hss_rel14 file have the next information:

hss_rel14

{"common": {
    "fdcfg": "/var/snap/oai-hss/current/hss_rel14_fd.conf",
    "originhost": "santiago.openair5G.eur",
    "originrealm": "openair5G.eur" 
 },
 "hss": {
    "gtwhost": "*",
    "gtwport" : 9080,
    "restport" : 9081,
    "ossport" : 9082,
    "casssrv": "172.17.0.2", 
    "cassusr": "root",
    "casspwd": "root",
    "cassdb" : "vhss",
    "casscoreconnections" : 2,
    "cassmaxconnections" : 8,
    "cassioqueuesize" : 32768,
    "cassiothreads" : 2,    
    "randv"  : true,
    "optkey" : "11111111111111111111111111111111",
    "reloadkey"  : true,
    "roamallow"  : true,
    "logsize": 20,
    "lognumber": 5,
    "logname": "/var/snap/oai-hss/current/hss.log",
    "logqsize": 8192,
    "statlogsize": 20,
    "statlognumber": 5,
    "statlogname": "/var/snap/oai-hss/current/hss_stat.log",
    "auditlogsize": 20,
    "auditlognumber": 5,
    "auditlogname": "/var/snap/oai-hss/current/hss_audit.log",
    "statfreq": 2000,
    "numworkers": 4,
    "concurrent": 10,
    "ossfile": "/var/snap/oai-hss/current/oss.json"    
 }
}

Configure MME

# We need to grant permissions:
sudo snap connect oai-mme:log-observe
sudo snap connect oai-mme:process-control
sudo snap connect oai-mme:network-control 
sudo oai-mme.init

We're going to configure file mme.conf, it is necesarry to verify GUMMEI_LIST and TAI_LIST to match your desired PLMN configuration in this case it was left by default with an MCC of 208 and an MNC of 95. Also, It must be verified that the HSS_HOSTNAME matches the hostname of the computer and the NETWORK_INTERFACES section, change the ip addresses to match your network configuration.

sudo gedit $(sudo oai-mme.conf-get)

The mme.conf file have the next information:

mme.conf

MME : 
{
    REALM                                     = "openair5G.eur";                      # YOUR REALM HERE
    INSTANCE                                  = 1;                   # 0 is the default
    PID_DIRECTORY                             = "/tmp";              # /var/run is the default
    MAX_S1_ENB                                = 64;
    MAX_UE                                    = 4096;
    RELATIVE_CAPACITY                         = 10;
    EMERGENCY_ATTACH_SUPPORTED                     = "no";
    UNAUTHENTICATED_IMSI_SUPPORTED                 = "no";
    DUMMY_HANDOVER_FORWARDING_ENABLED              = "yes";
    EPS_NETWORK_FEATURE_SUPPORT_IMS_VOICE_OVER_PS_SESSION_IN_S1      = "no";    # DO NOT CHANGE
    EPS_NETWORK_FEATURE_SUPPORT_EMERGENCY_BEARER_SERVICES_IN_S1_MODE = "no";    # DO NOT CHANGE
    EPS_NETWORK_FEATURE_SUPPORT_LOCATION_SERVICES_VIA_EPC            = "no";    # DO NOT CHANGE
    EPS_NETWORK_FEATURE_SUPPORT_EXTENDED_SERVICE_REQUEST             = "no";    # DO NOT CHANGE
    
    # Display statistics about whole system (expressed in seconds)
    MME_STATISTIC_TIMER                       = 10;
    
    # Amount of time in seconds the source MME waits to release resources after HANDOVER/TAU is complete (with or without.
    MME_MOBILITY_COMPLETION_TIMER	      = 2;
    
    # Amount of time in seconds the target MME waits to check if a handover/tau process has completed successfully.
    MME_S10_HANDOVER_COMPLETION_TIMER         = 2; 
    
    IP_CAPABILITY = "IPV4V6";                                                   # UNUSED, TODO
    
    INTERTASK_INTERFACE :
    {
        ITTI_QUEUE_SIZE            = 2000000;
    };

    S6A :
    {
        S6A_CONF                   = "/var/snap/oai-mme/current/mme_fd.conf";
        HSS_HOSTNAME               = "santiago";                          # THE HSS HOSTNAME (not HSS FQDN)
    };

    SCTP :
    {
        SCTP_INSTREAMS  = 8;
        SCTP_OUTSTREAMS = 8;
    };

    S1AP : 
    {
        S1AP_OUTCOME_TIMER = 10;
    };

    GUMMEI_LIST = ( 
         {MCC="208" ; MNC="95"; MME_GID="4" ; MME_CODE="1"; }                   # YOUR GUMMEI CONFIG HERE
         #,{MCC="208" ; MNC="94"; MME_GID="4" ; MME_CODE="1"; },                   # YOUR GUMMEI CONFIG HERE
         #,{MCC="208" ; MNC="93"; MME_GID="4" ; MME_CODE="1"; }                   # YOUR GUMMEI CONFIG HERE
    );

    TAI_LIST = ( 
         #{MCC="208" ; MNC="93";  TAC = "1"; },                       # YOUR TAI CONFIG HERE
         #{MCC="208" ; MNC="94";  TAC = "1"; },                       # YOUR TAI CONFIG HERE
         {MCC="208" ; MNC="95";  TAC = "1"; }                        # YOUR TAI CONFIG HERE
    );

    NAS :
    {
        ORDERED_SUPPORTED_INTEGRITY_ALGORITHM_LIST = [ "EIA2" , "EIA1" , "EIA0" ];
        ORDERED_SUPPORTED_CIPHERING_ALGORITHM_LIST = [ "EEA0" , "EEA1" , "EEA2" ];
        T3402                                 =  12                             # in minutes (default is 12 minutes)
        T3412                                 =  1                             # in minutes (default is 54 minutes, network dependent)
        T3422                                 =  6                              # in seconds (default is 6s)
        T3450                                 =  6                              # in seconds (default is 6s)
        T3460                                 =  6                              # in seconds (default is 6s)
        T3470                                 =  6                              # in seconds (default is 6s)
        T3485                                 =  3                              # in seconds (default is 8s)
        T3486                                 =  3                              # UNUSED in seconds (default is 8s)
        T3489                                 =  4                              # in seconds (default is 4s)
        T3495                                 =  3                              # UNUSED in seconds (default is 8s)
        NAS_FORCE_TAU			      =  1
        STRICT_FILLER_BITS_CHECK              = "yes";
    };

    NETWORK_INTERFACES : 
    {
        # MME binded interface for S1-C or S1-MME  communication (S1AP), can be ethernet interface, virtual ethernet interface, we don't advise wireless interfaces
        MME_INTERFACE_NAME_FOR_S1_MME   = "lo";    # YOUR NETWORK CONFIG HERE
        MME_IPV4_ADDRESS_FOR_S1_MME     = "127.0.1.1/24";      # CIDR, YOUR NETWORK CONFIG HERE
#       MME_IPV6_ADDRESS_FOR_S1_MME           = "fd00::191/118";               # YOUR NETWORK CONFIG HERE
        # MME binded interface for S11 communication (GTPV2-C)
        MME_INTERFACE_NAME_FOR_S11      = "lo";       # YOUR NETWORK CONFIG HERE
        MME_IPV4_ADDRESS_FOR_S11        = "127.0.11.1/24";         # CIDR, YOUR NETWORK CONFIG HERE
#       MME_IPV6_ADDRESS_FOR_S11          = "fd00:0:0:4::191/64";
        MME_PORT_FOR_S11                = 2123;                                 # YOUR NETWORK CONFIG HERE


        #S10 Interface
        MME_INTERFACE_NAME_FOR_S10      = "lo";       # YOUR NETWORK CONFIG HERE
        MME_IPV4_ADDRESS_FOR_S10        = "127.0.10.1/24";         # CIDR, YOUR NETWORK CONFIG HERE
#       MME_IPV6_ADDRESS_FOR_S10          = "fd00:0:0:4::191/64";
        MME_PORT_FOR_S10                = 2123;                                 # YOUR NETWORK CONFIG HERE
    };

    LOGGING :
    {
        # OUTPUT choice in { "CONSOLE", `path to file`", "`IPv4@`:`TCP port num`"} 
        # `path to file` must start with '.' or '/'
        # if TCP stream choice, then you can easily dump the traffic on the remote or local host: nc -l `TCP port num` > received.txt
        OUTPUT            = "CONSOLE";
        THREAD_SAFE       = "no";                                               # THREAD_SAFE choice in { "yes", "no" }, safe to let 'no'
        COLOR             = "yes";                                              # COLOR choice in { "yes", "no" } means use of ANSI styling codes or no
        # Log level choice in { "EMERGENCY", "ALERT", "CRITICAL", "ERROR", "WARNING", "NOTICE", "INFO", "DEBUG", "TRACE"}
        SCTP_LOG_LEVEL    = "TRACE";
        S10_LOG_LEVEL     = "TRACE";
        S11_LOG_LEVEL     = "TRACE";
        # NEW LOGS FOR MCE	
        SM_LOG_LEVEL      = "TRACE";
        MCE_APP_LOG_LEVEL = "TRACE";
        M2AP_LOG_LEVEL    = "TRACE";
        GTPV2C_LOG_LEVEL  = "TRACE";
        UDP_LOG_LEVEL     = "DEBUG";
        S1AP_LOG_LEVEL    = "DEBUG";
        NAS_LOG_LEVEL     = "TRACE";
        MME_APP_LOG_LEVEL = "TRACE";
        S6A_LOG_LEVEL     = "TRACE";
        UTIL_LOG_LEVEL    = "ERROR";
        MSC_LOG_LEVEL     = "ERROR";
        ITTI_LOG_LEVEL    = "ERROR";
        ASN1_VERBOSITY    = "annoying";
    };

    # SGW-C IP addr4ess, lb=lower byte of the TAC, and hb: the higher byte
    # ex: TAC=600, lb=58, hb=02
    WRR_LIST_SELECTION = (
        {ID="tac-lb01.tac-hb00.tac.epc.mnc095.mcc208.3gppnetwork.org" ;      SGW_IP_ADDRESS_FOR_S11="127.0.11.2";}
       #,{ID="tac-lb58.tac-hb02.tac.epc.mnc094.mcc208.3gppnetwork.org" ;      SGW_IPV_ADDRESS_FOR_S11="127.0.11.3";}
       
    );
};

Configure SPGWC and SPGWU

# we need to grant permissions:
sudo snap connect oai-spgwc:log-observe
sudo snap connect oai-spgwc:process-control
sudo snap connect oai-spgwu:process-control 
sudo snap connect oai-spgwu:network-control 
sudo snap connect oai-spgwu:firewall-control 
sudo snap connect oai-spgwu:log-observe
sudo oai-spgwc.init
sudo oai-spgwu.init

We're going to configure file spgwc.conf and spgwu.conf, check the networking configuration in INTERFACES. Also, in the spgwc.conf file is necessary to change the DNS to that of your service provider, to know your DNS use the command nmcli dev show | grep DNS. Moreover, in spgwu.conf file in the SGi section, in the INTERFACE_NAME subpoint, you must enter the name of the interface that is being used to connect to the Internet, to know the name of the interface use the command ifconfig.

sudo gedit $(sudo oai-spgwc.conf-get)
sudo gedit $(sudo oai-spgwu.conf-get)

The spgwc.conf and spgwu.conf file have the next information:

spgwc.conf

################################################################################
# Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The OpenAirInterface Software Alliance licenses this file to You under
# the OAI Public License, Version 1.1  (the "License"); you may not use this file
# except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.openairinterface.org/?page_id=698
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#-------------------------------------------------------------------------------
# For more information about the OpenAirInterface (OAI) Software Alliance:
#      [email protected]
################################################################################
S-GW =
{
    INSTANCE                       = 0;            # 0 is the default
    PID_DIRECTORY                  = "/tmp";     # /var/run is the default

    #ITTI_TASKS :
    #{
        #ITTI_TIMER_SCHED_PARAMS :
        #{
            #CPU_ID       = 1;
            #SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
            #SCHED_PRIORITY = 85;
        #};
        #S11_SCHED_PARAMS :
        #{
            #CPU_ID       = 1;
            #SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
            #SCHED_PRIORITY = 84;
        #};
        #S5S8_SCHED_PARAMS :
        #{
            #CPU_ID       = 1;
            #SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
            #SCHED_PRIORITY = 84;
        #};
        #SX_SCHED_PARAMS :
        #{
            #CPU_ID       = 1;
            #SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
            #SCHED_PRIORITY = 84;
        #};
        #SGW_APP_SCHED_PARAMS :
        #{
            #CPU_ID       = 1;
            #SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
            #SCHED_PRIORITY = 84;
        #};
        #ASYNC_CMD_SCHED_PARAMS :
        #{
            #CPU_ID       = 1;
            #SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
            #SCHED_PRIORITY = 84;
        #};
    #};

    INTERFACES :
    {
        S11_CP :
        {
            # S-GW binded interface for S11 communication (GTPV2-C), if none selected the ITTI message interface is used
            INTERFACE_NAME         = "lo";       # STRING, interface name, YOUR NETWORK CONFIG HERE
            IPV4_ADDRESS           = "127.0.11.2/24";          # STRING, CIDR or "read" to let app read interface configured IP address, YOUR NETWORK CONFIG HERE
            #PORT                   = 2123;           # INTEGER, port number, PREFER NOT CHANGE UNLESS YOU KNOW WHAT YOU ARE DOING
            #SCHED_PARAMS :                           # SCHEADULING PARAMS OF THE LOOPING RECEIVER THREAD BOUND TO THIS INTERFACE/PROTOCOL
            #{
                #CPU_ID       = 1;
                #SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
                #SCHED_PRIORITY = 95;
            #};
        };
        S5_S8_CP :
        {
            # S-GW binded interface for S5 or S8 communication
            INTERFACE_NAME         = "lo"; # STRING, interface name
            IPV4_ADDRESS           = "127.0.13.1/24";          # STRING, CIDR or "read" to let app read interface configured IP address
            #PORT                   = 2123;           # INTEGER, port number, PREFER NOT CHANGE UNLESS YOU KNOW WHAT YOU ARE DOING
            #SCHED_PARAMS :                           # SCHEADULING PARAMS OF THE LOOPING RECEIVER THREAD BOUND TO THIS INTERFACE/PROTOCOL
            #{
                #CPU_ID       = 1;
                #SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
                #SCHED_PRIORITY = 95;
            #};
        };
    };
    
};

P-GW =
{
    INSTANCE                                  = 0;                     # 0 is the default
    PID_DIRECTORY                             = "/tmp";              # /var/run is the default

    #ITTI_TASKS :
    #{
        #ITTI_TIMER_SCHED_PARAMS :
        #{
            #CPU_ID       = 1;
            #SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
            #SCHED_PRIORITY = 85;
        #};
        #S11_SCHED_PARAMS :
        #{
            #CPU_ID       = 1;
            #SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
            #SCHED_PRIORITY = 84;
        #};
        #S5S8_SCHED_PARAMS :
        #{
            #CPU_ID       = 1;
            #SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
            #SCHED_PRIORITY = 84;
        #};
        #SX_SCHED_PARAMS :
        #{
            #CPU_ID       = 1;
            #SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
            #SCHED_PRIORITY = 84;
        #};
        #PGW_APP_SCHED_PARAMS :
        #{
            #CPU_ID       = 1;
            #SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
            #SCHED_PRIORITY = 84;
        #};
        #ASYNC_CMD_SCHED_PARAMS :
        #{
            #CPU_ID       = 1;
            #SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
            #SCHED_PRIORITY = 84;
        #};
    #};

    INTERFACES :
    {
        S5_S8_CP :
        {
            # P-GW binded interface for S5 or S8 communication
            INTERFACE_NAME         = "lo"; # STRING, interface name
            IPV4_ADDRESS           = "127.0.13.2/24";                              # STRING, CIDR or "read" to let app read interface configured IP address
            #PORT                   = 2123;
            #SCHED_PARAMS :                           # SCHEADULING PARAMS OF THE LOOPING RECEIVER THREAD BOUND TO THIS INTERFACE/PROTOCOL
            #{
                #CPU_ID       = 1;
                #SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
                #SCHED_PRIORITY = 95;
            #};
        };
        SX :
        {
            # P-GW binded interface for SX communication
            INTERFACE_NAME         = "lo"; # STRING, interface name
            IPV4_ADDRESS           = "127.0.12.1/24";                        # STRING, CIDR or "read" to let app read interface configured IP address
            #PORT                   = 8805;
            #SCHED_PARAMS :                           # SCHEADULING PARAMS OF THE LOOPING RECEIVER THREAD BOUND TO THIS INTERFACE/PROTOCOL
            #{
                #CPU_ID       = 1;
                #SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
                #SCHED_PRIORITY = 95;
            #};
        };
    };


    # Pool of UE assigned IP addresses
    # Do not make IP pools overlap
    # first IPv4 address X.Y.Z.1 is reserved for GTP network device on SPGW
    # Normally no more than 96 pools allowed, but for non OVS GTP solution, only one pool allowed (TODO).
    IP_ADDRESS_POOL :
    {
        IPV4_LIST = (
                      {RANGE = "12.1.1.2 - 12.1.1.128";},                                  # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE.
                      {RANGE = "12.1.1.129 - 12.1.1.224";},                                # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE.
                      {RANGE = "192.169.0.2 - 192.169.255.253";},                          # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE.
                      {RANGE = "192.170.0.2 - 192.170.255.253";},                          # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE.
                      {RANGE = "192.171.0.2 - 192.171.255.253";}                           # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE.
                    );
        IPV6_LIST = (
                      {PREFIX = "2001:1:2::/64";},                                         # STRING, IPv6 prefix, YOUR NETWORK CONFIG HERE.
                      {PREFIX = "3001:1:2::/64";},                                         # STRING, IPv6 prefix, YOUR NETWORK CONFIG HERE.
                      {PREFIX = "4001:1:2::/64";}                                          # STRING, IPv6 prefix, YOUR NETWORK CONFIG HERE.
                    );
    };
    
   # REALM is must have 
    APN_LIST = (
       # IPV4_POOL, IPV6_POOL are index in IPV4_LIST, IPV6_LIST, PDN_TYPE choice in {IPv4, IPv6, IPv4v6}
      {APN_NI = "oai.openair5G.eur"; PDN_TYPE = "IPv4"; IPV4_POOL  = 0; IPV6_POOL = -1},
      {APN_NI = "internet"; PDN_TYPE = "IPv4"; IPV4_POOL = 1; IPV6_POOL = -1},
      {APN_NI = "apn2"; PDN_TYPE = "IPv4"; IPV4_POOL = 2; IPV6_POOL = -1},
      {APN_NI = "apn3"; PDN_TYPE = "IPv4"; IPV4_POOL = 3; IPV6_POOL = -1},
      {APN_NI = "apn2"; PDN_TYPE = "IPv4"; IPV4_POOL = 4; IPV6_POOL = -1}
    );

    # DNS address communicated to UEs
    DEFAULT_DNS_IPV4_ADDRESS     = "200.21.200.80";                # YOUR NETWORK CONFIG HERE
    DEFAULT_DNS_SEC_IPV4_ADDRESS = "200.21.200.10";                # YOUR NETWORK CONFIG HERE
    DEFAULT_DNS_IPV6_ADDRESS     = "2001:4860:4860::8888";                      # FFU
    DEFAULT_DNS_SEC_IPV6_ADDRESS = "2001:4860:4860::8844";                      # FFU

    # Non standard feature, normally should be set to "no", but you may need to set to yes for UE that do not explicitly request a PDN address through NAS signalling
    FORCE_PUSH_PROTOCOL_CONFIGURATION_OPTIONS = "yes";                           # STRING, {"yes", "no"}.

    PCEF :
    {
      # Waiting for HSS APN-AMBR IE ...
      APN_AMBR_UL                             = 500000;                         # Maximum UL bandwidth that can be used by non guaranteed bit rate traffic in Kbits/seconds.
      APN_AMBR_DL                             = 500000;                         # Maximum DL bandwidth that can be used by non guaranteed bit rate traffic in Kbits/seconds.
    };
    
    MOSAIC_5G :
    {
      REMOTE_CONTROLLER_ENABLED = "no";
      REMOTE_CONTROLLER_IPV4_ADDRESS = "192.168.12.242";
      REMOTE_CONTROLLER_PORT = 9999;
      OVS_IPV4_ADDRESS = "192.168.12.241";
    };  
      
};

spgwu.conf

################################################################################
# Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The OpenAirInterface Software Alliance licenses this file to You under
# the OAI Public License, Version 1.1  (the "License"); you may not use this file
# except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.openairinterface.org/?page_id=698
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#-------------------------------------------------------------------------------
# For more information about the OpenAirInterface (OAI) Software Alliance:
#      [email protected]
################################################################################
SPGW-U =
{
    INSTANCE                       = 0;            # 0 is the default
    PID_DIRECTORY                  = "/tmp";     # /var/run is the default

    ITTI_TASKS :
    {
        ITTI_TIMER_SCHED_PARAMS :
        {
            CPU_ID       = 1;
            SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
            SCHED_PRIORITY = 85;
        };
        S1U_SCHED_PARAMS :
        {
            CPU_ID       = 1;
            SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
            SCHED_PRIORITY = 84;
        };
        SX_SCHED_PARAMS :
        {
            CPU_ID       = 1;
            SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
            SCHED_PRIORITY = 84;
        };
        ASYNC_CMD_SCHED_PARAMS :
        {
            CPU_ID       = 1;
            SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
            SCHED_PRIORITY = 84;
        };
    };

    INTERFACES :
    {
        S1U_S12_S4_UP :
        {
            # S-GW binded interface for S1-U communication (GTPV1-U) can be ethernet interface, virtual ethernet interface, we don't advise wireless interfaces
            INTERFACE_NAME         = "lo";  # STRING, interface name, YOUR NETWORK CONFIG HERE
            IPV4_ADDRESS           = "127.0.14.2/24";                                # STRING, CIDR or read to let app read interface configured IP address
            PORT                   = 2152;          # Default is 2152
            SCHED_PARAMS :
            {
                CPU_ID       = 2;
                SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
                SCHED_PRIORITY = 98;
            };
        };
        SX :
        {
            # S/P-GW binded interface for SX communication
            INTERFACE_NAME         = "lo"; # STRING, interface name
            IPV4_ADDRESS           = "127.0.12.2/24";                                # STRING, CIDR or read to let app read interface configured IP address
            PORT                   = 8805;                                  # Default is 8805
            SCHED_PARAMS :
            {
                CPU_ID       = 1;
                SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
                SCHED_PRIORITY = 95;
            };
        };
        SGI :
        {
           # No config to set, the software will set the SGi interface to the interface used for the default route.
            INTERFACE_NAME         = "wlo1"; # STRING, interface name or "default_gateway"
            IPV4_ADDRESS           = "read";                         # STRING, CIDR or read to let app read interface configured IP address
            SCHED_PARAMS :
            {
                CPU_ID       = 3;
                SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
                SCHED_PRIORITY = 98;
            };
        };
    };

    PDN_NETWORK_LIST  = (
                      {NETWORK_IPV4 = "12.1.1.0/24"; NETWORK_IPV6 = "2001:1:2::0/64"; SNAT = "yes";},
                      {NETWORK_IPV4 = "12.1.2.0/24"; SNAT = "no";},
                      {NETWORK_IPV4 = "192.169.0.0/24"; SNAT = "no";},
                      {NETWORK_IPV4 = "192.170.0.0/24"; SNAT = "no";},
                      {NETWORK_IPV4 = "192.171.0.0/24"; SNAT = "no";}
                    );

    # IP address of SX of PGW-C (i.e. SXC)		    
    SPGW-C_LIST = (
         {IPV4_ADDRESS="127.0.12.1" ;}
    );
};


Moreover, It must be verified that the Firewall is activated, since if it is deactivated, it can generate an error when trying to access the internet from the mobile device.

sudo ufw enable 
sudo ufw status

Add a UE

There are a number of commands in oai-hss to manage the Cassandra DB.

oai-hss.help
oai-hss.add-users -h
oai-hss.dump-users -h

In order to add/modify the 10 default users and update their APN.

oai-hss.add-users -I208950000000001-208950000000010 -a oai.openair5G.eur

Start CN

If everything is configured correctly, HSS, MME and SPGW can be launched with a single command:

sudo oai-hss    
sudo oai-mme    
sudo oai-spgwc  
sudo oai-spgwu  
⚠️ **GitHub.com Fallback** ⚠️