apiVersion: v1
kind: ConfigMap
metadata:
  name: f5gc-n3iwf-config
data:

   n3iwfcfg.yaml: |
    info:
      version: 1.0.0
      description: N3IWF initial local configuration
    
    configuration:
      N3IWFInformation:
        GlobalN3IWFID: # ID used to globally identify an N3IWF
          PLMNID: # Public Land Mobile Network ID, <PLMN ID> = <MCC><MNC>
            MCC: # Mobile Country Code (3 digits string, digit: 0~9)
              208
            MNC: # Mobile Network Code (2 or 3 digits string, digit: 0~9)
              93
          N3IWFID: # ID used to identify an N3IWF in PLMN (uinteger, range: 0~65535)
            135
        Name: # The name of this N3IWF
          free5GC_N3IWF
        SupportedTAList: # Tracking Area supported by this N3IWF
          - TAC: # Tracking Area Code (3 bytes hex string, range: 000000~FFFFFF)
              000001
            BroadcastPLMNList: # Refer to TS 38.413
              - PLMNID: # Public Land Mobile Network ID
                  MCC: # Mobile Country Code (3 digits string, digit: 0~9)
                    208
                  MNC: # Mobile Network Code (2 or 3 digits string, digit: 0~9)
                    93
                TAISliceSupportList: # Network Slice supported in this TAI
                  - SNSSAI: # Single Network Slice Selection Assistance Information
                      SST: # Slice/Service Type (1 byte hex string, range: 0~F)
                        1
                      SD: # Slice Differentiator (3 bytes hex string, range: 000000~FFFFFF)
                        010203
                  - SNSSAI:
                      SST:
                        1
                      SD:
                        112233
      AMFSCTPAddresses: # the IP list of N2 interfaces (SCTP) on AMF when using NGAP
        - IP:
          - f5gc-amf
    
      # --- Bind Interfaces ---
      IKEBindAddress: # IP address of Nwu interface (IKE) on this N3IWF
        f5gc-n3iwf
    
      IPSecInterfaceAddress: # IP address of IPSec virtual interface (IPsec tunnel enpoint on this N3IWF)
        10.0.0.1
    
      IPSecInterfaceMark: # IPSec virtual interface mark (Any value except to 0, default value is 7 if not defined)
        5
    
      GTPBindAddress: # IP address of N3 interface (GTP) on this N3IWF
        f5gc-n3iwf
    
      NASTCPPort: # TCP port which the NAS listens on
        20000
    
      FQDN: # FQDN of this N3IWF
        f5gc-n3iwf
    
    
      # --- Security ---
      PrivateKey: # Private key file path
    
      CertificateAuthority: # Certificate Authority (CA) file path
    
      Certificate: # Certificate file path
    
    
    
      UEIPAddressRange: # IP address allocated to UE in IPSec tunnel
        10.0.0.0/24
    
    # the kind of log output
      # debugLevel: how detailed to output, value: trace, debug, info, warn, error, fatal, panic
      # ReportCaller: enable the caller report or not, value: true or false
    logger:
      N3IWF:
        debugLevel: info
        ReportCaller: false
      NGAP:
        debugLevel: info
        ReportCaller: false
      Aper:
        debugLevel: info
        ReportCaller: false
      PathUtil:
        debugLevel: info
        ReportCaller: false

   n3iwf-ipsec.sh: |
    #! /bin/bash
    ip link add name ipsec0 type vti local $(hostname -i | awk '{print $1}') remote 0.0.0.0 key 5
    ip addr add 10.0.0.1/24 dev ipsec0
    ip link set dev ipsec0 up
    ./n3iwf --n3iwfcfg ../config/n3iwfcfg.yaml

   free5GC.conf: |
    db_uri: mongodb://f5gc-mongodb:27017/free5GC
    #all logging levels
    #panic
    #fatal
    #error
    #warn
    #info
    #debug
    #trace
    logger:
    # network function
      AMF:
        debugLevel: info
        ReportCaller: true
      SMF:
        debugLevel: info
        ReportCaller: true
      UDR:
        debugLevel: info
        ReportCaller: true
      UDM:
        debugLevel: info
        ReportCaller: true
      NRF:
        debugLevel: info
        ReportCaller: true
      PCF:
        debugLevel: info
        ReportCaller: true
      AUSF:
        debugLevel: info
        ReportCaller: true
      N3IWF:
        debugLevel: info
        ReportCaller: true
    # library
      NAS:
        debugLevel: info
        ReportCaller: true
      FSM:
        debugLevel: info
        ReportCaller: true
      NGAP:
        debugLevel: info
        ReportCaller: true
      NamfComm:
        debugLevel: info
        ReportCaller: true
      NamfEventExposure:
        debugLevel: info
        ReportCaller: true
      NsmfPDUSession:
        debugLevel: info
        ReportCaller: true
      NudrDataRepository:
        debugLevel: info
        ReportCaller: true
      OpenApi:
        debugLevel: info
        ReportCaller: true
      Aper:
        debugLevel: info
        ReportCaller: true
      CommonConsumerTest:
        debugLevel: info
        ReportCaller: true
    # webui
      WEBUI:
        debugLevel: info
        ReportCaller: true
