Step by Step Configure Router Vyata 6.5.2
Step by Step Configure Router Vyata 6.5.2
Step by Step Configure Router Vyata 6.5.2
Step Command
Create the node for EAST and set vyatta@WEST# set vpn ipsec site‐to‐site peer 192.0.2.33
the authentication mode. authentication mode pre‐shared‐secret
Navigate to the node for the vyatta@WEST# edit vpn ipsec site‐to‐site peer 192.0.2.33
peer for easier editing. [edit vpn ipsec site‐to‐site peer 192.0.2.33]
Provide the string that will be vyatta@WEST# set authentication pre‐shared‐secret test_key_1
used to generate encryption [edit vpn ipsec site‐to‐site peer 192.0.2.33]
keys.
Specify the default ESP group for vyatta@WEST# set default‐esp‐group ESP‐1W
all tunnels. [edit vpn ipsec site‐to‐site peer 192.0.2.33]
Provide the remote subnet for vyatta@WEST# set tunnel 1 remote prefix 192.168.60.0/24
the tunnel. [edit vpn ipsec site‐to‐site peer 192.0.2.33]
View the configuration for vyatta@WEST# show vpn ipsec site‐to‐site peer
the site‐to‐site connection. 192.0.2.33 authentication
mode pre‐shared‐secret
pre‐shared‐secret test_key_1
}
default‐esp‐group ESP‐1W
ike‐group IKE‐1W
local‐address 192.0.2.1
tunnel 1 {
local {
prefix 192.168.40.0/24
}
remote {
prefix 192.168.60.0/24
}
}
View Ethernet interface eth1 vyatta@WEST# show interfaces ethernet eth1 address
address configuration. address 192.0.2.1/27
local‐address is set to this
address.
Configure EAST
This section presents the following topics:
• Enabling VPN on EAST
• Configuring an IKE Group on EAST
• Configuring an ESP Group on EAST
• Creating the Connection to WEST
This section presents the following examples:
• Example 2-5 Enabling IPsec VPN on EAST
• Example 2-6 Configuring an IKE group on EAST
• Example 2-7 Configuring an ESP group on EAST
• Example 2-8 Creating a site-to-site connection from EAST to WEST
Step Command
Enable VPN on eth0 on EAST. vyatta@EAST# set vpn ipsec ipsec‐interfaces interface eth0
Step Command
Create the configuration node vyatta@EAST# set vpn ipsec ike‐group IKE‐1E proposal 1
for proposal 1 of IKE group
IKE‐1E.
Set the encryption cipher for vyatta@EAST# set vpn ipsec ike‐group IKE‐1E proposal 1
proposal 1. encryption aes256
Set the hash algorithm for vyatta@EAST# set vpn ipsec ike‐group IKE‐1E proposal 1 hash
proposal 1. sha1
Set the encryption cipher for vyatta@EAST# set vpn ipsec ike‐group IKE‐1E proposal
proposal 2. This also creates 2 encryption aes128
the configuration node for
proposal 2 of IKE group IKE‐1E.
Set the hash algorithm for vyatta@EAST# set vpn ipsec ike‐group IKE‐1E proposal 2 hash
proposal 2. sha1
Set the lifetime for the whole vyatta@EAST# set vpn ipsec ike‐group IKE‐1E lifetime 3600
IKE group.
View the configuration for the vyatta@EAST# show vpn ipsec ike‐group IKE‐1E
IKE group. Don’t commit yet. > proposal 1 {
> encryption aes256
> hash sha1
> }
> proposal 2 {
> encryption aes128
> hash sha1
> }
> lifetime 3600
Step Command
Create the configuration node vyatta@EAST# set vpn ipsec esp‐group ESP‐1E proposal 1
for proposal 1 of ESP group
ESP‐1E.
Set the encryption cipher vyatta@EAST# set vpn ipsec esp‐group ESP‐1E proposal
for proposal 1. 1 encryption aes256
Set the encryption cipher for vyatta@EAST# set vpn ipsec esp‐group ESP‐1E proposal 2
proposal 2. This also creates the encryption 3des
configuration node for
proposal 2 of ESP group ESP‐1E.
Set the hash algorithm for vyatta@EAST# set vpn ipsec esp‐group ESP‐1E proposal 2 hash
proposal 2. md5
Set the lifetime for the whole vyatta@EAST# set vpn ipsec esp‐group ESP‐1E lifetime 1800
ESP group.
View the configuration for the vyatta@EAST# show vpn ipsec esp‐group ESP‐1E
ESP group. Don’t commit yet. > proposal 1 {
> encryption aes256
> hash sha1
> }
> proposal 2 {
> encryption 3des
> hash md5
> }
> lifetime 1800
Step Command
Create the node for WEST and vyatta@EAST# set vpn ipsec site‐to‐site peer
set the authentication mode 192.0.2.1 authentication mode pre‐shared‐secret
Navigate to the node for the vyatta@EAST# edit vpn ipsec site‐to‐site peer 192.0.2.1
peer for easier editing [edit vpn ipsec site‐to‐site peer 192.0.2.1]
Provide the string that will be vyatta@EAST# set authentication pre‐shared‐secret test_key_1
used to generate encryption [edit vpn ipsec site‐to‐site peer 192.0.2.1]
keys.
Specify the default ESP group for vyatta@EAST# set default‐esp‐group ESP‐1E
all tunnels. [edit vpn ipsec site‐to‐site peer 192.0.2.1]
Provide the remote subnet for vyatta@EAST# set tunnel 1 remote prefix 192.168.40.0/24
the tunnel. [edit vpn ipsec site‐to‐site peer 192.0.2.1]
View the configuration for the vyatta@EAST# show vpn ipsec site‐to‐site peer 192.0.2.1
site‐to‐site connection. authentication
mode pre‐shared‐secret
pre‐shared‐secret test_key_1
}
default‐esp‐group ESP‐1E
ike‐group IKE‐1E
local‐address 192.0.2.33
tunnel 1 {
local {
prefix 192.168.60.0/24
}
remote {
prefix 192.168.40.0/24
}
}
Step Command
The system warns you that the A local RSA key file already exists and will be overwritten
existing RSA key file will be <CTRL>C to exit: 8
overwritten. You have the
opportunity to exit the key
generation process by pressing
<Ctrl>+c.
The system displays the public Your new local RSA key has been generated
portion of the generated key. The public portion of the key is:
By default, this key (including
the private portion of the key) is 0sAQPEOQvukvkv1ofuO8gEKp7IFFZz4lQqMZyVMInoQKUU/T0iKSK/0NSH9
stored in Ldrr8yQUFayzKag6wM7ASXWXKyt0LS1Gn8tJVsjKGaOkFgLREtVJD3pRzoc
/config/ipsec.d/rsa‐keys/ 7DSUOBViCD6f/TloTkPepRUtW1bmYev2H7tajSO0K0
localhost.key rqu+7nlocZI0ppMAyF6CS+Wd5W1JBpVGL+EkKfyEl9RagKxRW82XJbgY4LG
77K2YDN90Wd2GgMY3kf+YJLIzFEt/xRbh2/380FMpdaUYcbY31o/5PedUut
JCK5RMwl+IJGaxrKf1OmCQfzXlkM09ijZx8kzPIlBk
5hulZrbUWjzBJdFcwFAyPM3yCuv3+ndFX00t3ZLfKu+/wX595J
vyatta@WEST>
Step Command
The system warns you that the A local RSA key file already exists and will be overwritten
existing RSA key file will be <CTRL>C to exit: 5
overwritten. You have the
opportunity to exit the key
generation process by pressing
<Ctrl>+c.
vyatta@EAST>
If you are in operational mode on WEST, enter configuration mode now and perform the
following steps:
Example 2‐11 Record EAST’s public key on WEST
Step Command
Specify a name for EAST’s public vyatta@WEST# set vpn rsa‐keys rsa‐key‐name EAST‐key rsa‐key
key and paste EAST’s public key 0sAQOVBIJL+rIkpTuwh8FPeceAF0bhgLr++W51bOAIjFb
into the configuration. RDbR8gX3Vlz6wiUbMgGwQxWlYQiqsCeacicsfZx/amlEn9PkSE4e7tqK/JQ
o40L5C7gcNM24mup1d+0WmN3zLb9Qhmq5q3pNJxEwnVbPPQeIdZMJxnb1+l
A8DPC3SIxJM/3at1/KrwqCAhX3QNFY/zNmOtFogELCeyl4+d54wQljA+3dw
FAQ4bboJ7YIDs+rqORxWd3l3I7IajT/pLrwr5eZ8OA9NtAedbMiCwxyuyUb
znxXZ8Z/MAi3xjL1pjYyWjNNiOij82QJfMOrjoXVCfcPn96ZN+Jqk+KknoV
eNDwzpoahFOseJREeXzkw3/lkMN9N1
vyatta@WEST#
Step Command
Remove the pre‐shared key. vyatta@WEST# delete vpn ipsec site‐to‐site peer
192.0.2.33 authentication pre‐shared‐secret
Provide the identifier for EAST’s vyatta@WEST# set vpn ipsec site‐to‐site peer 192.0.2.33
digital signature. authentication rsa‐key‐name EAST‐key
View the modified configuration vyatta@WEST# show vpn ipsec site‐to‐site peer 192.0.2.33
for the site‐to‐site connection. authentication {
mode rsa
rsa‐key‐name EAST‐key
}
default‐esp‐group ESP‐1W
ike‐group IKE‐1W
local‐address 192.0.2.1
tunnel 1 {
local {
prefix 192.168.40.0/24
}
remote {
prefix 192.168.60.0/24
}
}
View Ethernet interface eth1 vyatta@WEST# show interfaces ethernet eth1 address
address configuration. address 192.0.2.1/27
local‐address is set to this
address.
If you are in operational mode on EAST, enter configuration mode now and perform the
following steps:
Example 2‐13 Record WEST’s public key on EAST
Step Command
Specify a name for WEST’s vyatta@EAST# set vpn rsa‐keys rsa‐key‐name WEST‐key rsa‐key
public key and paste WEST’s 0sAQPEOQvukvkv1ofuO8gEKp7IFFZz4lQqMZyVMIno
public key into the QKUU/T0iKSK/0NSH9Ldrr8yQUFayzKag6wM7ASXWXKyt0LS1Gn8tJVsjKGa
configuration. OkFgLREtVJD3pRzoc7DSUOBViCD6f/TloTkPepRUtW1bmYev2H7tajSO0K0
rqu+7nlocZI0ppMAyF6CS+Wd5W1JBpVGL+EkKfyEl9RagKxRW82XJbgY4LG
77K2YDN90Wd2GgMY3kf+YJLIzFEt/xRbh2/380FMpdaUYcbY31o/5PedUut
JCK5RMwl+IJGaxrKf1OmCQfzXlkM09ijZx8kzPIlBk
5hulZrbUWjzBJdFcwFAyPM3yCuv3+ndFX00t3ZLfKu+/wX595J
vyatta@EAST#
Step Command
Remove the pre‐shared key. vyatta@EAST# delete vpn ipsec site‐to‐site peer 192.0.2.1
authentication pre‐shared‐secret
Change the authentication vyatta@EAST# set vpn ipsec site‐to‐site peer 192.0.2.1
mode authentication mode rsa
Provide the identifier for WEST’s vyatta@EAST# set vpn ipsec site‐to‐site peer 192.0.2.1
digital signature. authentication rsa‐key‐name WEST‐key
View the modified configuration vyatta@EAST# show vpn ipsec site‐to‐site peer 192.0.2.1
for the site‐to‐site connection. authentication {
mode rsa
rsa‐key WEST‐key
}
default‐esp‐group ESP‐1E
ike‐group IKE‐1E
local‐address 192.0.2.33
tunnel 1 {
local {
prefix 192.168.60.0/24
}
remote {
prefix 192.168.40.0/24
}
}
View Ethernet interface eth0 vyatta@EAST# show interfaces ethernet eth0 address
address configuration. address 192.0.2.33/27
local‐address is set to this
address.
In this set of examples, you modify the VPN connection configured in the basic set of
examples between WEST and EAST (“Configuring a Basic Site-to-Site Connection” on
page 20). The site-to-site connection created in that set of examples used pre-shared keys
for authentication. This set of examples modifies the configuration to use X.509
certificates for authentication.
In general, the procedure for obtaining the files required to authenticate using X.509
certificates is as follows:
1 Generate the private key and a certificate signing request (CSR) (based on the public
key). This can be accomplished using generate vpn x509 key-pair <name> (for
example, generate vpn x509 key-pair west, where west.key is the private key and
west.csr is the certificate signing request file—both created in /config/auth).
2 Send the CSR file (for example, west.csr) to the certificate authority (CA) and
receive back a server certificate (for example, west.crt), the CA certificate (for
example, ca.crt), and potentially, a certificate revocation list (CRL) file. This
procedure varies according to the CA being used.
At this point the configuration can be modified to use these files.
Step Command
Remove the pre‐shared key. vyatta@WEST# delete vpn ipsec site‐to‐site peer 192.0.2.33
authentication pre‐shared‐secret
Change the authentication vyatta@WEST# set vpn ipsec site‐to‐site peer 192.0.2.33
mode. authentication mode x509
Specify the ‘distinguished name’ vyatta@WEST# set vpn ipsec site‐to‐site peer 192.0.2.33
of the certificate for the peer. authentication remote‐id “C=US, ST=CA, O=ABC Company,
CN=east, E=root@abcco.com”
Specify the location of the vyatta@WEST# set vpn ipsec site‐to‐site peer 192.0.2.33
server certificate. authentication x509 cert‐file /config/auth/west.crt
Specify the location of the vyatta@WEST# set vpn ipsec site‐to‐site peer 192.0.2.33
server key file. authentication x509 key file /config/auth/west.key
Specify the password for the vyatta@WEST# set vpn ipsec site‐to‐site peer 192.0.2.33
server key file. authentication x509 key password testpwd‐west
View the modified configuration vyatta@WEST# show vpn ipsec site‐to‐site peer 192.0.2.33
for the site‐to‐site connection. authentication {
mode x509
remote‐id “C=US, ST=CA, O=ABC Company, CN=east,
E=root@abcco.com”
x509 {
ca‐cert‐file /config/auth/ca.crt
cert‐file /config/auth/west.crt
key {
file /config/auth/west.key
password testpwd‐west
}
}
}
default‐esp‐group ESP‐1W
ike‐group IKE‐1W
local‐address 192.0.2.1
tunnel 1 {
local {
prefix 192.168.40.0/24
}
remote {
prefix 192.168.60.0/24
}
}
View Ethernet interface eth1 vyatta@WEST# show interfaces ethernet eth1 address
address configuration. address 192.0.2.1/27
local‐address is set to this
address.
Step Command
Remove the pre‐shared key. vyatta@EAST# delete vpn ipsec site‐to‐site peer 192.0.2.1
authentication pre‐shared‐secret
Change the authentication vyatta@EAST# set vpn ipsec site‐to‐site peer 192.0.2.1
mode authentication mode x509
Specify the ‘distinguished name’ vyatta@EAST# set vpn ipsec site‐to‐site peer 192.0.2.1
of the certificate for the peer. authentication remote‐id “C=US, ST=CA, O=ABC Company,
CN=west, E=root@abcco.com”
Specify the location of the CA vyatta@EAST# set vpn ipsec site‐to‐site peer 192.0.2.1
certificate. authentication x509 ca‐cert‐file /config/auth/ca.crt
Specify the location of the vyatta@EAST# set vpn ipsec site‐to‐site peer 192.0.2.1
server certificate. authentication x509 cert‐file /config/auth/east.crt
Specify the location of the vyatta@EAST# set vpn ipsec site‐to‐site peer 192.0.2.1
server key file. authentication x509 key file /config/auth/east.key
Specify the password for the vyatta@EAST# set vpn ipsec site‐to‐site peer 192.0.2.1
server key file. authentication x509 key password testpwd‐east
View the modified configuration vyatta@EAST# show vpn ipsec site‐to‐site peer 192.0.2.1
for the site‐to‐site connection. authentication {
mode x509
remote‐id “C=US, ST=CA, O=ABC Company,
CN=west, E=root@abcco.com”
x509 {
ca‐cert‐file /config/auth/ca.crt
cert‐file /config/auth/east.crt
key {
file /config/auth/east.key
password testpwd‐east
}
}
}
default‐esp‐group ESP‐1E
ike‐group IKE‐1E
local‐address 192.0.2.33
tunnel 1 {
local {
prefix 192.168.60.0/24
}
remote {
prefix 192.168.40.0/24
}
}
View Ethernet interface eth0 vyatta@EAST# show interfaces ethernet eth0 address
address configuration. address 192.0.2.33/27
local‐address is set to this
address.
VPN Tunnel
Configure WEST
Example 2-17 defines configuration changes for a new site-to-site connection to
EAST.
• The main change is the IP address specification of the peer. This is set to 0.0.0.0 to
represent “any” IP address. Because the IP address of the peer is unknown, WEST
will not initiate connections to the peer. It will only receive connections from the
peer.
To configure this connection, perform the following steps on WEST in configuration
mode.
Example 2‐17 Creating a site‐to‐site connection to a peer with a dynamic IP address
Step Command
Delete the previous vyatta@WEST# delete vpn ipsec site‐to‐site peer 192.0.2.33
configuration.
Create the node for EAST and set vyatta@WEST# set vpn ipsec site‐to‐site peer 0.0.0.0
the authentication mode. authentication mode pre‐shared‐secret
Navigate to the node for the vyatta@WEST# edit vpn ipsec site‐to‐site peer 0.0.0.0
peer for easier editing. [edit vpn ipsec site‐to‐site peer 0.0.0.0]
Provide the string that will be vyatta@WEST# set authentication pre‐shared‐secret test_key_1
used to generate encryption [edit vpn ipsec site‐to‐site peer 0.0.0.0]
keys.
Specify the default ESP group for vyatta@WEST# set default‐esp‐group ESP‐1W
all tunnels. [edit vpn ipsec site‐to‐site peer 0.0.0.0]
Provide the remote subnet for vyatta@WEST# set tunnel 1 remote prefix 192.168.60.0/24
the tunnel. [edit vpn ipsec site‐to‐site peer 0.0.0.0]
View the configuration for the vyatta@WEST# show vpn ipsec site‐to‐site peer 0.0.0.0
site‐to‐site connection. authentication
mode pre‐shared‐secret
pre‐shared‐secret test_key_1
}
default‐esp‐group ESP‐1W
ike‐group IKE‐1W
local‐address 192.0.2.1
tunnel 1 {
local {
prefix 192.168.40.0/24
}
remote {
prefix 192.168.60.0/24
}
}
Configure EAST
The connection from EAST to WEST only requires a minor change from that configured
in the section “Configuring a Basic Site-to-Site Connection” on page 20.
• WEST retains its fixed IP, so no modification is required to the remote peer IP
address.
• EAST has a dynamic local IP, so that must change. The dhcp-interface option
specifies the DHCP client interface.
To configure this connection, perform the following steps on EAST in configuration
mode.
Example 2‐18 Specify that the local IP is dynamic.
Step Command
Remove the existing vyatta@EAST# delete vpn ipsec site‐to‐site peer 192.0.2.1
local‐address configuration so local‐address
that doesn’t conflict with the [edit]
dhcp‐interface configuration
that will be set.
Specify the DHCP client interface vyatta@EAST# set vpn ipsec site‐to‐site peer 192.0.2.1
to use for the connection. dhcp‐interface eth0
[edit]
View the configuration for vyatta@EAST# show vpn ipsec site‐to‐site peer
the site‐to‐site connection. 192.0.2.1 authentication
mode pre‐shared‐secret
pre‐shared‐secret test_key_1
}
default‐esp‐group ESP‐1E
dhcp‐interface eth0
ike‐group IKE‐1E
tunnel 1 {
local {
prefix 192.168.60.0/24
}
remote {
prefix 192.168.40.0/24
}
}
Figure 2‐3 IPsec VPN connection with dynamic IP address and dynamic DNS
VPN Tunnel
hostname:
east.company.com
Configure WEST
Example 2-19 defines configuration changes for a new site-to-site connection to
EAST.
• The main change is the IP address specification of the peer. This is set to the
hostname for EAST: “east.company.com”. This is the hostname that is configured
on EAST with the dynamic DNS provider. Because the IP address for EAST can be
resolved, WEST can either initiate IPsec connections to, or receive IPsec
connections from EAST.
• The other important change is to configure auto-update so that if EAST’s IP
address changes, the IPsec connection to EAST will be restarted automatically.
To configure this connection, perform the following steps on WEST in configuration
mode.
Example 2‐19 Creating a site‐to‐site connection to a peer with a dynamic IP address and using dynamic
DNS
Step Command
Delete the previous vyatta@WEST# delete vpn ipsec site‐to‐site peer 192.0.2.33
configuration.
Create the node for EAST and set vyatta@WEST# set vpn ipsec site‐to‐site peer east.company.com
the authentication mode. authentication mode pre‐shared‐secret
Navigate to the node for the vyatta@WEST# edit vpn ipsec site‐to‐site peer
peer for easier editing. east.company.com
[edit vpn ipsec site‐to‐site peer east.company.com]
Example 2‐19 Creating a site‐to‐site connection to a peer with a dynamic IP address and using dynamic
DNS
Provide the string that will be vyatta@WEST# set authentication pre‐shared‐secret test_key_1
used to generate encryption [edit vpn ipsec site‐to‐site peer east.company.com]
keys.
Specify the default ESP group for vyatta@WEST# set default‐esp‐group ESP‐1W
all tunnels. [edit vpn ipsec site‐to‐site peer east.company.com]
Provide the remote subnet for vyatta@WEST# set tunnel 1 remote prefix 192.168.60.0/24
the tunnel. [edit vpn ipsec site‐to‐site peer east.company.com]
View the configuration for the vyatta@WEST# show vpn ipsec site‐to‐site peer
site‐to‐site connection. east.company.com
authentication
mode pre‐shared‐secret
pre‐shared‐secret test_key_1
}
default‐esp‐group ESP‐1W
ike‐group IKE‐1W
local‐address 192.0.2.1
tunnel 1 {
local {
prefix 192.168.40.0/24
}
remote {
prefix 192.168.60.0/24
}
}
Example 2‐19 Creating a site‐to‐site connection to a peer with a dynamic IP address and using dynamic
DNS
Configure EAST
The connection from EAST to WEST only requires a minor change from that configured
in the section “Configuring a Basic Site-to-Site Connection” on page 20.
• WEST retains its fixed IP, so no modification is required to the remote peer IP
address.
• EAST has a dynamic local IP, so that must change. The dhcp-interface option
specifies the DHCP client interface.
• EAST is also configured for dynamic DNS, in this case with service provider
DynDNS. See the “Configuring Dynamic DNS” section in the Vyatta Services
Reference Guide for details on configuring a system for dynamic DNS.
To configure this connection, perform the following steps on EAST in configuration
mode.
Example 2‐20 Specify that the local IP is dynamic.
Step Command
Remove the existing vyatta@EAST# delete vpn ipsec site‐to‐site peer 192.0.2.1
local‐address configuration so local‐address
that doesn’t conflict with the [edit]
dhcp‐interface configuration
that will be set.
Specify the DHCP client interface vyatta@EAST# set vpn ipsec site‐to‐site peer
to use for the connection. 192.0.2.1 dhcp‐interface eth0
[edit]
VPN 6.5R1 v01
Vyatta