... | ... | @@ -34,16 +34,20 @@ Check build types with './build_amf -h' |
|
|
ubuntu@test-amf:~/oai-cn5g-amf/build/scripts$ ./build_amf -c -V -b Debug -j
|
|
|
```
|
|
|
|
|
|
## MySQL Installation
|
|
|
At this stage, AMF does not support authentication/authorization procedures via UDM/AUSF. These procedures are implemented locally in AMF. Also, we relied on a MySQL database (DB) to store the user information. This DB can be deployed in a separated machine or in the same machine with AMF.
|
|
|
### MySQL Installation
|
|
|
At this stage, AMF can support two modes of authentication/authorization: i) Authentication/authorization procedures are locally implemented in AMF; ii) As specified by 3GPP, authentication/authorization procedures are implemented in AUSF/UDM.
|
|
|
To use the first mode, AMF relies on a MySQL database (DB) to store the user information. This DB can be deployed in a separated machine or in the same machine with AMF.
|
|
|
|
|
|
#### MySQL and AMF are collocation in a VM/Physical machine
|
|
|
To install MySQL server, execute the following command
|
|
|
|
|
|
Install MySQL server with the following command and try to login.
|
|
|
```bash
|
|
|
$ sudo apt install mysql-server
|
|
|
#then login to MySQL
|
|
|
$ mysql -u root -p
|
|
|
```
|
|
|
The default username and password used for MySQL are `root` and `linux`, respectively.
|
|
|
Note that you may need to change the password for root as following:
|
|
|
Note that you may need to change the password for `root` as following:
|
|
|
|
|
|
```bash
|
|
|
$ mysql -u root -p
|
... | ... | @@ -54,7 +58,7 @@ $ mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'linux'; |
|
|
$ mysql> exit
|
|
|
```
|
|
|
|
|
|
After that, we can login to MySQL with password "linux" and create/import a database for your user information.
|
|
|
After that, we can login to MySQL with password `linux` and create/import a database for your user information.
|
|
|
|
|
|
```bash
|
|
|
$ mysql -u root -p
|
... | ... | @@ -70,6 +74,76 @@ $ mysql> INSERT INTO users VALUES |
|
|
('208950000000031','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d);
|
|
|
```
|
|
|
|
|
|
#### Deploy MySQL in a dokcer container
|
|
|
|
|
|
You can deploy MySQL in a docker container as following:
|
|
|
|
|
|
```
|
|
|
$ docker run --name cn5g-mysql --network oai-cn5g-test-public-net -d mysql/mysql-server:5.7
|
|
|
$ cd oai-cn5g-amf
|
|
|
$ docker cp build/scripts/oai_db.sql cn5g-mysql:/home
|
|
|
$ docker exec -it cn5g-mysql /bin/bash
|
|
|
|
|
|
```
|
|
|
|
|
|
Then, check the default password (`GENERATED ROOT PASSWORD`) by using the following command
|
|
|
|
|
|
```
|
|
|
$ docker logs cn5g-mysql
|
|
|
```
|
|
|
The expected output is as following
|
|
|
|
|
|
```
|
|
|
[Entrypoint] MySQL Docker Image 5.7.30-1.1.16
|
|
|
[Entrypoint] No password option specified for new database.
|
|
|
[Entrypoint] A random onetime password will be generated.
|
|
|
[Entrypoint] Initializing database
|
|
|
[Entrypoint] Database initialized
|
|
|
Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
|
|
|
Warning: Unable to load '/usr/share/zoneinfo/leapseconds' as time zone. Skipping it.
|
|
|
Warning: Unable to load '/usr/share/zoneinfo/tzdata.zi' as time zone. Skipping it.
|
|
|
Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.
|
|
|
Warning: Unable to load '/usr/share/zoneinfo/zone1970.tab' as time zone. Skipping it.
|
|
|
[Entrypoint] GENERATED ROOT PASSWORD: 14bZ4PUdYDojerUJ3S-@qM3lRYm
|
|
|
|
|
|
[Entrypoint] ignoring /docker-entrypoint-initdb.d/*
|
|
|
|
|
|
[Entrypoint] Server shut down
|
|
|
[Entrypoint] Setting root user as expired. Password will need to be changed before database can be used.
|
|
|
|
|
|
[Entrypoint] MySQL init process done. Ready for start up.
|
|
|
|
|
|
[Entrypoint] Starting MySQL 5.7.30-1.1.16
|
|
|
|
|
|
```
|
|
|
|
|
|
Then, connect to the MySQL by executing the following commmand
|
|
|
|
|
|
```
|
|
|
#provide the corresponding password to login to MySQL
|
|
|
$ docker exec -it cn5g-mysql mysql -uroot -p
|
|
|
|
|
|
```
|
|
|
|
|
|
From MySQL, modify the password and import the DB
|
|
|
|
|
|
```
|
|
|
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'linux';
|
|
|
|
|
|
#IMPORT DB:
|
|
|
$ mysql -u root -p oai_db < oai_db.sql
|
|
|
#Provisioning UE information
|
|
|
mysql> INSERT INTO users VALUES ('208950000000031','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d);
|
|
|
|
|
|
```
|
|
|
Finally you need to grant the remote access to MySQL from AMF:
|
|
|
|
|
|
```
|
|
|
mysql> GRANT ALL ON oai_db.* TO root@AMF_IP_ADDR IDENTIFIED BY 'linux';
|
|
|
```
|
|
|
Where AMF_IP_ADDR is the IP Address of the AMF
|
|
|
|
|
|
|
|
|
## AMF Configuration
|
|
|
|
|
|
**Create AMF configuration files**
|
... | ... | @@ -113,8 +187,8 @@ AMF_CONF[@SD_0@]='123' |
|
|
AMF_CONF[@SST_1@]='1'
|
|
|
AMF_CONF[@SD_1@]='12'
|
|
|
|
|
|
AMF_CONF[@AMF_INTERFACE_NAME_FOR_NGAP@]='ens3'
|
|
|
AMF_CONF[@AMF_INTERFACE_NAME_FOR_N11@]='ens3'
|
|
|
AMF_CONF[@AMF_INTERFACE_NAME_FOR_NGAP@]='enx0050b6f4ba5b'
|
|
|
AMF_CONF[@AMF_INTERFACE_NAME_FOR_N11@]='enx0050b6f4ba5b'
|
|
|
|
|
|
AMF_CONF[@SMF_INSTANCE_ID_0@]='1'
|
|
|
AMF_CONF[@SMF_IPV4_ADDR_0@]='192.168.122.1'
|
... | ... | @@ -122,7 +196,14 @@ AMF_CONF[@SMF_HTTP_VERSION_0@]='v1' |
|
|
AMF_CONF[@SMF_INSTANCE_ID_1@]='2'
|
|
|
AMF_CONF[@SMF_IPV4_ADDR_1@]='192.168.122.2'
|
|
|
AMF_CONF[@SMF_HTTP_VERSION_1@]='v1'
|
|
|
|
|
|
|
|
|
AMF_CONF[@NRF_IPV4_ADDRESS@]='192.168.1.23'
|
|
|
AMF_CONF[@NRF_PORT@]='80'
|
|
|
AMF_CONF[@NRF_API_VERSION@]='v1'
|
|
|
|
|
|
AMF_CONF[@AUSF_IPV4_ADDRESS@]='192.168.1.23'
|
|
|
AMF_CONF[@AUSF_PORT@]='80'
|
|
|
AMF_CONF[@AUSF_API_VERSION@]='v1'
|
|
|
|
|
|
AMF_CONF[@MYSQL_SERVER@]='127.0.0.1'
|
|
|
AMF_CONF[@MYSQL_USER@]='root'
|
... | ... | |