Creazione certificati Site 1 e Site 2
NOTA. Per praticità, il setup dei certificati è stato effettuato sulla prima VM del Load Balancer
ROOT CA Setup
Creiamo la seguente struttura per il setup della CA
mkdir -m 0755 /root/CA
mkdir -m 0755 /root/CA/private /root/CA/certs
cd /root/CA/
Generiamo la chiave privata e il certificato della CA con validità di 10 anni
openssl req -new -x509 -extensions v3_ca -keyout private/ca.key -out certs/ca.crt -days 3650
#Insert a Passprhase a complete following
Generating a 2048 bit RSA private key
……………………………………………………………………………………..+++
………………………….+++
writing new private key to ‘private/ca.key’
Enter PEM pass phrase: catemproot
Verifying – Enter PEM pass phrase: catemproot
—–
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ‘.’, the field will be left blank.
—–
Country Name (2 letter code) [XX]:IT
State or Province Name (full name) []:Italy
Locality Name (eg, city) [Default City]:Rome
Organization Name (eg, company) [Default Company Ltd]:Nvlabs
Organizational Unit Name (eg, section) []:Nvlabs.local
Common Name (eg, your name or your server’s hostname) []:Nvlabs Selfsigned CA
Email Address []:admin@nvlabs.local
Alla fine della procedura verranno creati 2 Files (Il certificato della CA e la chiave privata della CA) nelle seguenti sotto directory:
certs/ca.crt
private/ca.key
Server (PSC) Setup
Creiamo la struttura per i file dei PSC
cd /root/CA/
mkdir ServerCerts
cd ServerCerts/
Creiamo il file psc_csr.cfg da cui genereremo il file .CSR
E’ importante che nel parametro “subjectAltName” vengano specificati gli FQDN dei 2 PSC e del VIP del bilanciatore e nel parametro “commonName” venga specificato il fully qualified domain name del VIP del bilanciatore
vi psc_csr.cfg
[ req ]
distinguished_name = req_distinguished_name
encrypt_key = no
prompt = no
string_mask = nombstr
req_extensions = v3_req
[ v3_req ]
basicConstraints = CA:false
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
subjectAltName = DNS:psc-s1-01.nvlabs.local, DNS:psc-s1-02.nvlabs.local, DNS:lb-psc-s1-01.nvlabs.local
[ req_distinguished_name ]
countryName = IT
stateOrProvinceName = Italy
localityName = Rome
0.organizationName = Nvlabs
organizationalUnitName = Nvlabs.local
commonName = lb-psc-s1-01.nvlabs.local
Generiamo la chiave privata e il CSR dei PSC
openssl req -new -nodes -out ./psc-ha-vip.csr -newkey rsa:2048 -keyout ./psc-ha-vip.key -config ./psc_csr.cfg
Firmiamo il CSR con i certificati della CA
openssl x509 -req -days 3650 -in ./psc-ha-vip.csr -out ./psc-ha-vip.crt -CA ../certs/ca.crt -CAkey ../private/ca.key -extensions v3_req -CAcreateserial -extfile ./psc_csr.cfg
Signature ok
subject=/C=IT/ST=Italy/L=Rome/O=Nvlabs/OU=Nvlabs.local/CN=lb-psc-s1-01.nvlabs.local
Getting CA Private Key
Enter pass phrase for ../private/ca.key: catemproot
Se tutto è andato bene verrà generato il certificato del PSC firmato dalla CA
[root@lb-s1-01]# ls -1 psc-ha-vip.crt
psc-ha-vip.crt
Copiamo il certificato della CA rinominandolo (lo dovremo usare per concatenarlo insieme al certificato
cp ../certs/ca.crt cachain.crt
Concateniamo i certificati del PSC e della CA in un unico file
cat ./psc-ha-vip.crt >> ./psc-ha-vip-chain.crt
cat ./cachain.crt >> ./psc-ha-vip-chain.crt
Verifichaimo il certificato
openssl x509 -in ./psc-ha-vip-chain.crt -noout -text
La procedura per il Site 2 è uguale, bisogna solo ricordarsi di modificare i campi subjectAltName, commonName
[ req ]
distinguished_name = req_distinguished_name
encrypt_key = no
prompt = no
string_mask = nombstr
req_extensions = v3_req
[ v3_req ]
basicConstraints = CA:false
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
subjectAltName = DNS:psc-s2-01.nvlabs.local, DNS:psc-s2-02.nvlabs.local, DNS:lb-psc-s2-01.nvlabs.local
[ req_distinguished_name ]
countryName = IT
stateOrProvinceName = Italy
localityName = Milan
0.organizationName = Nvlabs
organizationalUnitName = Nvlabs.local
commonName = lb-psc-s2-01.nvlabs.local
Dual Site HA PSC – Intro
Installazione Load Balancer Site 1 e Site 2 – Parte 1a
Installazione Load Balancer Site 1 e Site 2 – Parte 1b
Installazione psc-s1-01 e psc-s1-02 – Parte 2
Creazione certificati Site 1 e Site 2 – Parte 3
Installazione nuovi certificati PSC Site 1 – Parte 4
Installazione psc-s2-01 e psc-s2-02 – Parte 5
Installazione vCenter Site 1 e 2 e bind verso vip PSC Site 1 e 2 – Parte 6
Configurazione PSC in modalità Ring topology fra i 2 site – Parte 7