... | ... | @@ -33,6 +33,124 @@ Check build types with `./build_udr -h` |
|
|
ubuntu@test-udr:~/oai-cn5g-udr/build/scripts$ ./build_udr -c -V -b Debug -j
|
|
|
```
|
|
|
|
|
|
### MySQL Installation
|
|
|
|
|
|
As specified by 3GPP, UDR relies on a MySQL database to store data from UDM/NEF/PCF (e.g., subscription data and policy data by UDM and PCF, structured data, application data for NEF).
|
|
|
|
|
|
#### MySQL and UDR are collocation in a VM/Physical machine
|
|
|
To install MySQL server, execute the following command
|
|
|
|
|
|
```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:
|
|
|
|
|
|
```bash
|
|
|
$ mysql -u root -p
|
|
|
# from mysql prompt execute the following command:
|
|
|
$ mysql> FLUSH PRIVILEGES;
|
|
|
# then, set new password to "linux"
|
|
|
$ 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.
|
|
|
|
|
|
```bash
|
|
|
$ mysql -u root -p
|
|
|
# You can then create a DB
|
|
|
$ mysql> create database oai_db_v2;
|
|
|
$ mysql> exit
|
|
|
# then import the DB
|
|
|
$ cd build/scripts
|
|
|
$ mysql -u root -p oai_db < oai_db_v2.sql
|
|
|
|
|
|
# Import your UE configuration:
|
|
|
$ mysql> use oai_db;
|
|
|
# Provisioning UE information, for example, Imsi: 208950000000031, msisdn: 380561234567, imei: 55000000000001, imei_sv: NULL, ms_ps_status: PURGED, rau_tau_timer: 50, ue_ambr_ul: 40000000
|
|
|
# ue_ambr_dl: 100000000, access_restriction: 47, mme_cap: 0000000000, mmeidentity_idmmeidentity: 1, key: 0x0C0A34601D4F07677303652C0462535B, RFSP-Index: 0, urrp_mme: 0, sqn: 0x40
|
|
|
# rand: ebd07771ace8677a, OPc: 0x63bfa50ee6523365ff14c1f45f88737d
|
|
|
|
|
|
$ 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 docker container
|
|
|
|
|
|
You can deploy MySQL in a docker container as following:
|
|
|
|
|
|
```bash
|
|
|
$ 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
|
|
|
|
|
|
```bash
|
|
|
$ 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
|
|
|
|
|
|
```bash
|
|
|
#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
|
|
|
|
|
|
```bash
|
|
|
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'linux';
|
|
|
|
|
|
#IMPORT DB:
|
|
|
$ mysql -u root -p oai_db < oai_db.sql
|
|
|
# Provisioning UE information, for example, Imsi: 208950000000031, msisdn: 380561234567, imei: 55000000000001, imei_sv: NULL, ms_ps_status: PURGED, rau_tau_timer: 50, ue_ambr_ul: 40000000
|
|
|
# ue_ambr_dl: 100000000, access_restriction: 47, mme_cap: 0000000000, mmeidentity_idmmeidentity: 1, key: 0x0C0A34601D4F07677303652C0462535B, RFSP-Index: 0, urrp_mme: 0, sqn: 0x40
|
|
|
# rand: ebd07771ace8677a, OPc: 0x63bfa50ee6523365ff14c1f45f88737d
|
|
|
|
|
|
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:
|
|
|
|
|
|
```bash
|
|
|
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
|
|
|
|
|
|
|
|
|
## UDR Configuration
|
|
|
|
|
|
|
... | ... | |