X509

These scenarios show how to establish a VPN IPsec site-to-site connection between two end-points using X.509 certificates.

../../../../_images/x509.svg

Test Local And Remote Auth With X509 Files

Description

In this scenario, both devices use pre-installed X.509 certificate files for local and remote authentication.

Scenario

Step 1: Set the following configuration in DUT1 :

set interfaces ethernet eth0 address 8.0.0.1/24
set interfaces ethernet eth1 address 9.0.0.1/24
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT2 :

set interfaces dummy dum0 address 192.168.2.1/24
set interfaces ethernet eth0 address 9.0.0.2/24
set interfaces ethernet eth1 address 10.215.168.66/24
set protocols static route 0.0.0.0/0 next-hop 9.0.0.1
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set vpn ipsec auth-profile AUTH local ca-cert-file 'running://ca.pem'
set vpn ipsec auth-profile AUTH local ca-cert-file 'running://root.pem'
set vpn ipsec auth-profile AUTH local cert-file 'running://dut2.pem'
set vpn ipsec auth-profile AUTH local key file 'running://dut2.key'
set vpn ipsec auth-profile AUTH mirror-config false
set vpn ipsec auth-profile AUTH mode x509
set vpn ipsec auth-profile AUTH remote ca-cert-file 'running://ca.pem'
set vpn ipsec auth-profile AUTH remote ca-cert-file 'running://root.pem'
set vpn ipsec esp-group ESP-POLICY lifetime 28800
set vpn ipsec esp-group ESP-POLICY proposal 1 encryption null
set vpn ipsec esp-group ESP-POLICY proposal 1 hash sha1
set vpn ipsec esp-group ESP-POLICY proposal 1 pfs dh-group15
set vpn ipsec ike-group IKE-POLICY key-exchange ikev2
set vpn ipsec ike-group IKE-POLICY lifetime 28800
set vpn ipsec ike-group IKE-POLICY proposal 1 dh-group 15
set vpn ipsec ike-group IKE-POLICY proposal 1 encryption null
set vpn ipsec ike-group IKE-POLICY proposal 1 hash sha1
set vpn ipsec logging log-types any log-level 1
set vpn ipsec site-to-site peer PEER auth-profile AUTH
set vpn ipsec site-to-site peer PEER connection-type respond
set vpn ipsec site-to-site peer PEER ike-group IKE-POLICY
set vpn ipsec site-to-site peer PEER local-address 9.0.0.2
set vpn ipsec site-to-site peer PEER remote-address 8.0.0.2
set vpn ipsec site-to-site peer PEER tunnel 1 esp-group ESP-POLICY
set vpn ipsec site-to-site peer PEER tunnel 1 local prefix 192.168.2.0/24
set vpn ipsec site-to-site peer PEER tunnel 1 remote prefix 192.168.1.0/24

Step 3: Ping IP address 9.0.0.1 from DUT2:

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

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

Step 4: Set the following configuration in DUT0 :

set interfaces dummy dum0 address 192.168.1.1/24
set interfaces ethernet eth0 address 8.0.0.2/24
set interfaces ethernet eth1 address 10.215.168.64/24
set protocols static route 0.0.0.0/0 next-hop 8.0.0.1
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set vpn ipsec auth-profile AUTH local ca-cert-file 'running://ca.pem'
set vpn ipsec auth-profile AUTH local ca-cert-file 'running://root.pem'
set vpn ipsec auth-profile AUTH local cert-file 'running://dut0.pem'
set vpn ipsec auth-profile AUTH local key file 'running://dut0.key'
set vpn ipsec auth-profile AUTH mirror-config false
set vpn ipsec auth-profile AUTH mode x509
set vpn ipsec auth-profile AUTH remote ca-cert-file 'running://ca.pem'
set vpn ipsec auth-profile AUTH remote ca-cert-file 'running://root.pem'
set vpn ipsec esp-group ESP-POLICY lifetime 28800
set vpn ipsec esp-group ESP-POLICY proposal 1 encryption null
set vpn ipsec esp-group ESP-POLICY proposal 1 hash sha1
set vpn ipsec esp-group ESP-POLICY proposal 1 pfs dh-group15
set vpn ipsec ike-group IKE-POLICY key-exchange ikev2
set vpn ipsec ike-group IKE-POLICY lifetime 28800
set vpn ipsec ike-group IKE-POLICY proposal 1 dh-group 15
set vpn ipsec ike-group IKE-POLICY proposal 1 encryption null
set vpn ipsec ike-group IKE-POLICY proposal 1 hash sha1
set vpn ipsec logging log-types any log-level 1
set vpn ipsec site-to-site peer PEER auth-profile AUTH
set vpn ipsec site-to-site peer PEER connection-type on-demand
set vpn ipsec site-to-site peer PEER ike-group IKE-POLICY
set vpn ipsec site-to-site peer PEER local-address 8.0.0.2
set vpn ipsec site-to-site peer PEER remote-address 9.0.0.2
set vpn ipsec site-to-site peer PEER tunnel 1 esp-group ESP-POLICY
set vpn ipsec site-to-site peer PEER tunnel 1 local prefix 192.168.1.0/24
set vpn ipsec site-to-site peer PEER tunnel 1 remote prefix 192.168.2.0/24

Step 5: Ping IP address 8.0.0.1 from DUT0:

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

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

Step 6: Ping IP address 192.168.2.1 from DUT0:

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

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

Step 7: Ping IP address 192.168.1.1 from DUT2:

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

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

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

vpn-peer-PEER: \#\d, ESTABLISHED, IKEv2
[1-9]\d* packets,
Show output
vpn-peer-PEER: #1, ESTABLISHED, IKEv2, 6099dd0c0dfd16b6_i* 2a48f9d979a780c2_r
  local  'C=ES, O=Teldat, CN=DUT0' @ 8.0.0.2[500]
  remote 'C=ES, O=Teldat, CN=DUT2' @ 9.0.0.2[500]
  NULL/HMAC_SHA1_96/PRF_HMAC_SHA1/MODP_3072
  established 2s ago, rekeying in 17085s
  peer-PEER-tunnel-1: #2, reqid 1, INSTALLED, TUNNEL, ESP:NULL/HMAC_SHA1_96
    installed 2s ago, rekeying in 19327s, expires in 31678s
    in  c1e8f45e,    168 bytes,     2 packets,     0s ago
    out cdb93933,    168 bytes,     2 packets,     0s ago
    local  192.168.1.0/24
    remote 192.168.2.0/24

Test Local Auth With SCEP And Remote Auth With X509 Files

Description

In this scenario, DUT0 uses SCEP for local authentication, while the remote peer is authenticated using X.509 certificate files.

Scenario

Step 1: Set the following configuration in DUT1 :

set interfaces ethernet eth0 address 8.0.0.1/24
set interfaces ethernet eth1 address 9.0.0.1/24
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT2 :

set interfaces dummy dum0 address 192.168.2.1/24
set interfaces ethernet eth0 address 9.0.0.2/24
set interfaces ethernet eth1 address 10.215.168.66/24
set protocols static route 0.0.0.0/0 next-hop 9.0.0.1
set system certificate scep csr CSR cgi-path /scep
set system certificate scep csr CSR cipher aes
set system certificate scep csr CSR distinguished-names CN=DUT2
set system certificate scep csr CSR encrypted-password U2FsdGVkX1/ka4Ia0aXxa3lKPPFoNmVUzRMhs3wCVVM=
set system certificate scep csr CSR port 8080
set system certificate scep csr CSR url 'http://10.215.168.1'
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set vpn ipsec auth-profile AUTH local ca-cert-file 'running://ca.pem'
set vpn ipsec auth-profile AUTH local ca-cert-file 'running://root.pem'
set vpn ipsec auth-profile AUTH local cert-file 'running://dut2.pem'
set vpn ipsec auth-profile AUTH local key file 'running://dut2.key'
set vpn ipsec auth-profile AUTH mirror-config false
set vpn ipsec auth-profile AUTH mode x509
set vpn ipsec auth-profile AUTH remote csr CSR
set vpn ipsec esp-group ESP-POLICY lifetime 28800
set vpn ipsec esp-group ESP-POLICY proposal 1 encryption null
set vpn ipsec esp-group ESP-POLICY proposal 1 hash sha1
set vpn ipsec esp-group ESP-POLICY proposal 1 pfs dh-group15
set vpn ipsec ike-group IKE-POLICY key-exchange ikev2
set vpn ipsec ike-group IKE-POLICY lifetime 28800
set vpn ipsec ike-group IKE-POLICY proposal 1 dh-group 15
set vpn ipsec ike-group IKE-POLICY proposal 1 encryption null
set vpn ipsec ike-group IKE-POLICY proposal 1 hash sha1
set vpn ipsec logging log-types any log-level 1
set vpn ipsec site-to-site peer PEER auth-profile AUTH
set vpn ipsec site-to-site peer PEER connection-type respond
set vpn ipsec site-to-site peer PEER ike-group IKE-POLICY
set vpn ipsec site-to-site peer PEER local-address 9.0.0.2
set vpn ipsec site-to-site peer PEER remote-address 8.0.0.2
set vpn ipsec site-to-site peer PEER tunnel 1 esp-group ESP-POLICY
set vpn ipsec site-to-site peer PEER tunnel 1 local prefix 192.168.2.0/24
set vpn ipsec site-to-site peer PEER tunnel 1 remote prefix 192.168.1.0/24

Step 3: Ping IP address 9.0.0.1 from DUT2:

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

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

Step 4: Run command pki scep show CSR at DUT2 and check if output matches the following regular expressions:

ca\s+Valid
usercert\s+Valid
Show output
-------------------------------------------------------------------------------------------------
Certificate  Status           Usage                   NotBefore                  NotAfter
-------------------------------------------------------------------------------------------------
ca           Valid   Encipherment & Signature  Apr 16 09:19:39 2025 GMT  Apr 11 09:19:39 2045 GMT
usercert     Valid   -                         Jun 24 13:40:49 2025 GMT  Jun 24 13:40:49 2026 GMT

Step 5: Set the following configuration in DUT0 :

set interfaces dummy dum0 address 192.168.1.1/24
set interfaces ethernet eth0 address 8.0.0.2/24
set interfaces ethernet eth1 address 10.215.168.64/24
set protocols static route 0.0.0.0/0 next-hop 8.0.0.1
set system certificate scep csr CSR cgi-path /scep
set system certificate scep csr CSR cipher aes
set system certificate scep csr CSR distinguished-names CN=DUT0
set system certificate scep csr CSR encrypted-password U2FsdGVkX1+eS6DNEMgZUCJajirEgBTMhvUdkKAwNXE=
set system certificate scep csr CSR port 8080
set system certificate scep csr CSR url 'http://10.215.168.1'
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set vpn ipsec auth-profile AUTH local csr CSR
set vpn ipsec auth-profile AUTH mirror-config false
set vpn ipsec auth-profile AUTH mode x509
set vpn ipsec auth-profile AUTH remote ca-cert-file 'running://ca.pem'
set vpn ipsec auth-profile AUTH remote ca-cert-file 'running://root.pem'
set vpn ipsec esp-group ESP-POLICY lifetime 28800
set vpn ipsec esp-group ESP-POLICY proposal 1 encryption null
set vpn ipsec esp-group ESP-POLICY proposal 1 hash sha1
set vpn ipsec esp-group ESP-POLICY proposal 1 pfs dh-group15
set vpn ipsec ike-group IKE-POLICY key-exchange ikev2
set vpn ipsec ike-group IKE-POLICY lifetime 28800
set vpn ipsec ike-group IKE-POLICY proposal 1 dh-group 15
set vpn ipsec ike-group IKE-POLICY proposal 1 encryption null
set vpn ipsec ike-group IKE-POLICY proposal 1 hash sha1
set vpn ipsec logging log-types any log-level 1
set vpn ipsec site-to-site peer PEER auth-profile AUTH
set vpn ipsec site-to-site peer PEER connection-type on-demand
set vpn ipsec site-to-site peer PEER ike-group IKE-POLICY
set vpn ipsec site-to-site peer PEER local-address 8.0.0.2
set vpn ipsec site-to-site peer PEER remote-address 9.0.0.2
set vpn ipsec site-to-site peer PEER tunnel 1 esp-group ESP-POLICY
set vpn ipsec site-to-site peer PEER tunnel 1 local prefix 192.168.1.0/24
set vpn ipsec site-to-site peer PEER tunnel 1 remote prefix 192.168.2.0/24

Step 6: Ping IP address 8.0.0.1 from DUT0:

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

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

Step 7: Run command pki scep show CSR at DUT0 and check if output matches the following regular expressions:

ca\s+Valid
usercert\s+Valid
Show output
-------------------------------------------------------------------------------------------------
Certificate  Status           Usage                   NotBefore                  NotAfter
-------------------------------------------------------------------------------------------------
ca           Valid   Encipherment & Signature  Apr 16 09:19:39 2025 GMT  Apr 11 09:19:39 2045 GMT
usercert     Valid   -                         Jun 24 13:41:28 2025 GMT  Jun 24 13:41:28 2026 GMT

Step 8: Ping IP address 192.168.2.1 from DUT0:

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

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

Step 9: Ping IP address 192.168.1.1 from DUT2:

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

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

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

vpn-peer-PEER: \#\d, ESTABLISHED, IKEv2
[1-9]\d* packets,
Show output
vpn-peer-PEER: #1, ESTABLISHED, IKEv2, 2c36aec26d86be40_i* 769330d488edf90c_r
  local  'CN=DUT0' @ 8.0.0.2[500]
  remote 'C=ES, O=Teldat, CN=DUT2' @ 9.0.0.2[500]
  NULL/HMAC_SHA1_96/PRF_HMAC_SHA1/MODP_3072
  established 2s ago, rekeying in 23197s
  peer-PEER-tunnel-1: #2, reqid 1, INSTALLED, TUNNEL, ESP:NULL/HMAC_SHA1_96
    installed 2s ago, rekeying in 23244s, expires in 31678s
    in  c8420e33,    168 bytes,     2 packets,     0s ago
    out c3138bff,    168 bytes,     2 packets,     0s ago
    local  192.168.1.0/24
    remote 192.168.2.0/24

Test Local Auth With X509 Files And Remote Auth With SCEP

Description

In this scenario, DUT0 uses SCEP for remote authentication, while local authentication relies on X.509 certificate files.

Scenario

Step 1: Set the following configuration in DUT1 :

set interfaces ethernet eth0 address 8.0.0.1/24
set interfaces ethernet eth1 address 9.0.0.1/24
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT2 :

set interfaces dummy dum0 address 192.168.2.1/24
set interfaces ethernet eth0 address 9.0.0.2/24
set interfaces ethernet eth1 address 10.215.168.66/24
set protocols static route 0.0.0.0/0 next-hop 9.0.0.1
set system certificate scep csr CSR cgi-path /scep
set system certificate scep csr CSR cipher aes
set system certificate scep csr CSR distinguished-names CN=DUT2
set system certificate scep csr CSR encrypted-password U2FsdGVkX18bfSPtREWOLV9kRj/cpNXiK/t8fUChLoE=
set system certificate scep csr CSR port 8080
set system certificate scep csr CSR url 'http://10.215.168.1'
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set vpn ipsec auth-profile AUTH local csr CSR
set vpn ipsec auth-profile AUTH mirror-config false
set vpn ipsec auth-profile AUTH mode x509
set vpn ipsec auth-profile AUTH remote ca-cert-file 'running://ca.pem'
set vpn ipsec auth-profile AUTH remote ca-cert-file 'running://root.pem'
set vpn ipsec esp-group ESP-POLICY lifetime 28800
set vpn ipsec esp-group ESP-POLICY proposal 1 encryption null
set vpn ipsec esp-group ESP-POLICY proposal 1 hash sha1
set vpn ipsec esp-group ESP-POLICY proposal 1 pfs dh-group15
set vpn ipsec ike-group IKE-POLICY key-exchange ikev2
set vpn ipsec ike-group IKE-POLICY lifetime 28800
set vpn ipsec ike-group IKE-POLICY proposal 1 dh-group 15
set vpn ipsec ike-group IKE-POLICY proposal 1 encryption null
set vpn ipsec ike-group IKE-POLICY proposal 1 hash sha1
set vpn ipsec logging log-types any log-level 1
set vpn ipsec site-to-site peer PEER auth-profile AUTH
set vpn ipsec site-to-site peer PEER connection-type respond
set vpn ipsec site-to-site peer PEER ike-group IKE-POLICY
set vpn ipsec site-to-site peer PEER local-address 9.0.0.2
set vpn ipsec site-to-site peer PEER remote-address 8.0.0.2
set vpn ipsec site-to-site peer PEER tunnel 1 esp-group ESP-POLICY
set vpn ipsec site-to-site peer PEER tunnel 1 local prefix 192.168.2.0/24
set vpn ipsec site-to-site peer PEER tunnel 1 remote prefix 192.168.1.0/24

Step 3: Ping IP address 9.0.0.1 from DUT2:

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

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

Step 4: Run command pki scep show CSR at DUT2 and check if output matches the following regular expressions:

ca\s+Valid
usercert\s+Valid
Show output
-------------------------------------------------------------------------------------------------
Certificate  Status           Usage                   NotBefore                  NotAfter
-------------------------------------------------------------------------------------------------
ca           Valid   Encipherment & Signature  Apr 16 09:19:39 2025 GMT  Apr 11 09:19:39 2045 GMT
usercert     Valid   -                         Jun 24 13:42:16 2025 GMT  Jun 24 13:42:16 2026 GMT

Step 5: Set the following configuration in DUT0 :

set interfaces dummy dum0 address 192.168.1.1/24
set interfaces ethernet eth0 address 8.0.0.2/24
set interfaces ethernet eth1 address 10.215.168.64/24
set protocols static route 0.0.0.0/0 next-hop 8.0.0.1
set system certificate scep csr CSR cgi-path /scep
set system certificate scep csr CSR cipher aes
set system certificate scep csr CSR distinguished-names CN=DUT0
set system certificate scep csr CSR encrypted-password U2FsdGVkX18xKuVujf3dKJHiIOso8J+VGQX5Oh9Aq88=
set system certificate scep csr CSR port 8080
set system certificate scep csr CSR url 'http://10.215.168.1'
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set vpn ipsec auth-profile AUTH local ca-cert-file 'running://ca.pem'
set vpn ipsec auth-profile AUTH local ca-cert-file 'running://root.pem'
set vpn ipsec auth-profile AUTH local cert-file 'running://dut0.pem'
set vpn ipsec auth-profile AUTH local key file 'running://dut0.key'
set vpn ipsec auth-profile AUTH mirror-config false
set vpn ipsec auth-profile AUTH mode x509
set vpn ipsec auth-profile AUTH remote csr CSR
set vpn ipsec esp-group ESP-POLICY lifetime 28800
set vpn ipsec esp-group ESP-POLICY proposal 1 encryption null
set vpn ipsec esp-group ESP-POLICY proposal 1 hash sha1
set vpn ipsec esp-group ESP-POLICY proposal 1 pfs dh-group15
set vpn ipsec ike-group IKE-POLICY key-exchange ikev2
set vpn ipsec ike-group IKE-POLICY lifetime 28800
set vpn ipsec ike-group IKE-POLICY proposal 1 dh-group 15
set vpn ipsec ike-group IKE-POLICY proposal 1 encryption null
set vpn ipsec ike-group IKE-POLICY proposal 1 hash sha1
set vpn ipsec logging log-types any log-level 1
set vpn ipsec site-to-site peer PEER auth-profile AUTH
set vpn ipsec site-to-site peer PEER connection-type on-demand
set vpn ipsec site-to-site peer PEER ike-group IKE-POLICY
set vpn ipsec site-to-site peer PEER local-address 8.0.0.2
set vpn ipsec site-to-site peer PEER remote-address 9.0.0.2
set vpn ipsec site-to-site peer PEER tunnel 1 esp-group ESP-POLICY
set vpn ipsec site-to-site peer PEER tunnel 1 local prefix 192.168.1.0/24
set vpn ipsec site-to-site peer PEER tunnel 1 remote prefix 192.168.2.0/24

Step 6: Ping IP address 8.0.0.1 from DUT0:

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

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

Step 7: Run command pki scep show CSR at DUT0 and check if output matches the following regular expressions:

ca\s+Valid
usercert\s+Valid
Show output
-------------------------------------------------------------------------------------------------
Certificate  Status           Usage                   NotBefore                  NotAfter
-------------------------------------------------------------------------------------------------
ca           Valid   Encipherment & Signature  Apr 16 09:19:39 2025 GMT  Apr 11 09:19:39 2045 GMT
usercert     Valid   -                         Jun 24 13:42:55 2025 GMT  Jun 24 13:42:55 2026 GMT

Step 8: Ping IP address 192.168.2.1 from DUT0:

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

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

Step 9: Ping IP address 192.168.1.1 from DUT2:

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

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

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

vpn-peer-PEER: \#\d, ESTABLISHED, IKEv2
[1-9]\d* packets,
Show output
vpn-peer-PEER: #1, ESTABLISHED, IKEv2, a2efe89eab2b6c16_i* 4736bcc390413b12_r
  local  'C=ES, O=Teldat, CN=DUT0' @ 8.0.0.2[500]
  remote 'CN=DUT2' @ 9.0.0.2[500]
  NULL/HMAC_SHA1_96/PRF_HMAC_SHA1/MODP_3072
  established 2s ago, rekeying in 26263s
  peer-PEER-tunnel-1: #2, reqid 1, INSTALLED, TUNNEL, ESP:NULL/HMAC_SHA1_96
    installed 2s ago, rekeying in 25776s, expires in 31678s
    in  ce256b7c,    168 bytes,     2 packets,     0s ago
    out c40cd7f3,    168 bytes,     2 packets,     0s ago
    local  192.168.1.0/24
    remote 192.168.2.0/24

Test Local And Remote Auth With SCEP

Description

In this scenario, both devices use SCEP for local and remote authentication.

Scenario

Step 1: Set the following configuration in DUT1 :

set interfaces ethernet eth0 address 8.0.0.1/24
set interfaces ethernet eth1 address 9.0.0.1/24
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT2 :

set interfaces dummy dum0 address 192.168.2.1/24
set interfaces ethernet eth0 address 9.0.0.2/24
set interfaces ethernet eth1 address 10.215.168.66/24
set protocols static route 0.0.0.0/0 next-hop 9.0.0.1
set system certificate scep csr CSR cgi-path /scep
set system certificate scep csr CSR cipher aes
set system certificate scep csr CSR distinguished-names CN=DUT2
set system certificate scep csr CSR encrypted-password U2FsdGVkX19Hdmkf5ZlQ9EL8BJ42epWCUql0o6fDpH8=
set system certificate scep csr CSR port 8080
set system certificate scep csr CSR url 'http://10.215.168.1'
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set vpn ipsec auth-profile AUTH local csr CSR
set vpn ipsec auth-profile AUTH mirror-config false
set vpn ipsec auth-profile AUTH mode x509
set vpn ipsec auth-profile AUTH remote csr CSR
set vpn ipsec esp-group ESP-POLICY lifetime 28800
set vpn ipsec esp-group ESP-POLICY proposal 1 encryption null
set vpn ipsec esp-group ESP-POLICY proposal 1 hash sha1
set vpn ipsec esp-group ESP-POLICY proposal 1 pfs dh-group15
set vpn ipsec ike-group IKE-POLICY key-exchange ikev2
set vpn ipsec ike-group IKE-POLICY lifetime 28800
set vpn ipsec ike-group IKE-POLICY proposal 1 dh-group 15
set vpn ipsec ike-group IKE-POLICY proposal 1 encryption null
set vpn ipsec ike-group IKE-POLICY proposal 1 hash sha1
set vpn ipsec logging log-types any log-level 1
set vpn ipsec site-to-site peer PEER auth-profile AUTH
set vpn ipsec site-to-site peer PEER connection-type respond
set vpn ipsec site-to-site peer PEER ike-group IKE-POLICY
set vpn ipsec site-to-site peer PEER local-address 9.0.0.2
set vpn ipsec site-to-site peer PEER remote-address 8.0.0.2
set vpn ipsec site-to-site peer PEER tunnel 1 esp-group ESP-POLICY
set vpn ipsec site-to-site peer PEER tunnel 1 local prefix 192.168.2.0/24
set vpn ipsec site-to-site peer PEER tunnel 1 remote prefix 192.168.1.0/24

Step 3: Ping IP address 9.0.0.1 from DUT2:

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

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

Step 4: Run command pki scep show CSR at DUT2 and check if output matches the following regular expressions:

ca\s+Valid
usercert\s+Valid
Show output
-------------------------------------------------------------------------------------------------
Certificate  Status           Usage                   NotBefore                  NotAfter
-------------------------------------------------------------------------------------------------
ca           Valid   Encipherment & Signature  Apr 16 09:19:39 2025 GMT  Apr 11 09:19:39 2045 GMT
usercert     Valid   -                         Jun 24 13:43:42 2025 GMT  Jun 24 13:43:42 2026 GMT

Step 5: Set the following configuration in DUT0 :

set interfaces dummy dum0 address 192.168.1.1/24
set interfaces ethernet eth0 address 8.0.0.2/24
set interfaces ethernet eth1 address 10.215.168.64/24
set protocols static route 0.0.0.0/0 next-hop 8.0.0.1
set system certificate scep csr CSR cgi-path /scep
set system certificate scep csr CSR cipher aes
set system certificate scep csr CSR distinguished-names CN=DUT0
set system certificate scep csr CSR encrypted-password U2FsdGVkX1+Yzb3qLSc9QqLDi+wCYrVJpT8Jn31WO98=
set system certificate scep csr CSR port 8080
set system certificate scep csr CSR url 'http://10.215.168.1'
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set vpn ipsec auth-profile AUTH local csr CSR
set vpn ipsec auth-profile AUTH mirror-config false
set vpn ipsec auth-profile AUTH mode x509
set vpn ipsec auth-profile AUTH remote csr CSR
set vpn ipsec esp-group ESP-POLICY lifetime 28800
set vpn ipsec esp-group ESP-POLICY proposal 1 encryption null
set vpn ipsec esp-group ESP-POLICY proposal 1 hash sha1
set vpn ipsec esp-group ESP-POLICY proposal 1 pfs dh-group15
set vpn ipsec ike-group IKE-POLICY key-exchange ikev2
set vpn ipsec ike-group IKE-POLICY lifetime 28800
set vpn ipsec ike-group IKE-POLICY proposal 1 dh-group 15
set vpn ipsec ike-group IKE-POLICY proposal 1 encryption null
set vpn ipsec ike-group IKE-POLICY proposal 1 hash sha1
set vpn ipsec logging log-types any log-level 1
set vpn ipsec site-to-site peer PEER auth-profile AUTH
set vpn ipsec site-to-site peer PEER connection-type on-demand
set vpn ipsec site-to-site peer PEER ike-group IKE-POLICY
set vpn ipsec site-to-site peer PEER local-address 8.0.0.2
set vpn ipsec site-to-site peer PEER remote-address 9.0.0.2
set vpn ipsec site-to-site peer PEER tunnel 1 esp-group ESP-POLICY
set vpn ipsec site-to-site peer PEER tunnel 1 local prefix 192.168.1.0/24
set vpn ipsec site-to-site peer PEER tunnel 1 remote prefix 192.168.2.0/24

Step 6: Ping IP address 8.0.0.1 from DUT0:

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

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

Step 7: Run command pki scep show CSR at DUT0 and check if output matches the following regular expressions:

ca\s+Valid
usercert\s+Valid
Show output
-------------------------------------------------------------------------------------------------
Certificate  Status           Usage                   NotBefore                  NotAfter
-------------------------------------------------------------------------------------------------
ca           Valid   Encipherment & Signature  Apr 16 09:19:39 2025 GMT  Apr 11 09:19:39 2045 GMT
usercert     Valid   -                         Jun 24 13:44:21 2025 GMT  Jun 24 13:44:21 2026 GMT

Step 8: Ping IP address 192.168.2.1 from DUT0:

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

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

Step 9: Ping IP address 192.168.1.1 from DUT2:

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

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

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

vpn-peer-PEER: \#\d, ESTABLISHED, IKEv2
[1-9]\d* packets,
Show output
vpn-peer-PEER: #1, ESTABLISHED, IKEv2, a6dbd98bae49f7a8_i* 4394d7921f717d3e_r
  local  'CN=DUT0' @ 8.0.0.2[500]
  remote 'CN=DUT2' @ 9.0.0.2[500]
  NULL/HMAC_SHA1_96/PRF_HMAC_SHA1/MODP_3072
  established 2s ago, rekeying in 22298s
  peer-PEER-tunnel-1: #2, reqid 1, INSTALLED, TUNNEL, ESP:NULL/HMAC_SHA1_96
    installed 2s ago, rekeying in 21604s, expires in 31678s
    in  cb624302,    168 bytes,     2 packets,     0s ago
    out c5fa9685,    168 bytes,     2 packets,     0s ago
    local  192.168.1.0/24
    remote 192.168.2.0/24