Cannot change IP address of NF in config files

, , ,

Since all the NF’s eg:AMF, PCF all have same ip’s which is 127.0.0.1. I changed it to 127.0.0.2,3,4… . As expected I ended up with errors in running network functions. why I cannot increment IP here ? please explain

This is my change:
root@free5gc:~/free5gc/config# vim amfcfg.conf 127.0.0.5
root@free5gc:~/free5gc/config# vim ausfcfg.conf 127.0.0.6
root@free5gc:~/free5gc/config# vim smfcfg.conf 127.0.0.7
root@free5gc:~/free5gc/config# vim udmcfg.conf 127.0.0.8
root@free5gc:~/free5gc/config# vim pcfcfg.conf 127.0.0.9
root@free5gc:~/free5gc/config# vim udrcfg.conf 127.0.0.10

Hi,

What’s the error msg? please describe

No response from server.
Am able to ping 127.0.0.(1…10). May I know why all the NF’s as same IP. Basically, will it work if I modify in config file and do ./run.sh ?

Can you provide your config file and the error message’s snapshot?

MY Diff:
root@free5gc:~/free5gc# git diff
diff --git a/config/amfcfg.conf b/config/amfcfg.conf
index fb591d3…31a5d5d 100644
— a/config/amfcfg.conf
+++ b/config/amfcfg.conf
@@ -5,10 +5,10 @@ info:
configuration:
amfName: AMF
ngapIpList:

    • 127.0.0.1
    • 127.0.0.5
      sbi:
      scheme: http
  • registerIPv4: 127.0.0.1 # IP used to register to NRF
  • registerIPv4: 127.0.0.5 # IP used to register to NRF
    bindingIPv4: 127.0.0.1 # IP used to bind the service
    port: 29518
    serviceNameList:
    diff --git a/config/ausfcfg.conf b/config/ausfcfg.conf
    index 84011be…1b85a2c 100644
    — a/config/ausfcfg.conf
    +++ b/config/ausfcfg.conf
    @@ -5,7 +5,7 @@ info:
    configuration:
    sbi:
    scheme: http
  • registerIPv4: 127.0.0.1 # IP used to register to NRF
  • registerIPv4: 127.0.0.6 # IP used to register to NRF
    bindingIPv4: 127.0.0.1 # IP used to bind the service
    port: 29509
    serviceNameList:
    diff --git a/config/pcfcfg.conf b/config/pcfcfg.conf
    index 7408d1b…a885298 100644
    — a/config/pcfcfg.conf
    +++ b/config/pcfcfg.conf
    @@ -6,7 +6,7 @@ configuration:
    pcfName: PCF
    sbi:
    scheme: http
  • registerIPv4: 127.0.0.1 # IP used to register to NRF
  • registerIPv4: 127.0.0.12 # IP used to register to NRF
    bindingIPv4: 127.0.0.1 # IP used to bind the service
    port: 29507
    timeFormat: 2019-01-02 15:04:05
    diff --git a/config/smfcfg.conf b/config/smfcfg.conf
    index ec4ef30…2243028 100644
    — a/config/smfcfg.conf
    +++ b/config/smfcfg.conf
    @@ -6,7 +6,7 @@ configuration:
    smfName: SMF
    sbi:
    scheme: http
  • registerIPv4: 127.0.0.1 # IP used to register to NRF
  • registerIPv4: 127.0.0.7 # IP used to register to NRF
    bindingIPv4: 127.0.0.1 # IP used to bind the service
    port: 29502
    tls:
    diff --git a/src/test/ngsetup_test.go b/src/test/ngsetup_test.go
    index 5c4b963…996f651 100644
    — a/src/test/ngsetup_test.go
    +++ b/src/test/ngsetup_test.go
    @@ -78,7 +78,7 @@ func TestNGSetup(t *testing.T) {
    var recvMsg = make([]byte, 2048)

    // RAN connect to AMF

  •   conn, err := test.ConntectToAmf("127.0.0.1", "127.0.0.1", 38412, 9487)
    
  •   conn, err := test.ConntectToAmf("127.0.0.5", "127.0.0.1", 38412, 9487)
      assert.Nil(t, err)
    
      // send NGSetupRequest Msg
    

diff --git a/src/test/registration_test.go b/src/test/registration_test.go
index 789705e…a505401 100644
— a/src/test/registration_test.go
+++ b/src/test/registration_test.go
@@ -43,7 +43,7 @@ func TestRegistration(t *testing.T) {
var recvMsg = make([]byte, 2048)

    // RAN connect to AMF
  •   conn, err := test.ConntectToAmf("127.0.0.1", "127.0.0.1", 38412, 9487)
    
  •   conn, err := test.ConntectToAmf("127.0.0.5", "127.0.0.1", 38412, 9487)
      assert.Nil(t, err)
    
      // RAN connect to UPF
    

@@ -277,7 +277,7 @@ func TestDeregistration(t *testing.T) {
var recvMsg = make([]byte, 2048)

    // RAN connect to AMF
  •   conn, err := test.ConntectToAmf("127.0.0.1", "127.0.0.1", 38412, 9487)
    
  •   conn, err := test.ConntectToAmf("127.0.0.5", "127.0.0.1", 38412, 9487)
      assert.Nil(t, err)
    
      // send NGSetupRequest Msg
    

@@ -469,7 +469,7 @@ func TestServiceRequest(t *testing.T) {
var recvMsg = make([]byte, 2048)

    // RAN connect to AMF
  •   conn, err := test.ConntectToAmf("127.0.0.1", "127.0.0.1", 38412, 9487)
    
  •   conn, err := test.ConntectToAmf("127.0.0.5", "127.0.0.1", 38412, 9487)
      assert.Nil(t, err)
    
      // send NGSetupRequest Msg
    

@@ -685,7 +685,7 @@ func TestGUTIRegistration(t *testing.T) {
var recvMsg = make([]byte, 2048)

    // RAN connect to AMF
  •   conn, err := test.ConntectToAmf("127.0.0.1", "127.0.0.1", 38412, 9487)
    
  •   conn, err := test.ConntectToAmf("127.0.0.5", "127.0.0.1", 38412, 9487)
      require.Nil(t, err)
    
      // send NGSetupRequest Msg
    

@@ -985,7 +985,7 @@ func TestPDUSessionReleaseRequest(t *testing.T) {
var recvMsg = make([]byte, 2048)

    // RAN connect to AMF
  •   conn, err := test.ConntectToAmf("127.0.0.1", "127.0.0.1", 38412, 9487)
    
  •   conn, err := test.ConntectToAmf("127.0.0.5", "127.0.0.1", 38412, 9487)
      assert.Nil(t, err)
    
      // send NGSetupRequest Msg
    

@@ -1186,7 +1186,7 @@ func TestXnHandover(t *testing.T) {
var recvMsg = make([]byte, 2048)

    // RAN connect to AMF
  •   conn, err := test.ConntectToAmf("127.0.0.1", "127.0.0.1", 38412, 9487)
    
  •   conn, err := test.ConntectToAmf("127.0.0.5", "127.0.0.1", 38412, 9487)
      assert.Nil(t, err)
    
      // send NGSetupRequest Msg
    

@@ -1203,7 +1203,7 @@ func TestXnHandover(t *testing.T) {

    time.Sleep(10 * time.Millisecond)
  •   conn2, err1 := test.ConntectToAmf("127.0.0.1", "127.0.0.1", 38412, 9488)
    
  •   conn2, err1 := test.ConntectToAmf("127.0.0.5", "127.0.0.1", 38412, 9488)
      assert.Nil(t, err1)
    
      // send Second NGSetupRequest Msg
    

@@ -1389,7 +1389,7 @@ func TestPaging(t *testing.T) {
var recvMsg = make([]byte, 2048)

    // RAN connect to AMFcd
  •   conn, err := test.ConntectToAmf("127.0.0.1", "127.0.0.1", 38412, 9487)
    
  •   conn, err := test.ConntectToAmf("127.0.0.5", "127.0.0.1", 38412, 9487)
      assert.Nil(t, err)
    
      // send NGSetupRequest Msg
    

@@ -1627,7 +1627,7 @@ func TestN2Handover(t *testing.T) {
var recvMsg = make([]byte, 2048)

    // RAN1 connect to AMF
  •   conn, err := test.ConntectToAmf("127.0.0.1", "127.0.0.1", 38412, 9487)
    
  •   conn, err := test.ConntectToAmf("127.0.0.5", "127.0.0.1", 38412, 9487)
      assert.Nil(t, err)
    
      // RAN1 connect to UPF
    

@@ -1649,7 +1649,7 @@ func TestN2Handover(t *testing.T) {
time.Sleep(10 * time.Millisecond)

    // RAN2 connect to AMF
  •   conn2, err1 := test.ConntectToAmf("127.0.0.1", "127.0.0.1", 38412, 9488)
    
  •   conn2, err1 := test.ConntectToAmf("127.0.0.5", "127.0.0.1", 38412, 9488)
      assert.Nil(t, err1)
    
      // RAN2 connect to UPF
    

@@ -1971,7 +1971,7 @@ func TestDuplicateRegistration(t *testing.T) {
var recvMsg = make([]byte, 2048)

    // RAN connect to AMF
  •   conn, err := test.ConntectToAmf("127.0.0.1", "127.0.0.1", 38412, 9487)
    
  •   conn, err := test.ConntectToAmf("127.0.0.5", "127.0.0.1", 38412, 9487)
      assert.Nil(t, err)
    
      // RAN connect to UPF
    

@@ -2216,7 +2216,7 @@ func TestReSynchronisation(t *testing.T) {
var recvMsg = make([]byte, 2048)

    // RAN connect to AMF
  •   conn, err := test.ConntectToAmf("127.0.0.1", "127.0.0.1", 38412, 9487)
    
  •   conn, err := test.ConntectToAmf("127.0.0.5", "127.0.0.1", 38412, 9487)
      assert.Nil(t, err)
    
      // RAN connect to UPF
    

(END)

LOG:

I have pasted only the error logs
root@free5gc:~/free5gc# ./run.sh
2020-12-10T12:20:59Z [INFO][UPF][Util] Config: /root/free5gc/src/upf/build/config/upfcfg.yaml
2020-12-10T12:20:59Z [INFO][UPF][Util] Set log level: info
2020-12-10T12:20:59Z [ERRO][UPF][Util] gtp5g device named upfgtp created fail
2020-12-10T12:20:59Z [ERRO][UPF][Util] Gtp5gDeviceInit failed
2020-12-10T12:20:59Z [ERRO][UPF][Util] Epoll Wait Error : Invalid argument
2020-12-10T12:20:59Z [ERRO][UPF][Util] Epoll Wait error : Invalid argument

2020-12-10T12:21:00Z [FATA][NRF][Init] HTTP server setup failed: listen tcp 127.0.0.1:29510: bind: address already in use

2020-12-10T12:21:00Z [INFO][CommonTest][Comm] set report call : false
2020-12-10T12:21:00Z [INFO][AUSF][Init] Successfully initialize configuration config/ausfcfg.conf
2020-12-10T12:21:00Z [INFO][AUSF][Init] Log level is set to [info] level
2020-12-10T12:21:00Z [INFO][AUSF][Init] Server started
2020-12-10T12:21:00Z [INFO][AUSF][Init] ausfconfig Info: Version[1.0.0] Description[AUSF initial local configuration]
ausf context = &{{{0 0} {} map[] 0} {{0 0} {} map[] 0} 7fdf4266-b7f0-40e5-b716-233f4637e99a ausfGroup001 29509 127.0.0.6 127.0.0.1 http://127.0.0.6:29509 http http://localhost:29510 map[nausf-auth:{7fdf4266-b7f0-40e5-b716-233f4637e99a nausf-auth 0xc0003a0a20 http REGISTERED 0xc0003a0a00 [] [] [] 0 0 0 }] [{208 93} {123 45}] 0xc000392960}

Do you insert gtp5g module?
Also, try to check if there is a process binding on the NRF’s listening IP, such an if there is any old NRF still running.

thanks, UPF is working fine now.

I am worried about the connection refused issue even without my changes I could see this problem

Can u please share steps on how do I change IP’s of each NF’s in same 127.0.0.(1…20) subnet.

I want to differentiate each network funtions using unique IP.

LOG:
root@free5gc:~/free5gc# ./run.sh
2020-12-11T06:39:07Z [INFO][UPF][Util] Config: /root/free5gc/src/upf/build/config/upfcfg.yaml
2020-12-11T06:39:07Z [INFO][UPF][Util] Set log level: info
2020-12-11T06:39:07Z [INFO][UPF][Util] DNN routes added, main routing table:
2020-12-11T06:39:07Z [INFO][UPF][Util] DstIp Gateway Iface Priority RtProto Type
2020-12-11T06:39:07Z [INFO][UPF][Util] 172.20.52.0 /22 0.0.0.0 enp4s0 0 kernel unicast
2020-12-11T06:39:07Z [INFO][UPF][Util] 60.60.0.0 /24 0.0.0.0 upfgtp 0 static unicast
2020-12-11T06:39:07Z [INFO][UPF][Util] 0.0.0.0 /0 172.20.55.254 enp4s0 0 static unicast
udm
2020-12-11T06:39:08Z [INFO][UDM][App] UDM version:
version: v3.0.4
build time: 2020-12-11T06:35:09Z
commit hash: ca59477a
commit time: 2020-09-28T21:14:10Z
go version: go1.14.4 linux/amd64
CommonConfig file: config/free5GC.conf
nssf
2020-12-11T06:39:08Z [INFO][NSSF][App] NSSF version:
version: v3.0.4
build time: 2020-12-11T06:35:00Z
commit hash: 0c5896c5
commit time: 2020-09-28T21:08:33Z
go version: go1.14.4 linux/amd64
CommonConfig file: config/free5GC.conf

UDM register to NRF Error[Put “http://localhost:29510/nnrf-nfm/v1/nf-instances/b684afa8-cc4d-4eb6-a64f-42673f8ca777”: dial tcp 127.0.0.1:29510: connect: connection refused]

AMF register to NRF Error[Put “http://localhost:29510/nnrf-nfm/v1/nf-instances/91c0e798-9c42-4201-89a9-24a76fcec051”: dial tcp 127.0.0.1:29510: connect: connection refused]

2020-12-11T06:39:09Z [INFO][NRF][GIN] | 200 | 127.0.0.1 | GET | /nnrf-disc/v1/nf-instances?requester-nf-type=PCF&target-nf-type=AMF |
2020-12-11T06:39:09Z [WARN][PCF][Init] AMF status subscribe Error[http://127.0.0.1:29518: server no response]
2020-12-11T06:39:09Z [WARN][PCF][Init] AMF status subscribe Error[http://127.0.0.2:29518: server no response]
2020-12-11T06:39:09Z [WARN][PCF][Init] AMF status subscribe Error[http://127.0.0.1:29518: server no response]
2020-12-11T06:39:09Z [WARN][PCF][Init] AMF status subscribe Error[http://127.0.0.2:29518: server no response]
2020-12-11T06:39:09Z [WARN][PCF][Init] AMF status subscribe Error[http://127.0.0.2:29518: server no response]
2020-12-11T06:39:09Z [WARN][PCF][Init] AMF status subscribe Error[http://127.0.0.2:29518: server no response]
2020-12-11T06:39:09Z [WARN][PCF][Init] AMF status subscribe Error[http://127.0.0.2:29518: server no response]
2020-12-11T06:39:09Z [WARN][PCF][Init] AMF status subscribe Error[http://127.0.0.2:29518: server no response]
2020-12-11T06:39:09Z [WARN][PCF][Init] AMF status subscribe Error[http://127.0.0.2:29518: server no response]
2020-12-11T06:39:09Z [WARN][PCF][Init] AMF status subscribe Error[http://127.0.0.1:29518: server no response]
2020-12-11T06:39:09Z [WARN][PCF][Init] AMF status subscribe Error[http://127.0.0.5:29518: server no response]
2020-12-11T06:39:09Z [WARN][PCF][Init] AMF status subscribe Error[http://127.0.0.5:29518: server no response]
2020-12-11T06:39:09Z [WARN][PCF][Init] AMF status subscribe Error[http://127.0.0.5:29518: server no response]
2020-12-11T06:39:09Z [WARN][PCF][Init] AMF status subscribe Error[http://127.0.0.5:29518: server no response]
2020-12-11T06:39:09Z [WARN][PCF][Init] AMF status subscribe Error[http://127.0.0.5:29518: server no response]
2020-12-11T06:39:09Z [WARN][PCF][Init] AMF status subscribe Error[http://127.0.0.5:29518: server no response]
2020-12-11T06:39:09Z [WARN][PCF][Init] AMF status subscribe Error[http://127.0.0.5:29518: server no response]
2020-12-11T06:39:09Z [WARN][PCF][Init] AMF status subscribe Error[http://127.0.0.5:29518: server no response]
2020-12-11T06:39:09Z [WARN][PCF][Init] AMF status subscribe Error[http://127.0.0.5:29518: server no response]
2020-12-11T06:39:09Z [WARN][PCF][Init] AMF status subscribe Error[http://127.0.0.1:29518: server no response]
2020-12-11T06:39:09Z [WARN][PCF][Init] AMF status subscribe Error[http://127.0.0.1:29518: server no response]
2020-12-11T06:39:09Z [WARN][PCF][Init] AMF status subscribe Error[http://127.0.0.1:29518: server no response]
2020-12-11T06:39:09Z [WARN][PCF][Init] AMF status subscribe Error[http://127.0.0.1:29518: server no response]
2020-12-11T06:39:09Z [WARN][PCF][Init] AMF status subscribe Error[http://127.0.0.1:29518: server no response]
2020-12-11T06:39:09Z [WARN][PCF][Init] AMF status subscribe Error[http://127.0.0.1:29518: server no response]
2020-12-11T06:39:09Z [WARN][PCF][Init] AMF status subscribe Error[http://127.0.0.1:29518: server no response]
2020-12-11T06:39:09Z [WARN][PCF][Init] AMF status subscribe Error[http://127.0.0.1:29518: server no response]
2020-12-11T06:39:09Z [WARN][PCF][Init] AMF status subscribe Error[http://127.0.0.1:29518: server no response]
2020-12-11T06:39:09Z [WARN][PCF][Init] AMF status subscribe Error[http://127.0.0.1:29518: server no response]
2020-12-11T06:39:09Z [INFO][NRF][Discovery] Handle NFDiscoveryRequest
2020-12-11T06:39:09Z [INFO][NRF][GIN] | 200 | 127.0.0.1 | GET | /nnrf-disc/v1/nf-instances?requester-nf-type=PCF&service-names=nudr-dr&target-nf-type=UDR |

I think you forget to modify the IP on NRF for each NFs’ config.

For example, there is a nrfUri filed in amf config. After you have changed the IP of NRF, you should also modify it.

Hi,
I have modified “config/amfcfg.conf” file
changed ips as below,

configuration:
amfName: AMF
ngapIpList:
- 127.0.0.1
sbi:
scheme: http
registerIPv4: 127.0.0.5 # IP used to register to NRF
bindingIPv4: 127.0.0.1 # IP used to bind the service

If u see above I have changed registerIPv4 from127.0.0.1 to 127.0.0.5 . Now, should I change ngapIpList and bindingIPv4 address to 127.0.0.5 as well ?

kindly clarify.