Site-To-Site

This scenario shows how to configure and connect two subnets with each other through a VPN tunnel. The initiator requests an additional IP address from the responder to use as the inner IPsec tunnel address.

../../../../../../_images/sitetosite.svg

Test Site-To-Site VIP Pool And A Single Client

Description

In this scenario, DUT1 acts as initiator and requests a VIP from the DUT0 pool.

Scenario

Step 1: 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 protocols static route 10.3.0.0/24 interface eth0
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set vpn ipsec auth-profile AUTH-SA local auth encrypted-pre-shared-secret U2FsdGVkX1+7Um4KV23KvRXEys7DuO0bsQVhVnyUpTk=
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 pool POOL prefix 10.3.0.0/24
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 pool POOL
set vpn ipsec site-to-site peer PEER tunnel 1 local prefix 10.1.0.0/24

Step 2: Set the following configuration in DUT1 :

set interfaces dummy dum0
set interfaces ethernet eth0 address 80.0.0.2/24
set protocols static route 10.1.0.0/24 interface eth0
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set vpn ipsec auth-profile AUTH-SA local auth encrypted-pre-shared-secret U2FsdGVkX18aXDLOTYsvdYhX4Jw7eVd7OG0CFyCbD24=
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 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 install-vips interface dum0
set vpn ipsec site-to-site peer PEER remote-address 80.0.0.1
set vpn ipsec site-to-site peer PEER tunnel 1 remote prefix 10.1.0.0/24

Step 3: Ping IP address 80.0.0.1 from DUT1:

admin@DUT1$ 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.382 ms

--- 80.0.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 4: Ping IP address 80.0.0.2 from DUT0:

admin@DUT0$ 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.435 ms

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

Step 5: Run command interfaces dummy dum0 show at DUT1 and expect this output:

Show output
-----------------------------------------------------------------
Name           IP Address           Admin  Oper  Vrf  Description
-----------------------------------------------------------------
dum0  10.3.0.1/32                   up     up
      fe80::f8b8:3bff:fe6f:ebea/64

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

peer-PEER-tunnel-\d+.+INSTALLED
Show output
vpn-peer-PEER: #1, ESTABLISHED, IKEv2, 53696ee451c249fa_i* 6306b6c978754804_r
  local  '80.0.0.2' @ 80.0.0.2[4500] [10.3.0.1]
  remote '80.0.0.1' @ 80.0.0.1[4500]
  AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256
  established 1s ago, rekeying in 24501s
  peer-PEER-tunnel-1: #1, reqid 1, INSTALLED, TUNNEL-in-UDP, ESP:AES_GCM_16-256
    installed 1s ago, rekeying in 3362s, expires in 3959s
    in  c060c0e4,      0 bytes,     0 packets
    out cc5f4fd5,      0 bytes,     0 packets
    local  10.3.0.1/32
    remote 10.1.0.0/24

Step 7: Ping IP address 10.1.0.1 from DUT1:

admin@DUT1$ 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.496 ms

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

Step 8: Initiate a tcp connection from DUT1 to DUT0 and try to send some messages between both endpoints

admin@DUT0$ monitor test connection server 8080 tcp
admin@DUT1$ monitor test connection client 10.1.0.1 8080 tcp local-address 10.3.0.1

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

[1-9]\d? packets
Show output
vpn-peer-PEER: #1, ESTABLISHED, IKEv2, 53696ee451c249fa_i* 6306b6c978754804_r
  local  '80.0.0.2' @ 80.0.0.2[4500] [10.3.0.1]
  remote '80.0.0.1' @ 80.0.0.1[4500]
  AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256
  established 4s ago, rekeying in 24498s
  peer-PEER-tunnel-1: #1, reqid 1, INSTALLED, TUNNEL-in-UDP, ESP:AES_GCM_16-256
    installed 4s ago, rekeying in 3359s, expires in 3956s
    in  c060c0e4,    868 bytes,    14 packets,     1s ago
    out cc5f4fd5,    920 bytes,    15 packets,     1s ago
    local  10.3.0.1/32
    remote 10.1.0.0/24

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

1\s+0\s+\d+
Show output
--------------------------------------
pool  base IP   online  offline  total
--------------------------------------
POOL  10.3.0.0       1        0    254

Test Site-To-Site VIP Pool And Multiple Clients

Description

In this scenario, DUT0 install reoutes in a separate VRF called LAN.

Scenario

Step 1: 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 protocols static route 10.3.0.0/24 interface eth0
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set vpn ipsec auth-profile AUTH-SA local auth encrypted-pre-shared-secret U2FsdGVkX1/mRisUjHX/904e6hve2zZr6Cfcv19j5SI=
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 pool POOL prefix 10.3.0.0/24
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 pool POOL
set vpn ipsec site-to-site peer PEER tunnel 1 local prefix 10.1.0.0/24

Step 2: Set the following configuration in DUT1 :

set interfaces dummy dum0
set interfaces ethernet eth0 address 80.0.0.2/24
set protocols static route 10.1.0.0/24 interface eth0
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set vpn ipsec auth-profile AUTH-SA local auth encrypted-pre-shared-secret U2FsdGVkX19o4RmXLJWCtl5ZbiZOTPK7WTAqY2Wa8Nw=
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 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 install-vips interface dum0
set vpn ipsec site-to-site peer PEER remote-address 80.0.0.1
set vpn ipsec site-to-site peer PEER tunnel 1 remote prefix 10.1.0.0/24

Step 3: Ping IP address 80.0.0.1 from DUT1:

admin@DUT1$ 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=6.54 ms

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

Step 4: Ping IP address 80.0.0.2 from DUT0:

admin@DUT0$ 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=3.64 ms

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

Step 5: Set the following configuration in DUT2 :

set interfaces dummy dum0
set interfaces ethernet eth0 address 80.0.0.3/24
set protocols static route 10.1.0.0/24 interface eth0
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set vpn ipsec auth-profile AUTH-SA local auth encrypted-pre-shared-secret U2FsdGVkX19o+XdRxCMd7CEFLswvMxX0Vhc5wt8NVqA=
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 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 install-vips interface dum0
set vpn ipsec site-to-site peer PEER remote-address 80.0.0.1
set vpn ipsec site-to-site peer PEER tunnel 1 remote prefix 10.1.0.0/24

Step 6: Run command interfaces dummy dum0 show at DUT1 and expect this output:

Show output
-----------------------------------------------------------------
Name           IP Address           Admin  Oper  Vrf  Description
-----------------------------------------------------------------
dum0  10.3.0.1/32                   up     up
      fe80::54b7:84ff:fe4d:ef39/64

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

peer-PEER-tunnel-\d+.+INSTALLED
Show output
vpn-peer-PEER: #1, ESTABLISHED, IKEv2, 19d051bf87c5087c_i* 90307e25c6f1d853_r
  local  '80.0.0.2' @ 80.0.0.2[4500] [10.3.0.1]
  remote '80.0.0.1' @ 80.0.0.1[4500]
  AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256
  established 7s ago, rekeying in 17766s
  peer-PEER-tunnel-1: #1, reqid 1, INSTALLED, TUNNEL-in-UDP, ESP:AES_GCM_16-256
    installed 7s ago, rekeying in 3410s, expires in 3953s
    in  cbae0b2f,      0 bytes,     0 packets
    out c7bc0b2e,      0 bytes,     0 packets
    local  10.3.0.1/32
    remote 10.1.0.0/24

Step 8: Ping IP address 10.1.0.1 from DUT1:

admin@DUT1$ 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=3.02 ms

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

Step 9: Initiate a tcp connection from DUT1 to DUT0 and try to send some messages between both endpoints

admin@DUT0$ monitor test connection server 8080 tcp
admin@DUT1$ monitor test connection client 10.1.0.1 8080 tcp local-address 10.3.0.1

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

[1-9]\d? packets
Show output
vpn-peer-PEER: #1, ESTABLISHED, IKEv2, 19d051bf87c5087c_i* 90307e25c6f1d853_r
  local  '80.0.0.2' @ 80.0.0.2[4500] [10.3.0.1]
  remote '80.0.0.1' @ 80.0.0.1[4500]
  AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256
  established 11s ago, rekeying in 17762s
  peer-PEER-tunnel-1: #1, reqid 1, INSTALLED, TUNNEL-in-UDP, ESP:AES_GCM_16-256
    installed 11s ago, rekeying in 3406s, expires in 3949s
    in  cbae0b2f,    868 bytes,    14 packets,     1s ago
    out c7bc0b2e,    920 bytes,    15 packets,     1s ago
    local  10.3.0.1/32
    remote 10.1.0.0/24

Step 11: Run command interfaces dummy dum0 show at DUT2 and expect this output:

Show output
----------------------------------------------------------------
Name          IP Address           Admin  Oper  Vrf  Description
----------------------------------------------------------------
dum0  10.3.0.2/32                  up     up
      fe80::2036:62ff:fefb:1a8/64

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

peer-PEER-tunnel-\d+.+INSTALLED
Show output
vpn-peer-PEER: #1, ESTABLISHED, IKEv2, 10d35248fa1c5c65_i* 40cba9d346902965_r
  local  '80.0.0.3' @ 80.0.0.3[4500] [10.3.0.2]
  remote '80.0.0.1' @ 80.0.0.1[4500]
  AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256
  established 5s ago, rekeying in 17105s
  peer-PEER-tunnel-1: #1, reqid 1, INSTALLED, TUNNEL-in-UDP, ESP:AES_GCM_16-256
    installed 5s ago, rekeying in 3318s, expires in 3955s
    in  c3f21dea,      0 bytes,     0 packets
    out cc4245bf,      0 bytes,     0 packets
    local  10.3.0.2/32
    remote 10.1.0.0/24

Step 13: Ping IP address 10.1.0.1 from DUT2:

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

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

Step 14: Initiate a tcp connection from DUT2 to DUT0 and try to send some messages between both endpoints

admin@DUT0$ monitor test connection server 8080 tcp
admin@DUT2$ monitor test connection client 10.1.0.1 8080 tcp local-address 10.3.0.2

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

[1-9]\d? packets
Show output
vpn-peer-PEER: #1, ESTABLISHED, IKEv2, 10d35248fa1c5c65_i* 40cba9d346902965_r
  local  '80.0.0.3' @ 80.0.0.3[4500] [10.3.0.2]
  remote '80.0.0.1' @ 80.0.0.1[4500]
  AES_GCM_16-256/PRF_HMAC_SHA2_256/ECP_256
  established 9s ago, rekeying in 17101s
  peer-PEER-tunnel-1: #1, reqid 1, INSTALLED, TUNNEL-in-UDP, ESP:AES_GCM_16-256
    installed 9s ago, rekeying in 3314s, expires in 3951s
    in  c3f21dea,    868 bytes,    14 packets,     1s ago
    out cc4245bf,    920 bytes,    15 packets,     1s ago
    local  10.3.0.2/32
    remote 10.1.0.0/24

Step 16: Run command vpn ipsec show pool summary at DUT0 and check if output matches the following regular expressions:

2\s+0\s+\d+
Show output
--------------------------------------
pool  base IP   online  offline  total
--------------------------------------
POOL  10.3.0.0       2        0    254