Error in configuring network interfaces

Hi,

I have installed free5Gc in a VM in an oracle virtual box and confirgured three network adapters in bridged adaptor mode:

enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.156 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::c526:9dff:f3cd:21bd prefixlen 64 scopeid 0x20
ether 08:00:27:5a:71:ef txqueuelen 1000 (Ethernet)
RX packets 42311 bytes 44879722 (44.8 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 33443 bytes 3092874 (3.0 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.154 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::5640:30f:e22d:22e8 prefixlen 64 scopeid 0x20
ether 08:00:27:53:bc:3a txqueuelen 1000 (Ethernet)
RX packets 42399 bytes 44886454 (44.8 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 845 bytes 80750 (80.7 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

enp0s9: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.153 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::faec:4456:f485:88d prefixlen 64 scopeid 0x20
ether 08:00:27:7d:3f:08 txqueuelen 1000 (Ethernet)
RX packets 42570 bytes 44897070 (44.8 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 164 bytes 15550 (15.5 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

ipsec0: flags=193<UP,RUNNING,NOARP> mtu 1480
inet 192.168.1.153 netmask 255.255.255.255
inet6 fe80::5efe:c0a8:101 prefixlen 64 scopeid 0x20
tunnel txqueuelen 1000 (IPIP Tunnel)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 9 dropped 0 overruns 0 carrier 9 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1000 (Local Loopback)
RX packets 5265 bytes 673560 (673.5 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 5265 bytes 673560 (673.5 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

After that I ran below for N3wif configuration:
sudo ip link add ipsec0 type vti local 192.168.1.1 remote 0.0.0.0 key 42
sudo ip address add 192.168.1.153 dev ipsec0

Is the above ip given correct?
Also, how to configure different adapters for UPF, AMF and n3Iwf.

After that I ran test scripts and getting fatal error.
go:112 free5gc/src/nrf/service.(*NRF).Start() 127.0.0.1:29510 NRF=init
FATA[2020-06-11T12:29:50+05:30]/home/opencc/go/src/free5gc/src/nrf/service/init.go:132 free5gc/src/nrf/service.(*NRF).Start() HTTP server setup failed: %+v listen tcp 127.0.0.1:29510: bind: address already in use NRF=init
exit status 1
FAIL free5gc/src/test 0.174s
INFO[2020-06-11T12:29:51+05:30] /home/opencc/go/src/free5gc/src/upf/src/up/up_path.c:52 UpRouteTerminate() Removing APN routes UPF=Util
INFO[2020-06-11T12:29:51+05:30] /home/opencc/go/src/free5gc/src/upf/src/upf_init.c:297 PacketReceiverThread() Packet receiver thread terminated UPF=Util

And in wireshark, in ICMP , destination unreachable is coming.

Please let me know what configurations needs to be done for interfaces.

You might check which process are bind on this address and kill it.

sudo ip link add ipsec0 type vti local 192.168.1.1 remote 0.0.0.0 key 42
sudo ip address add 192.168.1.153 dev ipsec0

Is the above configuration fine??

After I killed the process,
again , the below error is coming.
init.go:85 free5gc/src/amf/service.(*AMF).Initialize() AMF debug level(string): info AMF=init
INFO[2020-06-12T12:17:40+05:30]/home/opencc/go/src/free5gc/src/amf/service/amf_init.go:110 free5gc/src/amf/service.(*AMF).Start() Server started AMF=init
INFO[2020-06-12T12:17:40+05:30]/home/opencc/go/src/free5gc/src/amf/util/init_context.go:14 free5gc/src/amf/util.InitAmfContext() amfconfig Info: Version[1.0.0] Description[AMF initial local configuration] AMF=Util
ERRO[2020-06-12T12:17:40+05:30]/home/opencc/go/src/free5gc/lib/ngap/ngapSctp/sctp.go:78 free5gc/lib/ngap/ngapSctp.Server() failed to listen: address already in use NGAP=NGAP
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xb151e6]

goroutine 13 [running]:
git.cs.nctu.edu.tw/calee/sctp.(*SCTPListener).Addr(…)
/home/opencc/go/src/git.cs.nctu.edu.tw/calee/sctp/sctp.go:636
free5gc/lib/ngap/ngapSctp.Server(0xc0015787b0, 0x9, 0xc001579770)
/home/opencc/go/src/free5gc/lib/ngap/ngapSctp/sctp.go:80 +0x366
free5gc/src/amf/ngap/sctp.Server(0xc0015787b0, 0x9, 0xc001eafd68)
/home/opencc/go/src/free5gc/src/amf/ngap/sctp/sctp.go:27 +0x39
free5gc/src/amf/service.(*AMF).Start(0x2880d80)
/home/opencc/go/src/free5gc/src/amf/service/amf_init.go:143 +0x460
created by free5gc/src/test_test.init.0
/home/opencc/go/src/free5gc/src/test/ngsetup_test.go:66 +0x22b
exit status 2
FAIL free5gc/src/test 0.672s
INFO[2020-06-12T12:17:41+05:30] /home/opencc/go/src/free5gc/src/upf/src/up/up_path.c:52 UpRouteTerminate() Removing APN routes UPF=Util
INFO[2020-06-12T12:17:41+05:30] /home/opencc/go/src/free5gc/src/upf/src/upf_init.c:297 PacketReceiverThread() Packet receiver thread terminated UPF=Util

Seems to be the same problem. Can you try the solution we suggest here?

Thanks a lot.

Hi, shwetasachdeva

These two commands might be wrong for your environment. According to Linux manpage, the local argument specifies the fixed local address for the tunneled packets. It must be an address on another interface on this host. Your network environment didn’t show any interface with ip address 192.168.1.1. The kernel didn’t know how to route to 192.168.1.1, so it got an ICMP unreachable message.