Add support for RU username parameter for connection to a RU via M-plane
The "sudo" access group is required by OAI gNB.
This commit is contained in:
@@ -1375,7 +1375,7 @@ Once the mplane service is successfully enabled on the RU, two new users are bei
|
||||
oranbenetel:x:1000:1000::/home/oranbenetel:/bin/sh
|
||||
oranext:x:1001:1001::/home/oranext:/bin/sh
|
||||
```
|
||||
Create `oranbenetel` home directory:
|
||||
OAI gNB requires the `sudo` access group for NETCONF session. In the case of Benetel O-RUs, the corresponding user is `oranbenetel`. Therefore, please create its home directory:
|
||||
```bash
|
||||
mkdir /home/oranbenetel && chown oranbenetel:oranbenetel /home/oranbenetel
|
||||
```
|
||||
@@ -1404,6 +1404,7 @@ fhi_72 = {
|
||||
du_key_pair = ("<path-to>/.ssh/id_rsa.pub", "<path-to>/.ssh/id_rsa");
|
||||
du_addr = ("00:11:22:33:44:66", "00:11:22:33:44:67"); # only one needed if one VF configured
|
||||
vlan_tag = (9, 9); # only one needed if one VF configured
|
||||
ru_username = ("oranbenetel");
|
||||
ru_ip_addr = ("192.168.80.9");
|
||||
fh_config = ({
|
||||
T1a_cp_dl = (419, 470);
|
||||
@@ -1423,6 +1424,7 @@ fhi_72 = {
|
||||
du_key_pair = ("/home/oaicicd/.ssh/id_rsa.pub", "/home/oaicicd/.ssh/id_rsa");
|
||||
du_addr = ("00:11:22:33:44:66", "00:11:22:33:44:67", "00:11:22:33:44:68", "00:11:22:33:44:69"); # only two needed if two VFs configured
|
||||
vlan_tag = (9, 9, 11, 11); # only two needed if two VFs configured
|
||||
ru_username = ("oranbenetel", "oranbenetel");
|
||||
ru_ip_addr = ("192.168.80.9", "192.168.80.10");
|
||||
fh_config = (
|
||||
# RAN550 #1
|
||||
@@ -1451,6 +1453,7 @@ fhi_72 = {
|
||||
* `du_key_pair`: ssh public and private keys to authenticate RU with NETCONF
|
||||
* `du_addr`: DU MAC address(es) to create CU-plane interface(s) in the RU
|
||||
* `vlan_tag`: VLAN U and C plane tags to create CU-plane interface(s) in the RU
|
||||
* `ru_username`: Username with `sudo` access to connect to the RU via M-plane
|
||||
* `ru_ip_addr`: RU IP address to connect to the RU via M-plane
|
||||
* `dpdk_mem_size`: [*]
|
||||
* `dpdk_iova_mode`: [*]
|
||||
|
||||
@@ -37,9 +37,8 @@ static int my_auth_hostkey_check(const char *hostname, ssh_session session, void
|
||||
bool connect_mplane(ru_session_t *ru_session)
|
||||
{
|
||||
int port = NC_PORT_SSH;
|
||||
char *user = "oranbenetel";
|
||||
|
||||
nc_client_ssh_set_username(user);
|
||||
nc_client_ssh_set_username(ru_session->username);
|
||||
|
||||
nc_client_ssh_set_auth_pref(NC_SSH_AUTH_PUBLICKEY, 1); // ssh-key identification
|
||||
nc_client_ssh_set_auth_pref(NC_SSH_AUTH_PASSWORD, -1);
|
||||
@@ -47,11 +46,11 @@ bool connect_mplane(ru_session_t *ru_session)
|
||||
|
||||
nc_client_ssh_set_auth_hostkey_check_clb(my_auth_hostkey_check, "DATA"); // host-key identification
|
||||
|
||||
MP_LOG_I("RPC request to RU \"%s\" = <connect> with username \"%s\" and port ID \"%d\".\n", ru_session->ru_ip_add, user, port);
|
||||
MP_LOG_I("RPC request to RU \"%s\" = <connect> with username \"%s\" and port ID \"%d\".\n", ru_session->ru_ip_add, ru_session->username, port);
|
||||
ru_session->session = nc_connect_ssh(ru_session->ru_ip_add, port, NULL);
|
||||
AssertError(ru_session->session != NULL, return false, "[MPLANE] RU IP address %s unreachable. Maybe M-plane is disabled on the RU?\n", ru_session->ru_ip_add);
|
||||
|
||||
MP_LOG_I("Successfuly connected to RU \"%s\" with username \"%s\" and port ID \"%d\".\n", ru_session->ru_ip_add, user, port);
|
||||
MP_LOG_I("Successfuly connected to RU \"%s\" with username \"%s\" and port ID \"%d\".\n", ru_session->ru_ip_add, ru_session->username, port);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -96,11 +96,14 @@ bool init_mplane(ru_session_list_t *ru_session_list)
|
||||
|
||||
char **ru_ip_addrs = gpd(fhip, nump, ORAN_CONFIG_RU_IP_ADDR)->strlistptr;
|
||||
int num_rus = gpd(fhip, nump, ORAN_CONFIG_RU_IP_ADDR)->numelt;
|
||||
char **ru_usernames = gpd(fhip, nump, ORAN_CONFIG_RU_USERNAME)->strlistptr;
|
||||
int num_ru_users = gpd(fhip, nump, ORAN_CONFIG_RU_USERNAME)->numelt;
|
||||
char **du_mac_addr = gpd(fhip, nump, ORAN_CONFIG_DU_ADDR)->strlistptr;
|
||||
int num_dus = gpd(fhip, nump, ORAN_CONFIG_DU_ADDR)->numelt;
|
||||
int32_t *vlan_tag = gpd(fhip, nump, ORAN_CONFIG_VLAN_TAG)->iptr;
|
||||
int num_vlan_tags = gpd(fhip, nump, ORAN_CONFIG_VLAN_TAG)->numelt;
|
||||
|
||||
AssertError(num_rus == num_ru_users, return false, "[MPLANE] Number of RUs should be equal to the number of users, one for each.\n");
|
||||
AssertError(num_dus == num_vlan_tags, return false, "[MPLANE] Number of DU MAC addresses should be equal to the number of VLAN tags.\n");
|
||||
|
||||
int num_cu_planes = num_dus / num_rus;
|
||||
@@ -112,6 +115,8 @@ bool init_mplane(ru_session_list_t *ru_session_list)
|
||||
ru_session->session = NULL;
|
||||
ru_session->ru_ip_add = calloc(strlen(ru_ip_addrs[i]) + 1, sizeof(char));
|
||||
memcpy(ru_session->ru_ip_add, ru_ip_addrs[i], strlen(ru_ip_addrs[i]) + 1);
|
||||
ru_session->username = calloc(strlen(ru_usernames[i]) + 1, sizeof(char));
|
||||
memcpy(ru_session->username, ru_usernames[i], strlen(ru_usernames[i]) + 1);
|
||||
|
||||
// store DU MAC addresses and VLAN tags
|
||||
ru_session->ru_mplane_config.num_cu_planes = num_cu_planes;
|
||||
|
||||
@@ -82,6 +82,7 @@ typedef struct {
|
||||
} ru_mplane_config_t;
|
||||
|
||||
typedef struct {
|
||||
char *username;
|
||||
char *ru_ip_add;
|
||||
ru_mplane_config_t ru_mplane_config;
|
||||
void *session;
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#define ORAN_CONFIG_DU_ADDR "du_addr" // only needed for M-plane
|
||||
#define ORAN_CONFIG_VLAN_TAG "vlan_tag" // only needed for M-plane
|
||||
#define ORAN_CONFIG_RU_ADDR "ru_addr" // not needed if M-plane used
|
||||
#define ORAN_CONFIG_RU_USERNAME "ru_username" // only needed for M-plane
|
||||
#define ORAN_CONFIG_RU_IP_ADDR "ru_ip_addr" // only needed for M-plane
|
||||
#define ORAN_CONFIG_MTU "mtu" // not needed if M-plane used
|
||||
#define ORAN_CONFIG_FILE_PREFIX "file_prefix"
|
||||
@@ -56,6 +57,7 @@
|
||||
{ORAN_CONFIG_DU_ADDR, "Ether addr of DU\n", PARAMFLAG_MANDATORY, .strlistptr=NULL, .defstrlistval=NULL, TYPE_STRINGLIST, 0}, \
|
||||
{ORAN_CONFIG_VLAN_TAG, "VLAN tag\n", PARAMFLAG_MANDATORY, .iptr=NULL, .defintarrayval=0, TYPE_INTARRAY, 0}, \
|
||||
{ORAN_CONFIG_RU_ADDR, "Ether addr of RU\n", PARAMFLAG_MANDATORY, .strlistptr=NULL, .defstrlistval=NULL, TYPE_STRINGLIST, 0}, \
|
||||
{ORAN_CONFIG_RU_USERNAME, "Username of RU\n", PARAMFLAG_MANDATORY, .strlistptr=NULL, .defstrlistval=NULL, TYPE_STRINGLIST, 0}, \
|
||||
{ORAN_CONFIG_RU_IP_ADDR, "IP addr of RU\n", PARAMFLAG_MANDATORY, .strlistptr=NULL, .defstrlistval=NULL, TYPE_STRINGLIST, 0}, \
|
||||
{ORAN_CONFIG_MTU, "MTU of Eth interface\n", 0, .uptr=NULL, .defuintval=1500, TYPE_UINT, 0}, \
|
||||
{ORAN_CONFIG_FILE_PREFIX, "DPDK file-prefix\n", 0, .strptr=NULL, .defstrval="wls_0", TYPE_STRING, 0}, \
|
||||
@@ -82,6 +84,7 @@
|
||||
{ .s5 = { NULL } }, \
|
||||
{ .s5 = { NULL } }, \
|
||||
{ .s5 = { NULL } }, \
|
||||
{ .s5 = { NULL } }, \
|
||||
{ .s3a = { config_checkstr_assign_integer, \
|
||||
{"PA", "VA"}, {0, 1}, 2} }, \
|
||||
{ .s5 = { NULL } }, \
|
||||
|
||||
+1
@@ -240,6 +240,7 @@ fhi_72 = {
|
||||
du_key_pair = ("/home/eurecom/.ssh/id_rsa.pub", "/home/eurecom/.ssh/id_rsa");
|
||||
du_addr = ("00:11:22:33:44:66", "00:11:22:33:44:67", "00:11:22:33:44:68", "00:11:22:33:44:69");
|
||||
vlan_tag = (5, 5, 6, 6);
|
||||
ru_username = ("oranbenetel", "oranbenetel");
|
||||
ru_ip_addr = ("192.168.80.5", "192.168.80.6");
|
||||
fh_config = (
|
||||
# RAN650 #1
|
||||
|
||||
+1
@@ -260,6 +260,7 @@ fhi_72 = {
|
||||
du_key_pair = ("/home/eurecom/.ssh/id_rsa.pub", "/home/eurecom/.ssh/id_rsa");
|
||||
du_addr = ("00:11:22:33:44:68","00:11:22:33:44:69");
|
||||
vlan_tag = (11, 11);
|
||||
ru_username = ("oranbenetel");
|
||||
ru_ip_addr = ("192.168.80.10");
|
||||
fh_config = ({
|
||||
T1a_cp_dl = (419, 470);
|
||||
|
||||
Reference in New Issue
Block a user