Step by Step Configure Router Vyata 6.5.19
Step by Step Configure Router Vyata 6.5.19
3 When the two endpoints want to establish the VPN tunnel, the OpenVPN process on
the one endpoint authenticates the other endpoint. Authentication is based on the
assumption that the pre-shared secret is known only to the other endpoint; that is,
authentication is based on the assumption that if any host knows the shared secret,
that host must be the other endpoint.
4 Once the endpoints are authenticated, the OpenVPN process on each side derives a
set of keys from the pre-shared secret. These keys are used for two purposes:
— Some are used in an encryption algorithm to encrypt the tunnel data. This
provides data confidentiality.
— The others are used in a message authentication code (MAC) that uses a hash
algorithm with the keys on the tunnel data. This provides data integrity.
TLS
Transport Layer Security (TLS) is a cryptographic protocol that uses public key
cryptography and does not require the two endpoints to have a pre-shared secret.
OpenVPN uses TLS with X.509 certificates, and requires public key infrastructure (PKI)
to generate the certificates. (For a brief overview of X.509 certificates, please see
“Remote VPN Access Using L2TP/IPsec with X.509 Certificates” on page 253.) When
TLS is used, OpenVPN works as follows:
1 Using PKI, the adminstrator generates a certificate and the associated files for each
endpoint. All certificates are “signed” by the certificate authority (CA) of the PKI.
The certificate for an endpoint contains many pieces of information, one of which is
the endpoint’s name, which is stored in the Common Name field of the certificate.
2 The adminstrator transfers each certificate and the associated files to the
corresponding endpoint using a pre-established, secure channel (for example,
SCP).
3 When two endpoints want to establish the VPN tunnel, one takes a passive role
while the other endpoint must take an active role and initiate the TLS session with
the passive endpoint.
4 Once the active endpoint initiates the TLS session, the two sides authenticate one
another using their public/private key pairs and the CA’s public key, which is known
to both endpoints.
5 After the two endpoints have authenticated each other, they establish a shared secret
using public key cryptography. Each endpoint then derives a set of keys for the
session. As for the pre-shared secret mechanism, these keys are then used for
encryption and MAC on the tunnel data to provide data confidentiality and integrity.
However, unlike the pre-shared secret mechanism, these keys are only used for the
one session, and for this reason they are called “session keys.”
Certificate generation and distribution using PKI involves numerous complex
security issues, which are outside the scope of this document.
Site‐to‐Site Operation
Figure 5-1 illustrates a simple site-to-site VPN scenario. This scenario could
represent, for example, a connection between a branch office and a data center.
OpenVPN tunnel
192.168.100.0/24 192.168.101.0/24
At each of the two VPN tunnel endpoints, the OpenVPN process creates a routable
“tunnel interface” and establishes a secure tunnel with the other endpoint. Subsequently,
the two interfaces appear to be on the same network, although packets flowing between
these two interfaces are actually processed and sent through the secure tunnel by the
OpenVPN process.
Note that there are two relevant IP addresses on each endpoint:
• The tunnel IP address: This address is the virtual IP address (VIP) on each end of the
tunnel. The tunnel IP addresses at each end of the tunnel must be on the same subnet.
In the example in Figure 5-1, the tunnel IP addresses of the two endpoints are
192.168.200.1 and 192.168.200.2.
• The physical IP address: This is the IP address configured for the physical
network interface over which the VPN tunnel is established. In the example
above, the physical IP addresses of the two endpoints are 12.34.56.78 and
87.65.43.21.
In most scenarios, the VPN tunnel is used to transport traffic from different private
subnets across the wide area network (WAN). In the example above, the private subnets
192.168.100.0/24 and 192.168.101.0/24 are each “behind” a VPN tunnel endpoint.
Therefore, on each endpoint, you must add a static route that directs traffic to and from
the remote private subnet through the tunnel interface.
In site-to-site mode, a single host can establish multiple OpenVPN tunnels, each of
which may be to distinct sites. Even if all tunnels originate from a single physical
interface, each tunnel is represented by a different tunnel interface IP address and
operates independently.
OpenVPN tunnel
One major difference between site-to-site mode and client-server mode is that in client-
server mode, all the VPN tunnels on the server side terminate at a single tunnel interface.
Having a single termination point eliminates the need to set up separate tunnel interface
IP addresses for each VPN tunnel. This is more convenient and operationally simpler for
a remote access setup.
Another difference is that in client-server mode, the server-side OpenVPN process
dynamically allocates all tunnel IP addresses from a configured subnet
(192.168.200.0/24 in the example) instead of using fixed tunnel IP addresses for tunnel
endpoints. Thus, when the OpenVPN process is started on the server, it creates the
tunnel interface and assigns it an IP address from the subnet to the interface (for
example, 192.168.200.1). Then, when a client establishes a VPN tunnel with the server,
the server-side OpenVPN process also allocates the client an IP address from the same
subnet (for example, 192.168.200.4) and the tunnel interface on the client adopts this
address.
OpenVPN Access Server is a server that authenticates remote client access requests
(either locally or via an authentication server) and provides OpenVPN tunnel
configuration information to the requesting client. It can also provide OpenVPN
client software if the client requires it, though this is not required for Vyatta clients. The
configuration information allows the client to then establish an OpenVPN tunnel with an
OpenVPN server with minimal configuration on the client side.
The sequence of events is as follows:
1 An administrator configures an OpenVPN Access Server for Vyatta client access
and, potentially, configures a separate authentication server and OpenVPN server.
The Vyatta client only requires configuration information from the server. It does not
require client software.
NOTE It is possible for the OpenVPN Access Server to act as the access server, the
authentication server, and the OpenVPN server.
NOTE The OpenVPN Access Server product is not available from Vyatta. It is available from
OpenVPN at http://openvpn.net.
2 The Vyatta client accesses the OpenVPN Access Server and provides a username
and password.
3 The OpenVPN Access Server authenticates the user, either acting as its own
authentication server or using an external authentication server such as a
RADIUS server.
4 After authentication, the OpenVPN Access Server sends the Vyatta client device the
configuration information necessary to establish an OpenVPN tunnel with an
OpenVPN server.
5 The Vyatta client then establishes an OpenVPN tunnel with the OpenVPN server
specified in the downloaded configuration and is provided an IP address on the
OpenVPN tunnel subnet.
NOTE If the OpenVPN server is configured such that Autologin is enabled then a tunnel‐username and
tunnel‐password are not required, otherwise they are required to establish the VPN tunnel.
The Vyatta system has the OpenVPN client software preloaded and can use the
OpenVPN Access Server to obtain the information necessary to establish an OpenVPN
tunnel with an OpenVPN server. The only required configuration information is the
OpenVPN Access Server’s IP address or hostname, a username and password for the
OpenVPN Access Server, and, potentially, the tunnel-username and tunnel-password for
establishing the tunnel with the OpenVPN server.
An OpenVPN setup using an OpenVPN Access Server, an authentication server, and
OpenVPN server is shown in Figure 5-3.
12.34.56.78
OpenVPN tunnel
192.168.100.0/24
You can use the operational command show interfaces to show the assigned IP
address on the client side of the OpenVPN tunnel.
OpenVPN tunnel
V1 V2
192.168.100.0/24 192.168.101.0/24
Step Command
Set the OpenVPN mode to vyatta@V1# set interfaces openvpn vtun0 mode site‐to‐site
“site‐to‐site”.
Set the tunnel IP address of the vyatta@V1# set interfaces openvpn vtun0 remote‐address
remote endpoint. 192.168.200.2
Specify the physical IP address vyatta@V1# set interfaces openvpn vtun0 remote‐host
of the remote host. 87.65.43.21
Specify the location of the file vyatta@V1# set interfaces openvpn vtun0
containing the pre‐shared shared‐secret‐key‐file /config/auth/secret
secret.
To configure a static route to access the remote subnet via the OpenVPN tunnel,
perform the following steps in configuration mode.
Step Command
The VPN endpoint V2 is identically to endpoint V1, except that local and remote
tunnel IP addresses are reversed. To configure the V2 endpoint, perform the following
steps in configuration mode.
Step Command
Set the tunnel IP address for the vyatta@V2# set interfaces openvpn vtun0 local‐address
local endpoint. 192.168.200.2
Set the OpenVPN mode to vyatta@V2# set interfaces openvpn vtun0 mode site‐to‐site
“site‐to‐site”.
Set the tunnel IP address of the vyatta@V2# set interfaces openvpn vtun0 remote‐address
remote endpoint. 192.168.200.1
Specify the physical IP address vyatta@V2# set interfaces openvpn vtun0 remote‐host
of the remote host. 12.34.56.78
Specify the location of the file vyatta@V2# set interfaces openvpn vtun0
containing the pre‐shared shared‐secret‐key‐file /config/auth/secret
secret.
Again, the shared secret file (created using generate vpn openvpn-key <filename> on one
system and copied to the other) must be the same on both endpoints (the path need not be
the same, but the content must be). Note also that the remote-host option is only
required on one of the endpoints; that is, the site-to-site tunnel can be established as long
as even one endpoint has enough information to contact the other.
To configure a static route to access the remote subnet via the OpenVPN tunnel,
perform the following steps in configuration mode.
Step Command
Step Command