Ppk

This set of tests shows how to configure and connect more than two subnets with each other through a VPN tunnel using PPK authentication in different ways.

../../../../_images/ppk.svg

Test PPK Options

Description

In this test, we will check the different options for PPK authentication (i.e., when it is required or not, when it remains unmatched, etc.).

Scenario

Note

Set default configuration for both DUTs, where PPK is not required and the PPK is the same.

Step 1: Set the following configuration in DUT0 :

set interfaces dummy dum0 address 10.1.0.1/24
set interfaces ethernet eth1 address 80.0.0.1/24
set protocols static route 10.2.0.0/24 interface dum0
set protocols static route 10.3.0.0/24 interface dum0
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set vpn ipsec auth-profile AUTH-SA global-secrets eap carol encrypted-secret U2FsdGVkX1+1VcEo0LufEBAFKv/nC9sVWdJwxPfAi1c=
set vpn ipsec auth-profile AUTH-SA global-secrets eap dave encrypted-secret U2FsdGVkX1/TROTjXqO6g/5MnOmZ+lOl0+wNDMgBi0E=
set vpn ipsec auth-profile AUTH-SA global-secrets ppk carol@teldat.org file 'running://ppk_carol.key'
set vpn ipsec auth-profile AUTH-SA global-secrets ppk dave@teldat.org file 'running://ppk_dave.key'
set vpn ipsec auth-profile AUTH-SA local ca-cert-file 'running://ca.crt'
set vpn ipsec auth-profile AUTH-SA local cert-file 'running://server.crt'
set vpn ipsec auth-profile AUTH-SA local id CN=moon.teldat.org
set vpn ipsec auth-profile AUTH-SA local key file 'running://server.priv.pem'
set vpn ipsec auth-profile AUTH-SA mirror-config false
set vpn ipsec auth-profile AUTH-SA remote auth eap %any type ttls
set vpn ipsec auth-profile AUTH-SA remote ppk id '*@teldat.org'
set vpn ipsec esp-group CHILD-SA mode tunnel
set vpn ipsec esp-group CHILD-SA proposal 1 encryption aes256gcm128
set vpn ipsec esp-group CHILD-SA proposal 1 pfs dh-group19
set vpn ipsec ike-group IKE-SA key-exchange ikev2
set vpn ipsec ike-group IKE-SA proposal 1 dh-group 19
set vpn ipsec ike-group IKE-SA proposal 1 encryption aes256gcm128
set vpn ipsec ike-group IKE-SA proposal 1 hash sha256
set vpn ipsec logging log-types any log-level 1
set vpn ipsec site-to-site peer PEER auth-profile AUTH-SA
set vpn ipsec site-to-site peer PEER connection-type respond
set vpn ipsec site-to-site peer PEER default-esp-group CHILD-SA
set vpn ipsec site-to-site peer PEER ike-group IKE-SA
set vpn ipsec site-to-site peer PEER local-address 80.0.0.1
set vpn ipsec site-to-site peer PEER tunnel 1 local prefix 10.1.0.0/24
set vpn ipsec site-to-site peer PEER tunnel 1 local-interface dum0

Step 2: Set the following configuration in DUT1 :

set interfaces dummy dum0 address 10.2.0.1/24
set interfaces ethernet eth1 address 80.0.0.2/24
set protocols static route 10.1.0.0/24 interface dum0
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set vpn ipsec auth-profile AUTH-SA global-secrets eap carol encrypted-secret U2FsdGVkX1/0E/CbMcjzl0/uNSVjyDUyCcMIoWhgt3E=
set vpn ipsec auth-profile AUTH-SA global-secrets ppk carol@teldat.org file 'running://ppk_carol.key'
set vpn ipsec auth-profile AUTH-SA local auth eap carol type ttls
set vpn ipsec auth-profile AUTH-SA local id carol
set vpn ipsec auth-profile AUTH-SA local ppk id carol@teldat.org
set vpn ipsec auth-profile AUTH-SA mirror-config false
set vpn ipsec auth-profile AUTH-SA remote ca-cert-file 'running://ca.crt'
set vpn ipsec auth-profile AUTH-SA remote id CN=moon.teldat.org
set vpn ipsec esp-group CHILD-SA mode tunnel
set vpn ipsec esp-group CHILD-SA proposal 1 encryption aes256gcm128
set vpn ipsec esp-group CHILD-SA proposal 1 pfs dh-group19
set vpn ipsec ike-group IKE-SA key-exchange ikev2
set vpn ipsec ike-group IKE-SA proposal 1 dh-group 19
set vpn ipsec ike-group IKE-SA proposal 1 encryption aes256gcm128
set vpn ipsec ike-group IKE-SA proposal 1 hash sha256
set vpn ipsec logging log-types any log-level 1
set vpn ipsec site-to-site peer PEER auth-profile AUTH-SA
set vpn ipsec site-to-site peer PEER connection-type initiate
set vpn ipsec site-to-site peer PEER default-esp-group CHILD-SA
set vpn ipsec site-to-site peer PEER ike-group IKE-SA
set vpn ipsec site-to-site peer PEER local-address 80.0.0.2
set vpn ipsec site-to-site peer PEER remote-address 80.0.0.1
set vpn ipsec site-to-site peer PEER tunnel 1 local prefix 10.2.0.0/24
set vpn ipsec site-to-site peer PEER tunnel 1 local-interface dum0
set vpn ipsec site-to-site peer PEER tunnel 1 remote prefix 10.1.0.0/24

Step 3: Ping the IP address 80.0.0.2 from DUT1:

admin@DUT1$ ping 80.0.0.2 count 1 size 56 timeout 1
Show output
PING 80.0.0.2 (80.0.0.2) 56(84) bytes of data.
64 bytes from 80.0.0.2: icmp_seq=1 ttl=64 time=0.291 ms

--- 80.0.0.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.291/0.291/0.291/0.000 ms

Step 4: Ping the IP address 80.0.0.1 from DUT0:

admin@DUT0$ ping 80.0.0.1 count 1 size 56 timeout 1
Show output
PING 80.0.0.1 (80.0.0.1) 56(84) bytes of data.
64 bytes from 80.0.0.1: icmp_seq=1 ttl=64 time=0.030 ms

--- 80.0.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.030/0.030/0.030/0.000 ms

Step 5: Run the command vpn ipsec show sa on DUT0 and check whether the output matches the following regular expressions:

(?m)\s+.*AES_GCM_16-256\/PRF_HMAC_SHA2_256\/ECP_256\/PPK.*\s+.*\s+.*\s+.*\s+.*\s+.*\s+.*\s+.*remote\s+10.2.0.*
Show output
vpn-peer-PEER: #1, ESTABLISHED, IKEv2, aae046f0e5817128_i ba5ef960eb839226_r*
local  'CN=moon.teldat.org' @ 80.0.0.1[500]
remote 'carol' @ 80.0.0.2[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 1s ago, rekeying in 21285s
peer-PEER-tunnel-1: #1, reqid 1, INSTALLED, TUNNEL, ESP:AES_GCM_16-256
installed 1s ago, rekeying in 3496s, expires in 3959s
in  c5801eda,      0 bytes,     0 packets
out c41a2baf,      0 bytes,     0 packets
local  10.1.0.0/24
remote 10.2.0.0/24

Step 6: Ping the IP address 10.2.0.1 from DUT0:

admin@DUT0$ ping 10.2.0.1 local-address 10.1.0.1 count 1 size 56 timeout 1
Show output
PING 10.2.0.1 (10.2.0.1) from 10.1.0.1 : 56(84) bytes of data.
64 bytes from 10.2.0.1: icmp_seq=1 ttl=64 time=0.478 ms

--- 10.2.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.478/0.478/0.478/0.000 ms

Step 7: Ping the IP address 10.1.0.1 from DUT1:

admin@DUT1$ ping 10.1.0.1 local-address 10.2.0.1 count 1 size 56 timeout 1
Show output
PING 10.1.0.1 (10.1.0.1) from 10.2.0.1 : 56(84) bytes of data.
64 bytes from 10.1.0.1: icmp_seq=1 ttl=64 time=0.624 ms

--- 10.1.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.624/0.624/0.624/0.000 ms

Step 8: Run the command vpn ipsec show sa on DUT0 and check whether the output matches the following regular expressions:

(?m)\s+.*AES_GCM_16-256\/PRF_HMAC_SHA2_256\/ECP_256\/PPK.*\s+.*\s+.*\s+.*\s+.*[1-9]\d? packets.*\s+.*[1-9]\d? packets.*\s+.*\s+.*remote\s+10.2.0.*
Show output
vpn-peer-PEER: #1, ESTABLISHED, IKEv2, aae046f0e5817128_i ba5ef960eb839226_r*
local  'CN=moon.teldat.org' @ 80.0.0.1[500]
remote 'carol' @ 80.0.0.2[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 1s ago, rekeying in 21285s
peer-PEER-tunnel-1: #1, reqid 1, INSTALLED, TUNNEL, ESP:AES_GCM_16-256
installed 1s ago, rekeying in 3496s, expires in 3959s
in  c5801eda,    168 bytes,     2 packets,     0s ago
out c41a2baf,    168 bytes,     2 packets,     0s ago
local  10.1.0.0/24
remote 10.2.0.0/24

Note

Delete the PPK from DUT0 and check that the SA falls back to standard authentication.

Step 9: Modify the following configuration lines in DUT0 :

delete vpn ipsec auth-profile AUTH-SA global-secrets ppk carol@teldat.org

Step 10: Run the command vpn ipsec clear peer PEER on DUT0 and expect the following output:

Show output
1 tunnel(s) reset for peer PEER

Step 11: Run the command vpn ipsec clear peer PEER on DUT1 and expect the following output:

Show output
1 tunnel(s) reset for peer PEER

Step 12: Run the command vpn ipsec show sa on DUT0 and check whether the output matches the following regular expressions:

(?m)\s+.*AES_GCM_16-256\/PRF_HMAC_SHA2_256\/ECP_256.*\s+.*\s+.*\s+.*\s+.*\s+.*\s+.*\s+.*remote\s+10.2.0.*
Show output
vpn-peer-PEER: #3, ESTABLISHED, IKEv2, 193ad0cce5a7188b_i 59ca14abc2498418_r*
local  'CN=moon.teldat.org' @ 80.0.0.1[500]
remote 'carol' @ 80.0.0.2[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256
established 0s ago, rekeying in 18008s
peer-PEER-tunnel-1: #3, reqid 1, INSTALLED, TUNNEL, ESP:AES_GCM_16-256
installed 0s ago, rekeying in 3351s, expires in 3960s
in  c5ccbb4f,      0 bytes,     0 packets
out c255fded,      0 bytes,     0 packets
local  10.1.0.0/24
remote 10.2.0.0/24

Step 13: Ping the IP address 10.2.0.1 from DUT0:

admin@DUT0$ ping 10.2.0.1 local-address 10.1.0.1 count 1 size 56 timeout 1
Show output
PING 10.2.0.1 (10.2.0.1) from 10.1.0.1 : 56(84) bytes of data.
64 bytes from 10.2.0.1: icmp_seq=1 ttl=64 time=0.437 ms

--- 10.2.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.437/0.437/0.437/0.000 ms

Step 14: Ping the IP address 10.1.0.1 from DUT1:

admin@DUT1$ ping 10.1.0.1 local-address 10.2.0.1 count 1 size 56 timeout 1
Show output
PING 10.1.0.1 (10.1.0.1) from 10.2.0.1 : 56(84) bytes of data.
64 bytes from 10.1.0.1: icmp_seq=1 ttl=64 time=0.847 ms

--- 10.1.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.847/0.847/0.847/0.000 ms

Step 15: Run the command vpn ipsec show sa on DUT0 and check whether the output matches the following regular expressions:

(?m)\s+.*AES_GCM_16-256\/PRF_HMAC_SHA2_256\/ECP_256.*\s+.*\s+.*\s+.*\s+.*[1-9]\d? packets.*\s+.*[1-9]\d? packets.*\s+.*\s+.*remote\s+10.2.0.*
Show output
vpn-peer-PEER: #3, ESTABLISHED, IKEv2, 193ad0cce5a7188b_i 59ca14abc2498418_r*
local  'CN=moon.teldat.org' @ 80.0.0.1[500]
remote 'carol' @ 80.0.0.2[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256
established 1s ago, rekeying in 18007s
peer-PEER-tunnel-1: #3, reqid 1, INSTALLED, TUNNEL, ESP:AES_GCM_16-256
installed 1s ago, rekeying in 3350s, expires in 3959s
in  c5ccbb4f,    168 bytes,     2 packets,     0s ago
out c255fded,    168 bytes,     2 packets,     0s ago
local  10.1.0.0/24
remote 10.2.0.0/24

Note

Set the PPK as required in DUT0 and, with DUT1’s corresponding PPK deleted, check that the connection fails.

Step 16: Modify the following configuration lines in DUT0 :

set vpn ipsec auth-profile AUTH-SA remote ppk required

Step 17: Run the command vpn ipsec clear peer PEER on DUT0 and expect the following output:

Show output
initiate failed: establishing CHILD_SA 'peer-PEER-tunnel-1' failed
0 tunnel(s) reset for peer PEER

Step 18: Run the command vpn ipsec clear peer PEER on DUT1 and expect the following output:

Show output
terminate failed: no matching SAs to terminate found
initiate failed: establishing CHILD_SA 'peer-PEER-tunnel-1' failed
0 tunnel(s) reset for peer PEER

Step 19: Expect a failure in the following command: Ping the IP address 10.2.0.1 from DUT0:

admin@DUT0$ ping 10.2.0.1 local-address 10.1.0.1 count 1 size 56 timeout 1
Show output
PING 10.2.0.1 (10.2.0.1) from 10.1.0.1 : 56(84) bytes of data.

--- 10.2.0.1 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms

Note

Set the PPK as required in DUT1 and change the PPK in DUT0 back to not required. Check that the connection is still failing.

Step 20: Modify the following configuration lines in DUT0 :

delete vpn ipsec auth-profile AUTH-SA remote ppk required

Step 21: Modify the following configuration lines in DUT1 :

set vpn ipsec auth-profile AUTH-SA local ppk required

Step 22: Run the command vpn ipsec clear peer PEER on DUT0 and expect the following output:

Show output
terminate failed: no matching SAs to terminate found
initiate failed: establishing CHILD_SA 'peer-PEER-tunnel-1' failed
0 tunnel(s) reset for peer PEER

Step 23: Run the command vpn ipsec clear peer PEER on DUT1 and expect the following output:

Show output
terminate failed: no matching SAs to terminate found
initiate failed: establishing CHILD_SA 'peer-PEER-tunnel-1' failed
0 tunnel(s) reset for peer PEER

Step 24: Expect a failure in the following command: Ping the IP address 10.2.0.1 from DUT0:

admin@DUT0$ ping 10.2.0.1 local-address 10.1.0.1 count 1 size 56 timeout 1
Show output
PING 10.2.0.1 (10.2.0.1) from 10.1.0.1 : 56(84) bytes of data.

--- 10.2.0.1 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms

Test PPK EAP-TTLS STS

Description

Test the site-to-site VPN with PPK authentication and EAP-TTLS

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces dummy dum0 address 10.1.0.1/24
set interfaces ethernet eth1 address 80.0.0.1/24
set protocols static route 10.2.0.0/24 interface dum0
set protocols static route 10.3.0.0/24 interface dum0
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set vpn ipsec auth-profile AUTH-SA global-secrets eap carol encrypted-secret U2FsdGVkX1/bF8SPmm8b1/lAmRB/4K38LLImCwNWF9Y=
set vpn ipsec auth-profile AUTH-SA global-secrets eap dave encrypted-secret U2FsdGVkX1+Hx+NzXpESJX5d1gjxk6MPLSiSND8lOqs=
set vpn ipsec auth-profile AUTH-SA global-secrets ppk carol@teldat.org file 'running://ppk_carol.key'
set vpn ipsec auth-profile AUTH-SA global-secrets ppk dave@teldat.org file 'running://ppk_dave.key'
set vpn ipsec auth-profile AUTH-SA local ca-cert-file 'running://ca.crt'
set vpn ipsec auth-profile AUTH-SA local cert-file 'running://server.crt'
set vpn ipsec auth-profile AUTH-SA local id CN=moon.teldat.org
set vpn ipsec auth-profile AUTH-SA local key file 'running://server.priv.pem'
set vpn ipsec auth-profile AUTH-SA mirror-config false
set vpn ipsec auth-profile AUTH-SA remote auth eap %any type ttls
set vpn ipsec auth-profile AUTH-SA remote ppk id '*@teldat.org'
set vpn ipsec esp-group CHILD-SA mode tunnel
set vpn ipsec esp-group CHILD-SA proposal 1 encryption aes256gcm128
set vpn ipsec esp-group CHILD-SA proposal 1 pfs dh-group19
set vpn ipsec ike-group IKE-SA key-exchange ikev2
set vpn ipsec ike-group IKE-SA proposal 1 dh-group 19
set vpn ipsec ike-group IKE-SA proposal 1 encryption aes256gcm128
set vpn ipsec ike-group IKE-SA proposal 1 hash sha256
set vpn ipsec logging log-types any log-level 1
set vpn ipsec site-to-site peer PEER auth-profile AUTH-SA
set vpn ipsec site-to-site peer PEER connection-type respond
set vpn ipsec site-to-site peer PEER default-esp-group CHILD-SA
set vpn ipsec site-to-site peer PEER ike-group IKE-SA
set vpn ipsec site-to-site peer PEER local-address 80.0.0.1
set vpn ipsec site-to-site peer PEER tunnel 1 local prefix 10.1.0.0/24
set vpn ipsec site-to-site peer PEER tunnel 1 local-interface dum0

Step 2: Set the following configuration in DUT1 :

set interfaces dummy dum0 address 10.2.0.1/24
set interfaces ethernet eth1 address 80.0.0.2/24
set protocols static route 10.1.0.0/24 interface dum0
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set vpn ipsec auth-profile AUTH-SA global-secrets eap carol encrypted-secret U2FsdGVkX1/xiGTK1x70CDDdgad247MqkMqVF5LjAEs=
set vpn ipsec auth-profile AUTH-SA global-secrets ppk carol@teldat.org file 'running://ppk_carol.key'
set vpn ipsec auth-profile AUTH-SA local auth eap carol type ttls
set vpn ipsec auth-profile AUTH-SA local id carol
set vpn ipsec auth-profile AUTH-SA local ppk id carol@teldat.org
set vpn ipsec auth-profile AUTH-SA mirror-config false
set vpn ipsec auth-profile AUTH-SA remote ca-cert-file 'running://ca.crt'
set vpn ipsec auth-profile AUTH-SA remote id CN=moon.teldat.org
set vpn ipsec esp-group CHILD-SA mode tunnel
set vpn ipsec esp-group CHILD-SA proposal 1 encryption aes256gcm128
set vpn ipsec esp-group CHILD-SA proposal 1 pfs dh-group19
set vpn ipsec ike-group IKE-SA key-exchange ikev2
set vpn ipsec ike-group IKE-SA proposal 1 dh-group 19
set vpn ipsec ike-group IKE-SA proposal 1 encryption aes256gcm128
set vpn ipsec ike-group IKE-SA proposal 1 hash sha256
set vpn ipsec logging log-types any log-level 1
set vpn ipsec site-to-site peer PEER auth-profile AUTH-SA
set vpn ipsec site-to-site peer PEER connection-type initiate
set vpn ipsec site-to-site peer PEER default-esp-group CHILD-SA
set vpn ipsec site-to-site peer PEER ike-group IKE-SA
set vpn ipsec site-to-site peer PEER local-address 80.0.0.2
set vpn ipsec site-to-site peer PEER remote-address 80.0.0.1
set vpn ipsec site-to-site peer PEER tunnel 1 local prefix 10.2.0.0/24
set vpn ipsec site-to-site peer PEER tunnel 1 local-interface dum0
set vpn ipsec site-to-site peer PEER tunnel 1 remote prefix 10.1.0.0/24

Step 3: Ping the IP address 80.0.0.2 from DUT1:

admin@DUT1$ ping 80.0.0.2 count 1 size 56 timeout 1
Show output
PING 80.0.0.2 (80.0.0.2) 56(84) bytes of data.
64 bytes from 80.0.0.2: icmp_seq=1 ttl=64 time=0.032 ms

--- 80.0.0.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.032/0.032/0.032/0.000 ms

Step 4: Ping the IP address 80.0.0.1 from DUT0:

admin@DUT0$ ping 80.0.0.1 count 1 size 56 timeout 1
Show output
PING 80.0.0.1 (80.0.0.1) 56(84) bytes of data.
64 bytes from 80.0.0.1: icmp_seq=1 ttl=64 time=0.041 ms

--- 80.0.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.041/0.041/0.041/0.000 ms

Step 5: Set the following configuration in DUT2 :

set interfaces dummy dum0 address 10.3.0.1/24
set interfaces ethernet eth1 address 80.0.0.3/24
set protocols static route 0.0.0.0/0 interface dum0
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set vpn ipsec auth-profile AUTH-SA global-secrets eap dave encrypted-secret U2FsdGVkX19v86w6Z9aGSTHqJEWO6xwsJWZHM9EkwD8=
set vpn ipsec auth-profile AUTH-SA global-secrets ppk dave@teldat.org file 'running://ppk_dave.key'
set vpn ipsec auth-profile AUTH-SA local auth eap dave type ttls
set vpn ipsec auth-profile AUTH-SA local id dave
set vpn ipsec auth-profile AUTH-SA local ppk id dave@teldat.org
set vpn ipsec auth-profile AUTH-SA mirror-config false
set vpn ipsec auth-profile AUTH-SA remote ca-cert-file 'running://ca.crt'
set vpn ipsec auth-profile AUTH-SA remote id CN=moon.teldat.org
set vpn ipsec esp-group CHILD-SA mode tunnel
set vpn ipsec esp-group CHILD-SA proposal 1 encryption aes256gcm128
set vpn ipsec esp-group CHILD-SA proposal 1 pfs dh-group19
set vpn ipsec ike-group IKE-SA key-exchange ikev2
set vpn ipsec ike-group IKE-SA proposal 1 dh-group 19
set vpn ipsec ike-group IKE-SA proposal 1 encryption aes256gcm128
set vpn ipsec ike-group IKE-SA proposal 1 hash sha256
set vpn ipsec logging log-types any log-level 1
set vpn ipsec site-to-site peer PEER auth-profile AUTH-SA
set vpn ipsec site-to-site peer PEER connection-type initiate
set vpn ipsec site-to-site peer PEER default-esp-group CHILD-SA
set vpn ipsec site-to-site peer PEER ike-group IKE-SA
set vpn ipsec site-to-site peer PEER local-address 80.0.0.3
set vpn ipsec site-to-site peer PEER remote-address 80.0.0.1
set vpn ipsec site-to-site peer PEER tunnel 1 local prefix 10.3.0.0/24
set vpn ipsec site-to-site peer PEER tunnel 1 local-interface dum0
set vpn ipsec site-to-site peer PEER tunnel 1 remote prefix 10.1.0.0/24

Step 6: Ping the IP address 10.1.0.1 from DUT2:

admin@DUT2$ ping 10.1.0.1 count 1 size 56 timeout 1
Show output
PING 10.1.0.1 (10.1.0.1) 56(84) bytes of data.
64 bytes from 10.1.0.1: icmp_seq=1 ttl=64 time=0.605 ms

--- 10.1.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.605/0.605/0.605/0.000 ms

Step 7: Run the command vpn ipsec show sa on DUT0 and check whether the output matches the following regular expressions:

(?m)\s+.*AES_GCM_16-256\/PRF_HMAC_SHA2_256\/ECP_256\/PPK.*\s+.*\s+.*\s+.*\s+.*\s+.*\s+.*\s+.*remote\s+10.2.0.*
Show output
vpn-peer-PEER: #1, ESTABLISHED, IKEv2, d5eddc2479815dff_i 3184b73e78e704c0_r*
local  'CN=moon.teldat.org' @ 80.0.0.1[500]
remote 'carol' @ 80.0.0.2[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 5s ago, rekeying in 19579s
peer-PEER-tunnel-1: #1, reqid 1, INSTALLED, TUNNEL, ESP:AES_GCM_16-256
installed 5s ago, rekeying in 3240s, expires in 3955s
in  cd7c265a,      0 bytes,     0 packets
out ceed3b58,      0 bytes,     0 packets
local  10.1.0.0/24
remote 10.2.0.0/24
vpn-peer-PEER: #2, ESTABLISHED, IKEv2, c4df121b50c00803_i 6825d073b797eb65_r*
local  'CN=moon.teldat.org' @ 80.0.0.1[500]
remote 'dave' @ 80.0.0.3[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 0s ago, rekeying in 20481s
peer-PEER-tunnel-1: #2, reqid 2, INSTALLED, TUNNEL, ESP:AES_GCM_16-256
installed 0s ago, rekeying in 3339s, expires in 3960s
in  c85e4e54,     84 bytes,     1 packets,     0s ago
out cc7c3466,     84 bytes,     1 packets,     0s ago
local  10.1.0.0/24
remote 10.3.0.0/24

Step 8: Ping the IP address 10.2.0.1 from DUT0:

admin@DUT0$ ping 10.2.0.1 local-address 10.1.0.1 count 1 size 56 timeout 1
Show output
PING 10.2.0.1 (10.2.0.1) from 10.1.0.1 : 56(84) bytes of data.
64 bytes from 10.2.0.1: icmp_seq=1 ttl=64 time=14.4 ms

--- 10.2.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 14.353/14.353/14.353/0.000 ms

Step 9: Ping the IP address 10.1.0.1 from DUT1:

admin@DUT1$ ping 10.1.0.1 local-address 10.2.0.1 count 1 size 56 timeout 1
Show output
PING 10.1.0.1 (10.1.0.1) from 10.2.0.1 : 56(84) bytes of data.
64 bytes from 10.1.0.1: icmp_seq=1 ttl=64 time=0.327 ms

--- 10.1.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.327/0.327/0.327/0.000 ms

Step 10: Run the command vpn ipsec show sa on DUT0 and check whether the output matches the following regular expressions:

(?m)\s+.*AES_GCM_16-256\/PRF_HMAC_SHA2_256\/ECP_256\/PPK.*\s+.*\s+.*\s+.*\s+.*[1-9]\d? packets.*\s+.*[1-9]\d? packets.*\s+.*\s+.*remote\s+10.2.0.*
Show output
vpn-peer-PEER: #1, ESTABLISHED, IKEv2, d5eddc2479815dff_i 3184b73e78e704c0_r*
local  'CN=moon.teldat.org' @ 80.0.0.1[500]
remote 'carol' @ 80.0.0.2[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 6s ago, rekeying in 19578s
peer-PEER-tunnel-1: #1, reqid 1, INSTALLED, TUNNEL, ESP:AES_GCM_16-256
installed 6s ago, rekeying in 3239s, expires in 3954s
in  cd7c265a,    168 bytes,     2 packets,     0s ago
out ceed3b58,    168 bytes,     2 packets,     0s ago
local  10.1.0.0/24
remote 10.2.0.0/24
vpn-peer-PEER: #2, ESTABLISHED, IKEv2, c4df121b50c00803_i 6825d073b797eb65_r*
local  'CN=moon.teldat.org' @ 80.0.0.1[500]
remote 'dave' @ 80.0.0.3[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 1s ago, rekeying in 20480s
peer-PEER-tunnel-1: #2, reqid 2, INSTALLED, TUNNEL, ESP:AES_GCM_16-256
installed 1s ago, rekeying in 3338s, expires in 3959s
in  c85e4e54,     84 bytes,     1 packets,     1s ago
out cc7c3466,     84 bytes,     1 packets,     1s ago
local  10.1.0.0/24
remote 10.3.0.0/24

Step 11: Run the command vpn ipsec show sa on DUT0 and check whether the output matches the following regular expressions:

(?m)\s+.*AES_GCM_16-256\/PRF_HMAC_SHA2_256\/ECP_256\/PPK\s+.*\s+.*\s+.*\s+.*\s+.*\s+.*\s+.*remote\s+10.3.0.*
Show output
vpn-peer-PEER: #1, ESTABLISHED, IKEv2, d5eddc2479815dff_i 3184b73e78e704c0_r*
local  'CN=moon.teldat.org' @ 80.0.0.1[500]
remote 'carol' @ 80.0.0.2[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 6s ago, rekeying in 19578s
peer-PEER-tunnel-1: #1, reqid 1, INSTALLED, TUNNEL, ESP:AES_GCM_16-256
installed 6s ago, rekeying in 3239s, expires in 3954s
in  cd7c265a,    168 bytes,     2 packets,     0s ago
out ceed3b58,    168 bytes,     2 packets,     0s ago
local  10.1.0.0/24
remote 10.2.0.0/24
vpn-peer-PEER: #2, ESTABLISHED, IKEv2, c4df121b50c00803_i 6825d073b797eb65_r*
local  'CN=moon.teldat.org' @ 80.0.0.1[500]
remote 'dave' @ 80.0.0.3[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 1s ago, rekeying in 20480s
peer-PEER-tunnel-1: #2, reqid 2, INSTALLED, TUNNEL, ESP:AES_GCM_16-256
installed 1s ago, rekeying in 3338s, expires in 3959s
in  c85e4e54,     84 bytes,     1 packets,     1s ago
out cc7c3466,     84 bytes,     1 packets,     1s ago
local  10.1.0.0/24
remote 10.3.0.0/24

Step 12: Ping the IP address 10.3.0.1 from DUT0:

admin@DUT0$ ping 10.3.0.1 local-address 10.1.0.1 count 1 size 56 timeout 1
Show output
PING 10.3.0.1 (10.3.0.1) from 10.1.0.1 : 56(84) bytes of data.
64 bytes from 10.3.0.1: icmp_seq=1 ttl=64 time=0.310 ms

--- 10.3.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.310/0.310/0.310/0.000 ms

Step 13: Ping the IP address 10.1.0.1 from DUT2:

admin@DUT2$ ping 10.1.0.1 local-address 10.3.0.1 count 1 size 56 timeout 1
Show output
PING 10.1.0.1 (10.1.0.1) from 10.3.0.1 : 56(84) bytes of data.
64 bytes from 10.1.0.1: icmp_seq=1 ttl=64 time=0.768 ms

--- 10.1.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.768/0.768/0.768/0.000 ms

Step 14: Run the command vpn ipsec show sa on DUT0 and check whether the output matches the following regular expressions:

(?m)\s+.*AES_GCM_16-256\/PRF_HMAC_SHA2_256\/ECP_256\/PPK\s+.*\s+.*\s+.*\s+.*[1-9]\d? packets.*\s+.*[1-9]\d? packets.*\s+.*\s+.*remote\s+10.3.0.*
Show output
vpn-peer-PEER: #1, ESTABLISHED, IKEv2, d5eddc2479815dff_i 3184b73e78e704c0_r*
local  'CN=moon.teldat.org' @ 80.0.0.1[500]
remote 'carol' @ 80.0.0.2[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 13s ago, rekeying in 19571s
peer-PEER-tunnel-1: #1, reqid 1, INSTALLED, TUNNEL, ESP:AES_GCM_16-256
installed 13s ago, rekeying in 3232s, expires in 3947s
in  cd7c265a,    168 bytes,     2 packets,     7s ago
out ceed3b58,    168 bytes,     2 packets,     7s ago
local  10.1.0.0/24
remote 10.2.0.0/24
vpn-peer-PEER: #2, ESTABLISHED, IKEv2, c4df121b50c00803_i 6825d073b797eb65_r*
local  'CN=moon.teldat.org' @ 80.0.0.1[500]
remote 'dave' @ 80.0.0.3[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 8s ago, rekeying in 20473s
peer-PEER-tunnel-1: #2, reqid 2, INSTALLED, TUNNEL, ESP:AES_GCM_16-256
installed 8s ago, rekeying in 3331s, expires in 3952s
in  c85e4e54,    252 bytes,     3 packets,     0s ago
out cc7c3466,    252 bytes,     3 packets,     0s ago
local  10.1.0.0/24
remote 10.3.0.0/24

Test PPK PSK STS

Description

Test the site-to-site VPN with PPK authentication and PSK

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces dummy dum0 address 10.1.0.1/24
set interfaces ethernet eth1 address 80.0.0.1/24
set protocols static route 10.2.0.0/24 interface dum0
set protocols static route 10.3.0.0/24 interface dum0
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set vpn ipsec auth-profile AUTH-SA global-secrets ike-psk test encrypted-secret U2FsdGVkX1/iiNmYKrF1gsZdEMPH2+rq93mSY0vyBU0=
set vpn ipsec auth-profile AUTH-SA global-secrets ppk carol@teldat.org file 'running://ppk_carol.key'
set vpn ipsec auth-profile AUTH-SA global-secrets ppk dave@teldat.org file 'running://ppk_dave.key'
set vpn ipsec auth-profile AUTH-SA local auth ike-psk id test
set vpn ipsec auth-profile AUTH-SA mirror-config false
set vpn ipsec auth-profile AUTH-SA remote auth ike-psk id %any
set vpn ipsec auth-profile AUTH-SA remote ppk id '*@teldat.org'
set vpn ipsec esp-group CHILD-SA mode tunnel
set vpn ipsec esp-group CHILD-SA proposal 1 encryption aes256gcm128
set vpn ipsec esp-group CHILD-SA proposal 1 pfs dh-group19
set vpn ipsec ike-group IKE-SA key-exchange ikev2
set vpn ipsec ike-group IKE-SA proposal 1 dh-group 19
set vpn ipsec ike-group IKE-SA proposal 1 encryption aes256gcm128
set vpn ipsec ike-group IKE-SA proposal 1 hash sha256
set vpn ipsec logging log-types any log-level 1
set vpn ipsec site-to-site peer PEER auth-profile AUTH-SA
set vpn ipsec site-to-site peer PEER connection-type respond
set vpn ipsec site-to-site peer PEER default-esp-group CHILD-SA
set vpn ipsec site-to-site peer PEER ike-group IKE-SA
set vpn ipsec site-to-site peer PEER local-address 80.0.0.1
set vpn ipsec site-to-site peer PEER tunnel 1 local prefix 10.1.0.0/24
set vpn ipsec site-to-site peer PEER tunnel 1 local-interface dum0

Step 2: Set the following configuration in DUT1 :

set interfaces dummy dum0 address 10.2.0.1/24
set interfaces ethernet eth1 address 80.0.0.2/24
set protocols static route 10.1.0.0/24 interface dum0
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set vpn ipsec auth-profile AUTH-SA global-secrets ike-psk test encrypted-secret U2FsdGVkX19vHujNqz82GULDJ8LQiBipIn2ZqWI+gwU=
set vpn ipsec auth-profile AUTH-SA global-secrets ppk carol@teldat.org file 'running://ppk_carol.key'
set vpn ipsec auth-profile AUTH-SA local auth ike-psk id test
set vpn ipsec auth-profile AUTH-SA local ppk id carol@teldat.org
set vpn ipsec auth-profile AUTH-SA mirror-config false
set vpn ipsec auth-profile AUTH-SA remote auth ike-psk id %any
set vpn ipsec esp-group CHILD-SA mode tunnel
set vpn ipsec esp-group CHILD-SA proposal 1 encryption aes256gcm128
set vpn ipsec esp-group CHILD-SA proposal 1 pfs dh-group19
set vpn ipsec ike-group IKE-SA key-exchange ikev2
set vpn ipsec ike-group IKE-SA proposal 1 dh-group 19
set vpn ipsec ike-group IKE-SA proposal 1 encryption aes256gcm128
set vpn ipsec ike-group IKE-SA proposal 1 hash sha256
set vpn ipsec logging log-types any log-level 1
set vpn ipsec site-to-site peer PEER auth-profile AUTH-SA
set vpn ipsec site-to-site peer PEER connection-type initiate
set vpn ipsec site-to-site peer PEER default-esp-group CHILD-SA
set vpn ipsec site-to-site peer PEER ike-group IKE-SA
set vpn ipsec site-to-site peer PEER local-address 80.0.0.2
set vpn ipsec site-to-site peer PEER remote-address 80.0.0.1
set vpn ipsec site-to-site peer PEER tunnel 1 local prefix 10.2.0.0/24
set vpn ipsec site-to-site peer PEER tunnel 1 local-interface dum0
set vpn ipsec site-to-site peer PEER tunnel 1 remote prefix 10.1.0.0/24

Step 3: Ping the IP address 80.0.0.2 from DUT1:

admin@DUT1$ ping 80.0.0.2 count 1 size 56 timeout 1
Show output
PING 80.0.0.2 (80.0.0.2) 56(84) bytes of data.
64 bytes from 80.0.0.2: icmp_seq=1 ttl=64 time=0.033 ms

--- 80.0.0.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.033/0.033/0.033/0.000 ms

Step 4: Ping the IP address 80.0.0.1 from DUT0:

admin@DUT0$ ping 80.0.0.1 count 1 size 56 timeout 1
Show output
PING 80.0.0.1 (80.0.0.1) 56(84) bytes of data.
64 bytes from 80.0.0.1: icmp_seq=1 ttl=64 time=0.038 ms

--- 80.0.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.038/0.038/0.038/0.000 ms

Step 5: Set the following configuration in DUT2 :

set interfaces dummy dum0 address 10.3.0.1/24
set interfaces ethernet eth1 address 80.0.0.3/24
set protocols static route 0.0.0.0/0 interface dum0
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set vpn ipsec auth-profile AUTH-SA global-secrets ike-psk test encrypted-secret U2FsdGVkX1/s9vAMoHlYv0ZH/gq31BPSaLCVzWbwtfU=
set vpn ipsec auth-profile AUTH-SA global-secrets ppk dave@teldat.org file 'running://ppk_dave.key'
set vpn ipsec auth-profile AUTH-SA local auth ike-psk id test
set vpn ipsec auth-profile AUTH-SA local ppk id dave@teldat.org
set vpn ipsec auth-profile AUTH-SA mirror-config false
set vpn ipsec auth-profile AUTH-SA remote auth ike-psk id %any
set vpn ipsec esp-group CHILD-SA mode tunnel
set vpn ipsec esp-group CHILD-SA proposal 1 encryption aes256gcm128
set vpn ipsec esp-group CHILD-SA proposal 1 pfs dh-group19
set vpn ipsec ike-group IKE-SA key-exchange ikev2
set vpn ipsec ike-group IKE-SA proposal 1 dh-group 19
set vpn ipsec ike-group IKE-SA proposal 1 encryption aes256gcm128
set vpn ipsec ike-group IKE-SA proposal 1 hash sha256
set vpn ipsec logging log-types any log-level 1
set vpn ipsec site-to-site peer PEER auth-profile AUTH-SA
set vpn ipsec site-to-site peer PEER connection-type initiate
set vpn ipsec site-to-site peer PEER default-esp-group CHILD-SA
set vpn ipsec site-to-site peer PEER ike-group IKE-SA
set vpn ipsec site-to-site peer PEER local-address 80.0.0.3
set vpn ipsec site-to-site peer PEER remote-address 80.0.0.1
set vpn ipsec site-to-site peer PEER tunnel 1 local prefix 10.3.0.0/24
set vpn ipsec site-to-site peer PEER tunnel 1 local-interface dum0
set vpn ipsec site-to-site peer PEER tunnel 1 remote prefix 10.1.0.0/24

Step 6: Ping the IP address 10.1.0.1 from DUT2:

admin@DUT2$ ping 10.1.0.1 count 1 size 56 timeout 1
Show output
PING 10.1.0.1 (10.1.0.1) 56(84) bytes of data.
64 bytes from 10.1.0.1: icmp_seq=1 ttl=64 time=10.9 ms

--- 10.1.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 10.898/10.898/10.898/0.000 ms

Step 7: Run the command vpn ipsec show sa on DUT0 and check whether the output matches the following regular expressions:

(?m)\s+.*AES_GCM_16-256\/PRF_HMAC_SHA2_256\/ECP_256\/PPK.*\s+.*\s+.*\s+.*\s+.*\s+.*\s+.*\s+.*remote\s+10.2.0.*
Show output
vpn-peer-PEER: #1, ESTABLISHED, IKEv2, cedf6a9e67a94293_i 5b1a6ce02e302452_r*
local  'test' @ 80.0.0.1[500]
remote 'test' @ 80.0.0.2[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 4s ago, rekeying in 24381s
peer-PEER-tunnel-1: #1, reqid 1, INSTALLED, TUNNEL, ESP:AES_GCM_16-256
installed 4s ago, rekeying in 3433s, expires in 3956s
in  ca6d1537,      0 bytes,     0 packets
out c6660fdc,      0 bytes,     0 packets
local  10.1.0.0/24
remote 10.2.0.0/24
vpn-peer-PEER: #2, ESTABLISHED, IKEv2, 312c6c5dd64aaf15_i 8d40f6194fa6ad91_r*
local  'test' @ 80.0.0.1[500]
remote 'test' @ 80.0.0.3[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 0s ago, rekeying in 20705s
peer-PEER-tunnel-1: #2, reqid 2, INSTALLED, TUNNEL, ESP:AES_GCM_16-256
installed 0s ago, rekeying in 3245s, expires in 3960s
in  ce4cdf1d,     84 bytes,     1 packets,     0s ago
out ca32ee98,     84 bytes,     1 packets,     0s ago
local  10.1.0.0/24
remote 10.3.0.0/24

Step 8: Ping the IP address 10.2.0.1 from DUT0:

admin@DUT0$ ping 10.2.0.1 local-address 10.1.0.1 count 1 size 56 timeout 1
Show output
PING 10.2.0.1 (10.2.0.1) from 10.1.0.1 : 56(84) bytes of data.
64 bytes from 10.2.0.1: icmp_seq=1 ttl=64 time=1.07 ms

--- 10.2.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 1.069/1.069/1.069/0.000 ms

Step 9: Ping the IP address 10.1.0.1 from DUT1:

admin@DUT1$ ping 10.1.0.1 local-address 10.2.0.1 count 1 size 56 timeout 1
Show output
PING 10.1.0.1 (10.1.0.1) from 10.2.0.1 : 56(84) bytes of data.
64 bytes from 10.1.0.1: icmp_seq=1 ttl=64 time=7.78 ms

--- 10.1.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 7.782/7.782/7.782/0.000 ms

Step 10: Run the command vpn ipsec show sa on DUT0 and check whether the output matches the following regular expressions:

(?m)\s+.*AES_GCM_16-256\/PRF_HMAC_SHA2_256\/ECP_256\/PPK.*\s+.*\s+.*\s+.*\s+.*[1-9]\d? packets.*\s+.*[1-9]\d? packets.*\s+.*\s+.*remote\s+10.2.0.*
Show output
vpn-peer-PEER: #1, ESTABLISHED, IKEv2, cedf6a9e67a94293_i 5b1a6ce02e302452_r*
local  'test' @ 80.0.0.1[500]
remote 'test' @ 80.0.0.2[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 5s ago, rekeying in 24380s
peer-PEER-tunnel-1: #1, reqid 1, INSTALLED, TUNNEL, ESP:AES_GCM_16-256
installed 5s ago, rekeying in 3432s, expires in 3955s
in  ca6d1537,    168 bytes,     2 packets,     0s ago
out c6660fdc,    168 bytes,     2 packets,     0s ago
local  10.1.0.0/24
remote 10.2.0.0/24
vpn-peer-PEER: #2, ESTABLISHED, IKEv2, 312c6c5dd64aaf15_i 8d40f6194fa6ad91_r*
local  'test' @ 80.0.0.1[500]
remote 'test' @ 80.0.0.3[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 1s ago, rekeying in 20704s
peer-PEER-tunnel-1: #2, reqid 2, INSTALLED, TUNNEL, ESP:AES_GCM_16-256
installed 1s ago, rekeying in 3244s, expires in 3959s
in  ce4cdf1d,     84 bytes,     1 packets,     1s ago
out ca32ee98,     84 bytes,     1 packets,     1s ago
local  10.1.0.0/24
remote 10.3.0.0/24

Step 11: Run the command vpn ipsec show sa on DUT0 and check whether the output matches the following regular expressions:

(?m)\s+.*AES_GCM_16-256\/PRF_HMAC_SHA2_256\/ECP_256\/PPK\s+.*\s+.*\s+.*\s+.*\s+.*\s+.*\s+.*remote\s+10.3.0.*
Show output
vpn-peer-PEER: #1, ESTABLISHED, IKEv2, cedf6a9e67a94293_i 5b1a6ce02e302452_r*
local  'test' @ 80.0.0.1[500]
remote 'test' @ 80.0.0.2[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 5s ago, rekeying in 24380s
peer-PEER-tunnel-1: #1, reqid 1, INSTALLED, TUNNEL, ESP:AES_GCM_16-256
installed 5s ago, rekeying in 3432s, expires in 3955s
in  ca6d1537,    168 bytes,     2 packets,     0s ago
out c6660fdc,    168 bytes,     2 packets,     0s ago
local  10.1.0.0/24
remote 10.2.0.0/24
vpn-peer-PEER: #2, ESTABLISHED, IKEv2, 312c6c5dd64aaf15_i 8d40f6194fa6ad91_r*
local  'test' @ 80.0.0.1[500]
remote 'test' @ 80.0.0.3[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 1s ago, rekeying in 20704s
peer-PEER-tunnel-1: #2, reqid 2, INSTALLED, TUNNEL, ESP:AES_GCM_16-256
installed 1s ago, rekeying in 3244s, expires in 3959s
in  ce4cdf1d,     84 bytes,     1 packets,     1s ago
out ca32ee98,     84 bytes,     1 packets,     1s ago
local  10.1.0.0/24
remote 10.3.0.0/24

Step 12: Ping the IP address 10.3.0.1 from DUT0:

admin@DUT0$ ping 10.3.0.1 local-address 10.1.0.1 count 1 size 56 timeout 1
Show output
PING 10.3.0.1 (10.3.0.1) from 10.1.0.1 : 56(84) bytes of data.
64 bytes from 10.3.0.1: icmp_seq=1 ttl=64 time=0.383 ms

--- 10.3.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.383/0.383/0.383/0.000 ms

Step 13: Ping the IP address 10.1.0.1 from DUT2:

admin@DUT2$ ping 10.1.0.1 local-address 10.3.0.1 count 1 size 56 timeout 1
Show output
PING 10.1.0.1 (10.1.0.1) from 10.3.0.1 : 56(84) bytes of data.
64 bytes from 10.1.0.1: icmp_seq=1 ttl=64 time=0.770 ms

--- 10.1.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.770/0.770/0.770/0.000 ms

Step 14: Run the command vpn ipsec show sa on DUT0 and check whether the output matches the following regular expressions:

(?m)\s+.*AES_GCM_16-256\/PRF_HMAC_SHA2_256\/ECP_256\/PPK\s+.*\s+.*\s+.*\s+.*[1-9]\d? packets.*\s+.*[1-9]\d? packets.*\s+.*\s+.*remote\s+10.3.0.*
Show output
vpn-peer-PEER: #1, ESTABLISHED, IKEv2, cedf6a9e67a94293_i 5b1a6ce02e302452_r*
local  'test' @ 80.0.0.1[500]
remote 'test' @ 80.0.0.2[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 12s ago, rekeying in 24373s
peer-PEER-tunnel-1: #1, reqid 1, INSTALLED, TUNNEL, ESP:AES_GCM_16-256
installed 12s ago, rekeying in 3425s, expires in 3948s
in  ca6d1537,    168 bytes,     2 packets,     7s ago
out c6660fdc,    168 bytes,     2 packets,     7s ago
local  10.1.0.0/24
remote 10.2.0.0/24
vpn-peer-PEER: #2, ESTABLISHED, IKEv2, 312c6c5dd64aaf15_i 8d40f6194fa6ad91_r*
local  'test' @ 80.0.0.1[500]
remote 'test' @ 80.0.0.3[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 8s ago, rekeying in 20697s
peer-PEER-tunnel-1: #2, reqid 2, INSTALLED, TUNNEL, ESP:AES_GCM_16-256
installed 8s ago, rekeying in 3237s, expires in 3952s
in  ce4cdf1d,    252 bytes,     3 packets,     0s ago
out ca32ee98,    252 bytes,     3 packets,     0s ago
local  10.1.0.0/24
remote 10.3.0.0/24

Test PPK RSA STS

Description

Test the site-to-site VPN with PPK authentication and RSA

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces dummy dum0 address 10.1.0.1/24
set interfaces ethernet eth1 address 80.0.0.1/24
set protocols static route 10.2.0.0/24 interface dum0
set protocols static route 10.3.0.0/24 interface dum0
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set vpn ipsec auth-profile AUTH-SA global-secrets ppk carol@teldat.org file 'running://ppk_carol.key'
set vpn ipsec auth-profile AUTH-SA global-secrets ppk dave@teldat.org file 'running://ppk_dave.key'
set vpn ipsec auth-profile AUTH-SA local ca-cert-file 'running://ca.crt'
set vpn ipsec auth-profile AUTH-SA local cert-file 'running://server.crt'
set vpn ipsec auth-profile AUTH-SA local id CN=moon.teldat.org
set vpn ipsec auth-profile AUTH-SA local key file 'running://server.priv.pem'
set vpn ipsec auth-profile AUTH-SA mirror-config false
set vpn ipsec auth-profile AUTH-SA remote ca-cert-file 'running://ca.crt'
set vpn ipsec auth-profile AUTH-SA remote ppk id '*@teldat.org'
set vpn ipsec esp-group CHILD-SA mode tunnel
set vpn ipsec esp-group CHILD-SA proposal 1 encryption aes256gcm128
set vpn ipsec esp-group CHILD-SA proposal 1 pfs dh-group19
set vpn ipsec ike-group IKE-SA key-exchange ikev2
set vpn ipsec ike-group IKE-SA proposal 1 dh-group 19
set vpn ipsec ike-group IKE-SA proposal 1 encryption aes256gcm128
set vpn ipsec ike-group IKE-SA proposal 1 hash sha256
set vpn ipsec logging log-types any log-level 1
set vpn ipsec site-to-site peer PEER auth-profile AUTH-SA
set vpn ipsec site-to-site peer PEER connection-type respond
set vpn ipsec site-to-site peer PEER default-esp-group CHILD-SA
set vpn ipsec site-to-site peer PEER ike-group IKE-SA
set vpn ipsec site-to-site peer PEER local-address 80.0.0.1
set vpn ipsec site-to-site peer PEER tunnel 1 local prefix 10.1.0.0/24
set vpn ipsec site-to-site peer PEER tunnel 1 local-interface dum0

Step 2: Set the following configuration in DUT1 :

set interfaces dummy dum0 address 10.2.0.1/24
set interfaces ethernet eth1 address 80.0.0.2/24
set protocols static route 10.1.0.0/24 interface dum0
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set vpn ipsec auth-profile AUTH-SA global-secrets ppk carol@teldat.org file 'running://ppk_carol.key'
set vpn ipsec auth-profile AUTH-SA local ca-cert-file 'running://ca.crt'
set vpn ipsec auth-profile AUTH-SA local cert-file 'running://client.crt'
set vpn ipsec auth-profile AUTH-SA local id CN=carol@teldat.org
set vpn ipsec auth-profile AUTH-SA local key file 'running://client.priv.pem'
set vpn ipsec auth-profile AUTH-SA local ppk id carol@teldat.org
set vpn ipsec auth-profile AUTH-SA mirror-config false
set vpn ipsec auth-profile AUTH-SA remote ca-cert-file 'running://ca.crt'
set vpn ipsec auth-profile AUTH-SA remote id CN=moon.teldat.org
set vpn ipsec esp-group CHILD-SA mode tunnel
set vpn ipsec esp-group CHILD-SA proposal 1 encryption aes256gcm128
set vpn ipsec esp-group CHILD-SA proposal 1 pfs dh-group19
set vpn ipsec ike-group IKE-SA key-exchange ikev2
set vpn ipsec ike-group IKE-SA proposal 1 dh-group 19
set vpn ipsec ike-group IKE-SA proposal 1 encryption aes256gcm128
set vpn ipsec ike-group IKE-SA proposal 1 hash sha256
set vpn ipsec logging log-types any log-level 1
set vpn ipsec site-to-site peer PEER auth-profile AUTH-SA
set vpn ipsec site-to-site peer PEER connection-type initiate
set vpn ipsec site-to-site peer PEER default-esp-group CHILD-SA
set vpn ipsec site-to-site peer PEER ike-group IKE-SA
set vpn ipsec site-to-site peer PEER local-address 80.0.0.2
set vpn ipsec site-to-site peer PEER remote-address 80.0.0.1
set vpn ipsec site-to-site peer PEER tunnel 1 local prefix 10.2.0.0/24
set vpn ipsec site-to-site peer PEER tunnel 1 local-interface dum0
set vpn ipsec site-to-site peer PEER tunnel 1 remote prefix 10.1.0.0/24

Step 3: Ping the IP address 80.0.0.2 from DUT1:

admin@DUT1$ ping 80.0.0.2 count 1 size 56 timeout 1
Show output
PING 80.0.0.2 (80.0.0.2) 56(84) bytes of data.
64 bytes from 80.0.0.2: icmp_seq=1 ttl=64 time=0.288 ms

--- 80.0.0.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.288/0.288/0.288/0.000 ms

Step 4: Ping the IP address 80.0.0.1 from DUT0:

admin@DUT0$ ping 80.0.0.1 count 1 size 56 timeout 1
Show output
PING 80.0.0.1 (80.0.0.1) 56(84) bytes of data.
64 bytes from 80.0.0.1: icmp_seq=1 ttl=64 time=0.038 ms

--- 80.0.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.038/0.038/0.038/0.000 ms

Step 5: Set the following configuration in DUT2 :

set interfaces dummy dum0 address 10.3.0.1/24
set interfaces ethernet eth1 address 80.0.0.3/24
set protocols static route 0.0.0.0/0 interface dum0
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set vpn ipsec auth-profile AUTH-SA global-secrets ppk dave@teldat.org file 'running://ppk_dave.key'
set vpn ipsec auth-profile AUTH-SA local ca-cert-file 'running://ca.crt'
set vpn ipsec auth-profile AUTH-SA local cert-file 'running://client.crt'
set vpn ipsec auth-profile AUTH-SA local id CN=dave@teldat.org
set vpn ipsec auth-profile AUTH-SA local key file 'running://client.priv.pem'
set vpn ipsec auth-profile AUTH-SA local ppk id dave@teldat.org
set vpn ipsec auth-profile AUTH-SA mirror-config false
set vpn ipsec auth-profile AUTH-SA remote ca-cert-file 'running://ca.crt'
set vpn ipsec auth-profile AUTH-SA remote id CN=moon.teldat.org
set vpn ipsec esp-group CHILD-SA mode tunnel
set vpn ipsec esp-group CHILD-SA proposal 1 encryption aes256gcm128
set vpn ipsec esp-group CHILD-SA proposal 1 pfs dh-group19
set vpn ipsec ike-group IKE-SA key-exchange ikev2
set vpn ipsec ike-group IKE-SA proposal 1 dh-group 19
set vpn ipsec ike-group IKE-SA proposal 1 encryption aes256gcm128
set vpn ipsec ike-group IKE-SA proposal 1 hash sha256
set vpn ipsec logging log-types any log-level 1
set vpn ipsec site-to-site peer PEER auth-profile AUTH-SA
set vpn ipsec site-to-site peer PEER connection-type initiate
set vpn ipsec site-to-site peer PEER default-esp-group CHILD-SA
set vpn ipsec site-to-site peer PEER ike-group IKE-SA
set vpn ipsec site-to-site peer PEER local-address 80.0.0.3
set vpn ipsec site-to-site peer PEER remote-address 80.0.0.1
set vpn ipsec site-to-site peer PEER tunnel 1 local prefix 10.3.0.0/24
set vpn ipsec site-to-site peer PEER tunnel 1 local-interface dum0
set vpn ipsec site-to-site peer PEER tunnel 1 remote prefix 10.1.0.0/24

Step 6: Ping the IP address 10.1.0.1 from DUT2:

admin@DUT2$ ping 10.1.0.1 count 1 size 56 timeout 1
Show output
PING 10.1.0.1 (10.1.0.1) 56(84) bytes of data.
64 bytes from 10.1.0.1: icmp_seq=1 ttl=64 time=0.552 ms

--- 10.1.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.552/0.552/0.552/0.000 ms

Step 7: Run the command vpn ipsec show sa on DUT0 and check whether the output matches the following regular expressions:

(?m)\s+.*AES_GCM_16-256\/PRF_HMAC_SHA2_256\/ECP_256\/PPK.*\s+.*\s+.*\s+.*\s+.*\s+.*\s+.*\s+.*remote\s+10.2.0.*
Show output
vpn-peer-PEER: #1, ESTABLISHED, IKEv2, 15036758181fd285_i 34a47bc730f98bfa_r*
local  'CN=moon.teldat.org' @ 80.0.0.1[500]
remote 'CN=carol@teldat.org' @ 80.0.0.2[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 4s ago, rekeying in 18106s
peer-PEER-tunnel-1: #1, reqid 1, INSTALLED, TUNNEL, ESP:AES_GCM_16-256
installed 4s ago, rekeying in 3282s, expires in 3956s
in  ce9b6ca5,      0 bytes,     0 packets
out cd4328b1,      0 bytes,     0 packets
local  10.1.0.0/24
remote 10.2.0.0/24
vpn-peer-PEER: #2, ESTABLISHED, IKEv2, 0bcfeb2a07c402b4_i ae0bfab4da772b75_r*
local  'CN=moon.teldat.org' @ 80.0.0.1[500]
remote 'CN=dave@teldat.org' @ 80.0.0.3[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 0s ago, rekeying in 13606s
peer-PEER-tunnel-1: #2, reqid 2, INSTALLED, TUNNEL, ESP:AES_GCM_16-256
installed 0s ago, rekeying in 3479s, expires in 3960s
in  cc9cd78e,     84 bytes,     1 packets,     0s ago
out c4f495bf,     84 bytes,     1 packets,     0s ago
local  10.1.0.0/24
remote 10.3.0.0/24

Step 8: Ping the IP address 10.2.0.1 from DUT0:

admin@DUT0$ ping 10.2.0.1 local-address 10.1.0.1 count 1 size 56 timeout 1
Show output
PING 10.2.0.1 (10.2.0.1) from 10.1.0.1 : 56(84) bytes of data.
64 bytes from 10.2.0.1: icmp_seq=1 ttl=64 time=0.382 ms

--- 10.2.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.382/0.382/0.382/0.000 ms

Step 9: Ping the IP address 10.1.0.1 from DUT1:

admin@DUT1$ ping 10.1.0.1 local-address 10.2.0.1 count 1 size 56 timeout 1
Show output
PING 10.1.0.1 (10.1.0.1) from 10.2.0.1 : 56(84) bytes of data.
64 bytes from 10.1.0.1: icmp_seq=1 ttl=64 time=0.867 ms

--- 10.1.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.867/0.867/0.867/0.000 ms

Step 10: Run the command vpn ipsec show sa on DUT0 and check whether the output matches the following regular expressions:

(?m)\s+.*AES_GCM_16-256\/PRF_HMAC_SHA2_256\/ECP_256\/PPK.*\s+.*\s+.*\s+.*\s+.*[1-9]\d? packets.*\s+.*[1-9]\d? packets.*\s+.*\s+.*remote\s+10.2.0.*
Show output
vpn-peer-PEER: #1, ESTABLISHED, IKEv2, 15036758181fd285_i 34a47bc730f98bfa_r*
local  'CN=moon.teldat.org' @ 80.0.0.1[500]
remote 'CN=carol@teldat.org' @ 80.0.0.2[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 4s ago, rekeying in 18106s
peer-PEER-tunnel-1: #1, reqid 1, INSTALLED, TUNNEL, ESP:AES_GCM_16-256
installed 4s ago, rekeying in 3282s, expires in 3956s
in  ce9b6ca5,    168 bytes,     2 packets,     0s ago
out cd4328b1,    168 bytes,     2 packets,     0s ago
local  10.1.0.0/24
remote 10.2.0.0/24
vpn-peer-PEER: #2, ESTABLISHED, IKEv2, 0bcfeb2a07c402b4_i ae0bfab4da772b75_r*
local  'CN=moon.teldat.org' @ 80.0.0.1[500]
remote 'CN=dave@teldat.org' @ 80.0.0.3[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 0s ago, rekeying in 13606s
peer-PEER-tunnel-1: #2, reqid 2, INSTALLED, TUNNEL, ESP:AES_GCM_16-256
installed 0s ago, rekeying in 3479s, expires in 3960s
in  cc9cd78e,     84 bytes,     1 packets,     0s ago
out c4f495bf,     84 bytes,     1 packets,     0s ago
local  10.1.0.0/24
remote 10.3.0.0/24

Step 11: Run the command vpn ipsec show sa on DUT0 and check whether the output matches the following regular expressions:

(?m)\s+.*AES_GCM_16-256\/PRF_HMAC_SHA2_256\/ECP_256\/PPK\s+.*\s+.*\s+.*\s+.*\s+.*\s+.*\s+.*remote\s+10.3.0.*
Show output
vpn-peer-PEER: #1, ESTABLISHED, IKEv2, 15036758181fd285_i 34a47bc730f98bfa_r*
local  'CN=moon.teldat.org' @ 80.0.0.1[500]
remote 'CN=carol@teldat.org' @ 80.0.0.2[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 5s ago, rekeying in 18105s
peer-PEER-tunnel-1: #1, reqid 1, INSTALLED, TUNNEL, ESP:AES_GCM_16-256
installed 5s ago, rekeying in 3281s, expires in 3955s
in  ce9b6ca5,    168 bytes,     2 packets,     1s ago
out cd4328b1,    168 bytes,     2 packets,     1s ago
local  10.1.0.0/24
remote 10.2.0.0/24
vpn-peer-PEER: #2, ESTABLISHED, IKEv2, 0bcfeb2a07c402b4_i ae0bfab4da772b75_r*
local  'CN=moon.teldat.org' @ 80.0.0.1[500]
remote 'CN=dave@teldat.org' @ 80.0.0.3[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 1s ago, rekeying in 13605s
peer-PEER-tunnel-1: #2, reqid 2, INSTALLED, TUNNEL, ESP:AES_GCM_16-256
installed 1s ago, rekeying in 3478s, expires in 3959s
in  cc9cd78e,     84 bytes,     1 packets,     1s ago
out c4f495bf,     84 bytes,     1 packets,     1s ago
local  10.1.0.0/24
remote 10.3.0.0/24

Step 12: Ping the IP address 10.3.0.1 from DUT0:

admin@DUT0$ ping 10.3.0.1 local-address 10.1.0.1 count 1 size 56 timeout 1
Show output
PING 10.3.0.1 (10.3.0.1) from 10.1.0.1 : 56(84) bytes of data.
64 bytes from 10.3.0.1: icmp_seq=1 ttl=64 time=0.302 ms

--- 10.3.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.302/0.302/0.302/0.000 ms

Step 13: Ping the IP address 10.1.0.1 from DUT2:

admin@DUT2$ ping 10.1.0.1 local-address 10.3.0.1 count 1 size 56 timeout 1
Show output
PING 10.1.0.1 (10.1.0.1) from 10.3.0.1 : 56(84) bytes of data.
64 bytes from 10.1.0.1: icmp_seq=1 ttl=64 time=0.669 ms

--- 10.1.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.669/0.669/0.669/0.000 ms

Step 14: Run the command vpn ipsec show sa on DUT0 and check whether the output matches the following regular expressions:

(?m)\s+.*AES_GCM_16-256\/PRF_HMAC_SHA2_256\/ECP_256\/PPK\s+.*\s+.*\s+.*\s+.*[1-9]\d? packets.*\s+.*[1-9]\d? packets.*\s+.*\s+.*remote\s+10.3.0.*
Show output
vpn-peer-PEER: #1, ESTABLISHED, IKEv2, 15036758181fd285_i 34a47bc730f98bfa_r*
local  'CN=moon.teldat.org' @ 80.0.0.1[500]
remote 'CN=carol@teldat.org' @ 80.0.0.2[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 11s ago, rekeying in 18099s
peer-PEER-tunnel-1: #1, reqid 1, INSTALLED, TUNNEL, ESP:AES_GCM_16-256
installed 11s ago, rekeying in 3275s, expires in 3949s
in  ce9b6ca5,    168 bytes,     2 packets,     7s ago
out cd4328b1,    168 bytes,     2 packets,     7s ago
local  10.1.0.0/24
remote 10.2.0.0/24
vpn-peer-PEER: #2, ESTABLISHED, IKEv2, 0bcfeb2a07c402b4_i ae0bfab4da772b75_r*
local  'CN=moon.teldat.org' @ 80.0.0.1[500]
remote 'CN=dave@teldat.org' @ 80.0.0.3[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 7s ago, rekeying in 13599s
peer-PEER-tunnel-1: #2, reqid 2, INSTALLED, TUNNEL, ESP:AES_GCM_16-256
installed 7s ago, rekeying in 3472s, expires in 3953s
in  cc9cd78e,    252 bytes,     3 packets,     0s ago
out c4f495bf,    252 bytes,     3 packets,     0s ago
local  10.1.0.0/24
remote 10.3.0.0/24

Test PPK PSK DMVPN

Description

Test the DMVPN scenario with PPK authentication and PSK

Scenario

Step 1: Set the following configuration in DUT1 :

set interfaces dummy dum0 address 10.2.0.1/24
set interfaces ethernet eth0 address 80.0.0.2/24
set interfaces tunnel tun0 address 10.0.0.2/32
set interfaces tunnel tun0 encapsulation gre
set interfaces tunnel tun0 local-address 80.0.0.2
set interfaces tunnel tun0 local-interface eth0
set interfaces tunnel tun0 mtu 1390
set interfaces tunnel tun0 nhrp holdtime 60
set interfaces tunnel tun0 nhrp ipsec IPSEC
set interfaces tunnel tun0 nhrp nhs 10.0.0.1 nbma 80.0.0.1
set protocols static route 10.1.0.0/24 next-hop 10.0.0.1
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set vpn ipsec auth-profile AUTH-SA global-secrets ike-psk test encrypted-secret U2FsdGVkX19QmAPpSimV5ccitQ/mdmZIES7Otp0pPwM=
set vpn ipsec auth-profile AUTH-SA global-secrets ppk carol@teldat.org file 'running://ppk_carol.key'
set vpn ipsec auth-profile AUTH-SA local auth ike-psk id test
set vpn ipsec auth-profile AUTH-SA local ppk id carol@teldat.org
set vpn ipsec auth-profile AUTH-SA mirror-config false
set vpn ipsec auth-profile AUTH-SA remote auth ike-psk id %any
set vpn ipsec dmvpn-profile IPSEC auth-profile AUTH-SA
set vpn ipsec dmvpn-profile IPSEC esp-group ESP-GROUP
set vpn ipsec dmvpn-profile IPSEC ike-group IKE-GROUP
set vpn ipsec esp-group ESP-GROUP lifetime 28800
set vpn ipsec esp-group ESP-GROUP mode transport
set vpn ipsec esp-group ESP-GROUP proposal 10 encryption aes256gcm128
set vpn ipsec esp-group ESP-GROUP proposal 10 hash sha256
set vpn ipsec esp-group ESP-GROUP proposal 10 pfs dh-group19
set vpn ipsec ike-group IKE-GROUP key-exchange ikev2
set vpn ipsec ike-group IKE-GROUP lifetime 86400
set vpn ipsec ike-group IKE-GROUP proposal 10 dh-group 19
set vpn ipsec ike-group IKE-GROUP proposal 10 encryption aes256gcm128
set vpn ipsec ike-group IKE-GROUP proposal 10 hash sha256
set vpn ipsec logging log-types any log-level 1

Step 2: Set the following configuration in DUT0 :

set interfaces dummy dum0 address 10.1.0.1/24
set interfaces ethernet eth0 address 80.0.0.1/24
set interfaces tunnel tun0 address 10.0.0.1/32
set interfaces tunnel tun0 encapsulation gre
set interfaces tunnel tun0 local-address 80.0.0.1
set interfaces tunnel tun0 local-interface eth0
set interfaces tunnel tun0 mtu 1390
set interfaces tunnel tun0 nhrp holdtime 60
set interfaces tunnel tun0 nhrp ipsec IPSEC
set interfaces tunnel tun0 nhrp transport-nat-support
set protocols static route 10.2.0.0/24 next-hop 10.0.0.2
set protocols static route 10.3.0.0/24 next-hop 10.0.0.3
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set vpn ipsec auth-profile AUTH-SA global-secrets ike-psk test encrypted-secret U2FsdGVkX19DnYCLrlTLskfHy4Z0pl1AJNvGf3ey/wk=
set vpn ipsec auth-profile AUTH-SA global-secrets ppk carol@teldat.org file 'running://ppk_carol.key'
set vpn ipsec auth-profile AUTH-SA global-secrets ppk dave@teldat.org file 'running://ppk_dave.key'
set vpn ipsec auth-profile AUTH-SA local auth ike-psk id test
set vpn ipsec auth-profile AUTH-SA mirror-config false
set vpn ipsec auth-profile AUTH-SA remote auth ike-psk id %any
set vpn ipsec auth-profile AUTH-SA remote ppk id '*@teldat.org'
set vpn ipsec dmvpn-profile IPSEC auth-profile AUTH-SA
set vpn ipsec dmvpn-profile IPSEC esp-group ESP-GROUP
set vpn ipsec dmvpn-profile IPSEC ike-group IKE-GROUP
set vpn ipsec esp-group ESP-GROUP lifetime 28800
set vpn ipsec esp-group ESP-GROUP mode transport
set vpn ipsec esp-group ESP-GROUP proposal 10 encryption aes256gcm128
set vpn ipsec esp-group ESP-GROUP proposal 10 hash sha256
set vpn ipsec esp-group ESP-GROUP proposal 10 pfs dh-group19
set vpn ipsec ike-group IKE-GROUP key-exchange ikev2
set vpn ipsec ike-group IKE-GROUP lifetime 86400
set vpn ipsec ike-group IKE-GROUP proposal 10 dh-group 19
set vpn ipsec ike-group IKE-GROUP proposal 10 encryption aes256gcm128
set vpn ipsec ike-group IKE-GROUP proposal 10 hash sha256
set vpn ipsec logging log-types any log-level 1

Step 3: Ping the IP address 10.1.0.1 from DUT1:

admin@DUT1$ ping 10.1.0.1 count 1 size 56 timeout 1
Show output
PING 10.1.0.1 (10.1.0.1) 56(84) bytes of data.
64 bytes from 10.1.0.1: icmp_seq=1 ttl=64 time=0.338 ms

--- 10.1.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.338/0.338/0.338/0.000 ms

Step 4: Ping the IP address 10.2.0.1 from DUT0:

admin@DUT0$ ping 10.2.0.1 count 1 size 56 timeout 1
Show output
PING 10.2.0.1 (10.2.0.1) 56(84) bytes of data.
64 bytes from 10.2.0.1: icmp_seq=1 ttl=64 time=0.814 ms

--- 10.2.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.814/0.814/0.814/0.000 ms

Step 5: Set the following configuration in DUT2 :

set interfaces dummy dum0 address 10.3.0.1/24
set interfaces ethernet eth0 address 80.0.0.3/24
set interfaces tunnel tun0 address 10.0.0.3/32
set interfaces tunnel tun0 encapsulation gre
set interfaces tunnel tun0 local-address 80.0.0.3
set interfaces tunnel tun0 local-interface eth0
set interfaces tunnel tun0 mtu 1390
set interfaces tunnel tun0 nhrp holdtime 60
set interfaces tunnel tun0 nhrp ipsec IPSEC
set interfaces tunnel tun0 nhrp nhs 10.0.0.1 nbma 80.0.0.1
set protocols static route 10.1.0.0/24 next-hop 10.0.0.1
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set vpn ipsec auth-profile AUTH-SA global-secrets ike-psk test encrypted-secret U2FsdGVkX184M9FA9AH77x9WjGsCnjbtEOfoWw0m33s=
set vpn ipsec auth-profile AUTH-SA global-secrets ppk carol@teldat.org file 'running://ppk_carol.key'
set vpn ipsec auth-profile AUTH-SA local auth ike-psk id test
set vpn ipsec auth-profile AUTH-SA local ppk id carol@teldat.org
set vpn ipsec auth-profile AUTH-SA mirror-config false
set vpn ipsec auth-profile AUTH-SA remote auth ike-psk id %any
set vpn ipsec dmvpn-profile IPSEC auth-profile AUTH-SA
set vpn ipsec dmvpn-profile IPSEC esp-group ESP-GROUP
set vpn ipsec dmvpn-profile IPSEC ike-group IKE-GROUP
set vpn ipsec esp-group ESP-GROUP lifetime 28800
set vpn ipsec esp-group ESP-GROUP mode transport
set vpn ipsec esp-group ESP-GROUP proposal 10 encryption aes256gcm128
set vpn ipsec esp-group ESP-GROUP proposal 10 hash sha256
set vpn ipsec esp-group ESP-GROUP proposal 10 pfs dh-group19
set vpn ipsec ike-group IKE-GROUP key-exchange ikev2
set vpn ipsec ike-group IKE-GROUP lifetime 86400
set vpn ipsec ike-group IKE-GROUP proposal 10 dh-group 19
set vpn ipsec ike-group IKE-GROUP proposal 10 encryption aes256gcm128
set vpn ipsec ike-group IKE-GROUP proposal 10 hash sha256
set vpn ipsec logging log-types any log-level 1

Step 6: Ping the IP address 10.1.0.1 from DUT2:

admin@DUT2$ ping 10.1.0.1 count 1 size 56 timeout 1
Show output
PING 10.1.0.1 (10.1.0.1) 56(84) bytes of data.
64 bytes from 10.1.0.1: icmp_seq=1 ttl=64 time=0.534 ms

--- 10.1.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.534/0.534/0.534/0.000 ms

Step 7: Run the command vpn ipsec show sa on DUT0 and check whether the output matches the following regular expressions:

(?m)\s+.*AES_GCM_16-256\/PRF_HMAC_SHA2_256\/ECP_256\/PPK.*\s+.*\s+.*\s+.*\s+.*\s+.*\s+.*\s+.*remote\s+80.0.0.*
Show output
IPSEC: #1, ESTABLISHED, IKEv2, 6fadd770715168ab_i a03ef5379a6d444f_r*
local  'test' @ 80.0.0.1[500]
remote 'test' @ 80.0.0.2[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 11s ago, rekeying in 73172s
IPSEC: #1, reqid 1, INSTALLED, TRANSPORT, ESP:AES_GCM_16-256
installed 11s ago, rekeying in 17362s, expires in 28789s
in  cdda770b,    272 bytes,     3 packets,    10s ago
out c766a732,    292 bytes,     3 packets,    10s ago
local  80.0.0.1/32[gre]
remote 80.0.0.2/32[gre]
IPSEC: #2, ESTABLISHED, IKEv2, 08266239c4f4f297_i 49d6ee19559fd30c_r*
local  'test' @ 80.0.0.1[500]
remote 'test' @ 80.0.0.3[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 0s ago, rekeying in 71182s
IPSEC: #2, reqid 2, INSTALLED, TRANSPORT, ESP:AES_GCM_16-256
installed 0s ago, rekeying in 20240s, expires in 28800s
in  cc784c29,    184 bytes,     2 packets,     0s ago
out c57bffb9,    204 bytes,     2 packets,     0s ago
local  80.0.0.1/32[gre]
remote 80.0.0.3/32[gre]

Step 8: Ping the IP address 10.2.0.1 from DUT0:

admin@DUT0$ ping 10.2.0.1 local-address 10.1.0.1 count 1 size 56 timeout 1
Show output
PING 10.2.0.1 (10.2.0.1) from 10.1.0.1 : 56(84) bytes of data.
64 bytes from 10.2.0.1: icmp_seq=1 ttl=64 time=0.772 ms

--- 10.2.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.772/0.772/0.772/0.000 ms

Step 9: Ping the IP address 10.1.0.1 from DUT1:

admin@DUT1$ ping 10.1.0.1 local-address 10.2.0.1 count 1 size 56 timeout 1
Show output
PING 10.1.0.1 (10.1.0.1) from 10.2.0.1 : 56(84) bytes of data.
64 bytes from 10.1.0.1: icmp_seq=1 ttl=64 time=0.403 ms

--- 10.1.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.403/0.403/0.403/0.000 ms

Step 10: Run the command vpn ipsec show sa on DUT0 and check whether the output matches the following regular expressions:

(?m)\s+.*AES_GCM_16-256\/PRF_HMAC_SHA2_256\/ECP_256\/PPK.*\s+.*\s+.*\s+.*\s+.*[1-9]\d? packets.*\s+.*[1-9]\d? packets.*\s+.*\s+.*remote\s+80.0.0\.2
Show output
IPSEC: #1, ESTABLISHED, IKEv2, 6fadd770715168ab_i a03ef5379a6d444f_r*
local  'test' @ 80.0.0.1[500]
remote 'test' @ 80.0.0.2[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 12s ago, rekeying in 73171s
IPSEC: #1, reqid 1, INSTALLED, TRANSPORT, ESP:AES_GCM_16-256
installed 12s ago, rekeying in 17361s, expires in 28788s
in  cdda770b,    448 bytes,     5 packets,     0s ago
out c766a732,    468 bytes,     5 packets,     0s ago
local  80.0.0.1/32[gre]
remote 80.0.0.2/32[gre]
IPSEC: #2, ESTABLISHED, IKEv2, 08266239c4f4f297_i 49d6ee19559fd30c_r*
local  'test' @ 80.0.0.1[500]
remote 'test' @ 80.0.0.3[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 1s ago, rekeying in 71181s
IPSEC: #2, reqid 2, INSTALLED, TRANSPORT, ESP:AES_GCM_16-256
installed 1s ago, rekeying in 20239s, expires in 28799s
in  cc784c29,    184 bytes,     2 packets,     1s ago
out c57bffb9,    204 bytes,     2 packets,     1s ago
local  80.0.0.1/32[gre]
remote 80.0.0.3/32[gre]

Step 11: Run the command vpn ipsec show sa on DUT0 and check whether the output matches the following regular expressions:

(?m)\s+.*AES_GCM_16-256\/PRF_HMAC_SHA2_256\/ECP_256\/PPK.*\s+.*\s+.*\s+.*\s+.*\s+.*\s+.*\s+.*remote\s+80.0.0.*
Show output
IPSEC: #1, ESTABLISHED, IKEv2, 6fadd770715168ab_i a03ef5379a6d444f_r*
local  'test' @ 80.0.0.1[500]
remote 'test' @ 80.0.0.2[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 12s ago, rekeying in 73171s
IPSEC: #1, reqid 1, INSTALLED, TRANSPORT, ESP:AES_GCM_16-256
installed 12s ago, rekeying in 17361s, expires in 28788s
in  cdda770b,    448 bytes,     5 packets,     0s ago
out c766a732,    468 bytes,     5 packets,     0s ago
local  80.0.0.1/32[gre]
remote 80.0.0.2/32[gre]
IPSEC: #2, ESTABLISHED, IKEv2, 08266239c4f4f297_i 49d6ee19559fd30c_r*
local  'test' @ 80.0.0.1[500]
remote 'test' @ 80.0.0.3[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 1s ago, rekeying in 71181s
IPSEC: #2, reqid 2, INSTALLED, TRANSPORT, ESP:AES_GCM_16-256
installed 1s ago, rekeying in 20239s, expires in 28799s
in  cc784c29,    184 bytes,     2 packets,     1s ago
out c57bffb9,    204 bytes,     2 packets,     1s ago
local  80.0.0.1/32[gre]
remote 80.0.0.3/32[gre]

Step 12: Ping the IP address 10.3.0.1 from DUT0:

admin@DUT0$ ping 10.3.0.1 local-address 10.1.0.1 count 1 size 56 timeout 1
Show output
PING 10.3.0.1 (10.3.0.1) from 10.1.0.1 : 56(84) bytes of data.
64 bytes from 10.3.0.1: icmp_seq=1 ttl=64 time=0.450 ms

--- 10.3.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.450/0.450/0.450/0.000 ms

Step 13: Ping the IP address 10.1.0.1 from DUT2:

admin@DUT2$ ping 10.1.0.1 local-address 10.3.0.1 count 1 size 56 timeout 1
Show output
PING 10.1.0.1 (10.1.0.1) from 10.3.0.1 : 56(84) bytes of data.
64 bytes from 10.1.0.1: icmp_seq=1 ttl=64 time=0.760 ms

--- 10.1.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.760/0.760/0.760/0.000 ms

Step 14: Run the command vpn ipsec show sa on DUT0 and check whether the output matches the following regular expressions:

(?m)\s+.*AES_GCM_16-256\/PRF_HMAC_SHA2_256\/ECP_256\/PPK.*\s+.*\s+.*\s+.*\s+.*[1-9]\d? packets.*\s+.*[1-9]\d? packets.*\s+.*\s+.*remote\s+80.0.0\.3.*
Show output
IPSEC: #1, ESTABLISHED, IKEv2, 6fadd770715168ab_i a03ef5379a6d444f_r*
local  'test' @ 80.0.0.1[500]
remote 'test' @ 80.0.0.2[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 12s ago, rekeying in 73171s
IPSEC: #1, reqid 1, INSTALLED, TRANSPORT, ESP:AES_GCM_16-256
installed 12s ago, rekeying in 17361s, expires in 28788s
in  cdda770b,    448 bytes,     5 packets,     0s ago
out c766a732,    468 bytes,     5 packets,     0s ago
local  80.0.0.1/32[gre]
remote 80.0.0.2/32[gre]
IPSEC: #2, ESTABLISHED, IKEv2, 08266239c4f4f297_i 49d6ee19559fd30c_r*
local  'test' @ 80.0.0.1[500]
remote 'test' @ 80.0.0.3[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 1s ago, rekeying in 71181s
IPSEC: #2, reqid 2, INSTALLED, TRANSPORT, ESP:AES_GCM_16-256
installed 1s ago, rekeying in 20239s, expires in 28799s
in  cc784c29,    360 bytes,     4 packets,     0s ago
out c57bffb9,    380 bytes,     4 packets,     0s ago
local  80.0.0.1/32[gre]
remote 80.0.0.3/32[gre]

Step 15: Run the command protocols ip show nhrp on DUT0 and expect the following output:

Show output
Iface      Type     Protocol         NBMA             Claimed NBMA     Expires(s)   Flags  Identity
tun0       local    10.0.0.1         80.0.0.1         80.0.0.1         -                   -
tun0       dynamic  10.0.0.3         80.0.0.3         80.0.0.3         59            TA    test
tun0       dynamic  10.0.0.2         80.0.0.2         80.0.0.2         48            T     test

Test PPK RSA DMVPN

Description

Test the DMVPN scenario with PPK authentication and RSA, with same ppk on both remotes.

Scenario

Step 1: Set the following configuration in DUT1 :

set interfaces dummy dum0 address 10.2.0.1/24
set interfaces ethernet eth0 address 80.0.0.2/24
set interfaces tunnel tun0 address 10.0.0.2/32
set interfaces tunnel tun0 encapsulation gre
set interfaces tunnel tun0 local-address 80.0.0.2
set interfaces tunnel tun0 local-interface eth0
set interfaces tunnel tun0 mtu 1390
set interfaces tunnel tun0 nhrp holdtime 60
set interfaces tunnel tun0 nhrp ipsec IPSEC
set interfaces tunnel tun0 nhrp nhs 10.0.0.1 nbma 80.0.0.1
set protocols static route 10.1.0.0/24 next-hop 10.0.0.1
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set vpn ipsec auth-profile AUTH-SA global-secrets ppk carol@teldat.org file 'running://ppk_carol.key'
set vpn ipsec auth-profile AUTH-SA local ca-cert-file 'running://ca.crt'
set vpn ipsec auth-profile AUTH-SA local cert-file 'running://client.crt'
set vpn ipsec auth-profile AUTH-SA local id CN=carol@teldat.org
set vpn ipsec auth-profile AUTH-SA local key file 'running://client.priv.pem'
set vpn ipsec auth-profile AUTH-SA local ppk id carol@teldat.org
set vpn ipsec auth-profile AUTH-SA mirror-config false
set vpn ipsec auth-profile AUTH-SA remote ca-cert-file 'running://ca.crt'
set vpn ipsec auth-profile AUTH-SA remote id CN=moon.teldat.org
set vpn ipsec dmvpn-profile IPSEC auth-profile AUTH-SA
set vpn ipsec dmvpn-profile IPSEC esp-group ESP-GROUP
set vpn ipsec dmvpn-profile IPSEC ike-group IKE-GROUP
set vpn ipsec esp-group ESP-GROUP lifetime 28800
set vpn ipsec esp-group ESP-GROUP mode transport
set vpn ipsec esp-group ESP-GROUP proposal 10 encryption aes256gcm128
set vpn ipsec esp-group ESP-GROUP proposal 10 hash sha256
set vpn ipsec esp-group ESP-GROUP proposal 10 pfs dh-group19
set vpn ipsec ike-group IKE-GROUP key-exchange ikev2
set vpn ipsec ike-group IKE-GROUP lifetime 86400
set vpn ipsec ike-group IKE-GROUP proposal 10 dh-group 19
set vpn ipsec ike-group IKE-GROUP proposal 10 encryption aes256gcm128
set vpn ipsec ike-group IKE-GROUP proposal 10 hash sha256
set vpn ipsec logging log-types any log-level 1

Step 2: Set the following configuration in DUT0 :

set interfaces dummy dum0 address 10.1.0.1/24
set interfaces ethernet eth0 address 80.0.0.1/24
set interfaces tunnel tun0 address 10.0.0.1/32
set interfaces tunnel tun0 encapsulation gre
set interfaces tunnel tun0 local-address 80.0.0.1
set interfaces tunnel tun0 local-interface eth0
set interfaces tunnel tun0 mtu 1390
set interfaces tunnel tun0 nhrp holdtime 60
set interfaces tunnel tun0 nhrp ipsec IPSEC
set interfaces tunnel tun0 nhrp transport-nat-support
set protocols static route 10.2.0.0/24 next-hop 10.0.0.2
set protocols static route 10.3.0.0/24 next-hop 10.0.0.3
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set vpn ipsec auth-profile AUTH-SA global-secrets ppk carol@teldat.org file 'running://ppk_carol.key'
set vpn ipsec auth-profile AUTH-SA global-secrets ppk dave@teldat.org file 'running://ppk_dave.key'
set vpn ipsec auth-profile AUTH-SA local ca-cert-file 'running://ca.crt'
set vpn ipsec auth-profile AUTH-SA local cert-file 'running://server.crt'
set vpn ipsec auth-profile AUTH-SA local id CN=moon.teldat.org
set vpn ipsec auth-profile AUTH-SA local key file 'running://server.priv.pem'
set vpn ipsec auth-profile AUTH-SA mirror-config false
set vpn ipsec auth-profile AUTH-SA remote ca-cert-file 'running://ca.crt'
set vpn ipsec auth-profile AUTH-SA remote ppk id '*@teldat.org'
set vpn ipsec dmvpn-profile IPSEC auth-profile AUTH-SA
set vpn ipsec dmvpn-profile IPSEC esp-group ESP-GROUP
set vpn ipsec dmvpn-profile IPSEC ike-group IKE-GROUP
set vpn ipsec esp-group ESP-GROUP lifetime 28800
set vpn ipsec esp-group ESP-GROUP mode transport
set vpn ipsec esp-group ESP-GROUP proposal 10 encryption aes256gcm128
set vpn ipsec esp-group ESP-GROUP proposal 10 hash sha256
set vpn ipsec esp-group ESP-GROUP proposal 10 pfs dh-group19
set vpn ipsec ike-group IKE-GROUP key-exchange ikev2
set vpn ipsec ike-group IKE-GROUP lifetime 86400
set vpn ipsec ike-group IKE-GROUP proposal 10 dh-group 19
set vpn ipsec ike-group IKE-GROUP proposal 10 encryption aes256gcm128
set vpn ipsec ike-group IKE-GROUP proposal 10 hash sha256
set vpn ipsec logging log-types any log-level 1

Step 3: Ping the IP address 10.1.0.1 from DUT1:

admin@DUT1$ ping 10.1.0.1 count 1 size 56 timeout 1
Show output
PING 10.1.0.1 (10.1.0.1) 56(84) bytes of data.
64 bytes from 10.1.0.1: icmp_seq=1 ttl=64 time=0.776 ms

--- 10.1.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.776/0.776/0.776/0.000 ms

Step 4: Ping the IP address 10.2.0.1 from DUT0:

admin@DUT0$ ping 10.2.0.1 count 1 size 56 timeout 1
Show output
PING 10.2.0.1 (10.2.0.1) 56(84) bytes of data.
64 bytes from 10.2.0.1: icmp_seq=1 ttl=64 time=0.578 ms

--- 10.2.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.578/0.578/0.578/0.000 ms

Step 5: Set the following configuration in DUT2 :

set interfaces dummy dum0 address 10.3.0.1/24
set interfaces ethernet eth0 address 80.0.0.3/24
set interfaces tunnel tun0 address 10.0.0.3/32
set interfaces tunnel tun0 encapsulation gre
set interfaces tunnel tun0 local-address 80.0.0.3
set interfaces tunnel tun0 local-interface eth0
set interfaces tunnel tun0 mtu 1390
set interfaces tunnel tun0 nhrp holdtime 60
set interfaces tunnel tun0 nhrp ipsec IPSEC
set interfaces tunnel tun0 nhrp nhs 10.0.0.1 nbma 80.0.0.1
set protocols static route 10.1.0.0/24 next-hop 10.0.0.1
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set vpn ipsec auth-profile AUTH-SA global-secrets ppk carol@teldat.org file 'running://ppk_carol.key'
set vpn ipsec auth-profile AUTH-SA local ca-cert-file 'running://ca.crt'
set vpn ipsec auth-profile AUTH-SA local cert-file 'running://client.crt'
set vpn ipsec auth-profile AUTH-SA local id CN=dave@teldat.org
set vpn ipsec auth-profile AUTH-SA local key file 'running://client.priv.pem'
set vpn ipsec auth-profile AUTH-SA local ppk id carol@teldat.org
set vpn ipsec auth-profile AUTH-SA mirror-config false
set vpn ipsec auth-profile AUTH-SA remote ca-cert-file 'running://ca.crt'
set vpn ipsec auth-profile AUTH-SA remote id CN=moon.teldat.org
set vpn ipsec dmvpn-profile IPSEC auth-profile AUTH-SA
set vpn ipsec dmvpn-profile IPSEC esp-group ESP-GROUP
set vpn ipsec dmvpn-profile IPSEC ike-group IKE-GROUP
set vpn ipsec esp-group ESP-GROUP lifetime 28800
set vpn ipsec esp-group ESP-GROUP mode transport
set vpn ipsec esp-group ESP-GROUP proposal 10 encryption aes256gcm128
set vpn ipsec esp-group ESP-GROUP proposal 10 hash sha256
set vpn ipsec esp-group ESP-GROUP proposal 10 pfs dh-group19
set vpn ipsec ike-group IKE-GROUP key-exchange ikev2
set vpn ipsec ike-group IKE-GROUP lifetime 86400
set vpn ipsec ike-group IKE-GROUP proposal 10 dh-group 19
set vpn ipsec ike-group IKE-GROUP proposal 10 encryption aes256gcm128
set vpn ipsec ike-group IKE-GROUP proposal 10 hash sha256
set vpn ipsec logging log-types any log-level 1

Step 6: Ping the IP address 10.1.0.1 from DUT2:

admin@DUT2$ ping 10.1.0.1 count 1 size 56 timeout 1
Show output
PING 10.1.0.1 (10.1.0.1) 56(84) bytes of data.
64 bytes from 10.1.0.1: icmp_seq=1 ttl=64 time=0.724 ms

--- 10.1.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.724/0.724/0.724/0.000 ms

Warning

“Certificates must include the IP address in the SAN field, otherwise the connection will fail.”

Step 7: Run the command vpn ipsec show sa on DUT0 and check whether the output matches the following regular expressions:

(?m)\s+.*AES_GCM_16-256\/PRF_HMAC_SHA2_256\/ECP_256\/PPK.*\s+.*\s+.*\s+.*\s+.*\s+.*\s+.*\s+.*remote\s+80.0.0.*
Show output
IPSEC: #2, ESTABLISHED, IKEv2, 40f39da134aa7edb_i e7412d86ecf417fb_r*
local  'CN=moon.teldat.org' @ 80.0.0.1[500]
remote 'CN=dave@teldat.org' @ 80.0.0.3[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 1s ago, rekeying in 59041s
IPSEC: #2, reqid 2, INSTALLED, TRANSPORT, ESP:AES_GCM_16-256
installed 1s ago, rekeying in 20697s, expires in 28799s
in  caef1681,    184 bytes,     2 packets,     0s ago
out cc24c212,    204 bytes,     2 packets,     0s ago
local  80.0.0.1/32[gre]
remote 80.0.0.3/32[gre]
IPSEC: #1, ESTABLISHED, IKEv2, 4dfd2ed05cf1a5c4_i ceb933d25d2d0c2f_r*
local  'CN=moon.teldat.org' @ 80.0.0.1[500]
remote 'CN=carol@teldat.org' @ 80.0.0.2[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 9s ago, rekeying in 67127s
IPSEC: #1, reqid 1, INSTALLED, TRANSPORT, ESP:AES_GCM_16-256
installed 9s ago, rekeying in 15980s, expires in 28791s
in  c6f4cc12,    368 bytes,     4 packets,     7s ago
out cb198d5a,    292 bytes,     3 packets,     7s ago
local  80.0.0.1/32[gre]
remote 80.0.0.2/32[gre]

Step 8: Ping the IP address 10.2.0.1 from DUT0:

admin@DUT0$ ping 10.2.0.1 local-address 10.1.0.1 count 1 size 56 timeout 1
Show output
PING 10.2.0.1 (10.2.0.1) from 10.1.0.1 : 56(84) bytes of data.
64 bytes from 10.2.0.1: icmp_seq=1 ttl=64 time=0.777 ms

--- 10.2.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.777/0.777/0.777/0.000 ms

Step 9: Ping the IP address 10.1.0.1 from DUT1:

admin@DUT1$ ping 10.1.0.1 local-address 10.2.0.1 count 1 size 56 timeout 1
Show output
PING 10.1.0.1 (10.1.0.1) from 10.2.0.1 : 56(84) bytes of data.
64 bytes from 10.1.0.1: icmp_seq=1 ttl=64 time=0.920 ms

--- 10.1.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.920/0.920/0.920/0.000 ms

Step 10: Run the command vpn ipsec show sa on DUT0 and check whether the output matches the following regular expressions:

(?m)\s+.*AES_GCM_16-256\/PRF_HMAC_SHA2_256\/ECP_256\/PPK.*\s+.*\s+.*\s+.*\s+.*[1-9]\d? packets.*\s+.*[1-9]\d? packets.*\s+.*\s+.*remote\s+80.0.0\.2
Show output
IPSEC: #2, ESTABLISHED, IKEv2, 40f39da134aa7edb_i e7412d86ecf417fb_r*
local  'CN=moon.teldat.org' @ 80.0.0.1[500]
remote 'CN=dave@teldat.org' @ 80.0.0.3[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 1s ago, rekeying in 59041s
IPSEC: #2, reqid 2, INSTALLED, TRANSPORT, ESP:AES_GCM_16-256
installed 1s ago, rekeying in 20697s, expires in 28799s
in  caef1681,    184 bytes,     2 packets,     0s ago
out cc24c212,    204 bytes,     2 packets,     0s ago
local  80.0.0.1/32[gre]
remote 80.0.0.3/32[gre]
IPSEC: #1, ESTABLISHED, IKEv2, 4dfd2ed05cf1a5c4_i ceb933d25d2d0c2f_r*
local  'CN=moon.teldat.org' @ 80.0.0.1[500]
remote 'CN=carol@teldat.org' @ 80.0.0.2[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 9s ago, rekeying in 67127s
IPSEC: #1, reqid 1, INSTALLED, TRANSPORT, ESP:AES_GCM_16-256
installed 9s ago, rekeying in 15980s, expires in 28791s
in  c6f4cc12,    544 bytes,     6 packets,     1s ago
out cb198d5a,    468 bytes,     5 packets,     1s ago
local  80.0.0.1/32[gre]
remote 80.0.0.2/32[gre]

Step 11: Run the command vpn ipsec show sa on DUT0 and check whether the output matches the following regular expressions:

(?m)\s+.*AES_GCM_16-256\/PRF_HMAC_SHA2_256\/ECP_256\/PPK.*\s+.*\s+.*\s+.*\s+.*\s+.*\s+.*\s+.*remote\s+80.0.0.*
Show output
IPSEC: #2, ESTABLISHED, IKEv2, 40f39da134aa7edb_i e7412d86ecf417fb_r*
local  'CN=moon.teldat.org' @ 80.0.0.1[500]
remote 'CN=dave@teldat.org' @ 80.0.0.3[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 1s ago, rekeying in 59041s
IPSEC: #2, reqid 2, INSTALLED, TRANSPORT, ESP:AES_GCM_16-256
installed 1s ago, rekeying in 20697s, expires in 28799s
in  caef1681,    184 bytes,     2 packets,     0s ago
out cc24c212,    204 bytes,     2 packets,     0s ago
local  80.0.0.1/32[gre]
remote 80.0.0.3/32[gre]
IPSEC: #1, ESTABLISHED, IKEv2, 4dfd2ed05cf1a5c4_i ceb933d25d2d0c2f_r*
local  'CN=moon.teldat.org' @ 80.0.0.1[500]
remote 'CN=carol@teldat.org' @ 80.0.0.2[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 9s ago, rekeying in 67127s
IPSEC: #1, reqid 1, INSTALLED, TRANSPORT, ESP:AES_GCM_16-256
installed 9s ago, rekeying in 15980s, expires in 28791s
in  c6f4cc12,    544 bytes,     6 packets,     1s ago
out cb198d5a,    468 bytes,     5 packets,     1s ago
local  80.0.0.1/32[gre]
remote 80.0.0.2/32[gre]

Step 12: Ping the IP address 10.3.0.1 from DUT0:

admin@DUT0$ ping 10.3.0.1 local-address 10.1.0.1 count 1 size 56 timeout 1
Show output
PING 10.3.0.1 (10.3.0.1) from 10.1.0.1 : 56(84) bytes of data.
64 bytes from 10.3.0.1: icmp_seq=1 ttl=64 time=0.800 ms

--- 10.3.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.800/0.800/0.800/0.000 ms

Step 13: Ping the IP address 10.1.0.1 from DUT2:

admin@DUT2$ ping 10.1.0.1 local-address 10.3.0.1 count 1 size 56 timeout 1
Show output
PING 10.1.0.1 (10.1.0.1) from 10.3.0.1 : 56(84) bytes of data.
64 bytes from 10.1.0.1: icmp_seq=1 ttl=64 time=0.627 ms

--- 10.1.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.627/0.627/0.627/0.000 ms

Step 14: Run the command vpn ipsec show sa on DUT0 and check whether the output matches the following regular expressions:

(?m)\s+.*AES_GCM_16-256\/PRF_HMAC_SHA2_256\/ECP_256\/PPK.*\s+.*\s+.*\s+.*\s+.*[1-9]\d? packets.*\s+.*[1-9]\d? packets.*\s+.*\s+.*remote\s+80.0.0\.3.*
Show output
IPSEC: #2, ESTABLISHED, IKEv2, 40f39da134aa7edb_i e7412d86ecf417fb_r*
local  'CN=moon.teldat.org' @ 80.0.0.1[500]
remote 'CN=dave@teldat.org' @ 80.0.0.3[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 2s ago, rekeying in 59040s
IPSEC: #2, reqid 2, INSTALLED, TRANSPORT, ESP:AES_GCM_16-256
installed 2s ago, rekeying in 20696s, expires in 28798s
in  caef1681,    360 bytes,     4 packets,     0s ago
out cc24c212,    380 bytes,     4 packets,     0s ago
local  80.0.0.1/32[gre]
remote 80.0.0.3/32[gre]
IPSEC: #1, ESTABLISHED, IKEv2, 4dfd2ed05cf1a5c4_i ceb933d25d2d0c2f_r*
local  'CN=moon.teldat.org' @ 80.0.0.1[500]
remote 'CN=carol@teldat.org' @ 80.0.0.2[500]
AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256/PPK
established 10s ago, rekeying in 67126s
IPSEC: #1, reqid 1, INSTALLED, TRANSPORT, ESP:AES_GCM_16-256
installed 10s ago, rekeying in 15979s, expires in 28790s
in  c6f4cc12,    544 bytes,     6 packets,     2s ago
out cb198d5a,    468 bytes,     5 packets,     2s ago
local  80.0.0.1/32[gre]
remote 80.0.0.2/32[gre]