1 # Creating OpenVPN files for users
5 In order to follow the steps documented here, few things must be prepared
8 * Access to required below Nordix OpenVPN/Jump servers with sudo access to infra user,
9 +----------------+---------------+--------------------------------------+
10 | Nordix OpenVPN | IP ADDRESS | SSH ACCESS |
11 +================+===============+======================================+
12 | ONAP-CityCloud | 77.81.6.42 | ssh <USER_ID>@77.81.6.42 -p 52413 |
13 +----------------+---------------+--------------------------------------+
14 | ONAP-Xerces | 129.192.70.24 | ssh <USER_ID>@129.192.70.24 -p 52413 |
15 +----------------+---------------+--------------------------------------+
16 | Acumos | 91.106.193.58 | ssh <USER_ID>@91.106.193.58 -p 52413 |
17 +----------------+---------------+--------------------------------------+
18 | CCD | 188.212.109.53| ssh <USER_ID>@188.212.109.53 -p 52413|
19 +----------------+---------------+--------------------------------------+
21 * Ensure SSH key based authentication enabled between Openvpn server and CA
23 * Login to required Nordix OpenVPN/Jump server from your machine
25 * Install virtualenv, python3-minimal, python3-dev, and python3-pip
28 sudo apt install -y virtualenv python3-minimal python3-dev python3-pip
30 * Create and set virtualenv
32 virtualenv -p python3 .venv
33 source .venv/bin/activate
35 * Install Ansible 2.9.6
37 pip install ansible==2.9.6
40 ## Generate User ovpn file
42 * Login to OpenVPN/Jump server with your credentials
44 * Clone infra/tools repository from Nordix Gerrit
47 git clone "https://gerrit.nordix.org/infra/tools"
49 You are now ready to create ovpn files for users in project specific OpenVPN server,
51 * Switch to infra user in OpenVPN/Jump server
53 * Change directory to you home directory from where repo cloned
55 cd <YOUR_HOME_DIR>/tools/infra/openvpn_automation
56 source <YOUR_HOME_DIR>/.venv/bin/activate
57 ansible-playbook -i inventory/inventory.ini openvpn_user_setup.yaml -e "client_name=<USERNAME_TO_CREATE_OVPN_CERT>"
61 * Client user ID should be user's username (first character of user firstname + lastname)
62 * {{ client_name }} should be given as per specific OpenvVPN servers listed below,
63 +----------------+---------------+---------------------------+
64 | Nordix OpenVPN | CIDR | Client_name |
65 +================+===============+===========================+
66 | ONAP-CityCloud | 10.1.0.0/24 | client_userid.onap |
68 +----------------+---------------+---------------------------+
69 | ONAP-Xerces | 10.10.10.0/24 | client_userid.xerces.onap |
71 +----------------+---------------+---------------------------+
72 | Acumos | 10.1.0.0/24 | client_userid.acumos |
73 +----------------+---------------+---------------------------+
74 | CCD | 10.4.0.0/24 | client_userid.ccd |
75 +----------------+---------------+---------------------------+
77 * Once user specific ovpn file is generated, this file should be shared with user's email with below instructions,
79 * Please install the openvpn on your laptop. Assuming you using Ubuntu:
80 $ sudo apt install openvpn
81 * Then you need to open the VPN connection using the .ovpn file which contain all the required certificates:
82 $ sudo openvpn --config {{ client_name }}.ovpn
83 * Now, you should have access to all the VMs directly from your laptop
84 $ nmap -n -sP <CIDR>/24
85 * In case you use Windows 10 OS, please use the community version of OpenVPN client:
86 https://swupdate.openvpn.org/community/releases/openvpn-install-2.4.8-I602-Win10.exe
89 ## Revoke User ovpn file
91 * Login to required Nordix OpenVPN/Jump server from your machine
93 * Clone infra/tools repository from Nordix Gerrit
96 git clone "ssh://<USERNAME>@gerrit.nordix.org:29418/infra/tools && scp -p -P 29418 <USERNAME>@gerrit.nordix.org:hooks/commit-msg "tools/.git/hooks/"
98 You are now ready to revoke Openvpn access for users in project specific OpenVPN server,
100 * Switch to infra user in OpenVPN/Jump server
102 * Change directory to you home directory from where repo cloned
104 cd <YOUR_HOME_DIR>/tools/infra/openvpn_automation
105 source <YOUR_HOME_DIR>/.venv/bin/activate
106 ansible-playbook -i inventory/inventory.ini openvpn_user_revoke.yaml -e "client_name=<USERNAME_TO_REVOKE_ACCESS>"
109 * Client user ID should be user's username (first character of user firstname + lastname)
110 * {{ client_name }} should be given as per specific OpenvVPN servers listed below,
111 +----------------+---------------+---------------------------+
112 | Nordix OpenVPN | CIDR | Client_name |
113 +================+===============+===========================+
114 | ONAP-CityCloud | 10.1.0.0/24 | client_userid.onap |
116 +----------------+---------------+---------------------------+
117 | ONAP-Xerces | 10.10.10.0/24 | client_userid.xerces.onap |
118 | | 172.16.0.0/16 | |
119 +----------------+---------------+---------------------------+
120 | Acumos | 10.1.0.0/24 | client_userid.acumos |
121 +----------------+---------------+---------------------------+
122 | CCD | 10.4.0.0/24 | client_userid.ccd |
123 +----------------+---------------+---------------------------+