Step by Step Configure Router Vyata 6.5.20
Step by Step Configure Router Vyata 6.5.20
Set the OpenVPN mode. vyatta@V1# set interfaces openvpn vtun0 mode site‐to‐site
Set the remote IP address of the vyatta@V1# set interfaces openvpn vtun0 remote‐address
VPN tunnel. 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
Set the role of this endpoint. vyatta@V1# set interfaces openvpn vtun0 tls role passive
Specify the location of the CA vyatta@V1# set interfaces openvpn vtun0 tls ca‐cert‐file
certificate file. /config/auth/ca.crt
Specify the location of the host vyatta@V1# set interfaces openvpn vtun0 tls cert‐file
certificate file. /config/auth/V1.crt
Specify the location of the CRL vyatta@V1# set interfaces openvpn vtun0 tls crl‐file
parameters file. /config/auth/crl.pem
Specify the location of the DH vyatta@V1# set interfaces openvpn vtun0 tls dh‐file
file. /config/auth/dh1024.pem
Specify the location of the host vyatta@V1# set interfaces openvpn vtun0 tls key‐file
key file. /config/auth/V1.key
Note that the configuration is the same as the previous section except that the shared-
secret-key-file option has been replaced by tls options. That endpoint V1 takes the
passive role means the dh-file option is required. The optional crl-file is also specified in
this example.
To configure V2 for a site-to-site VPN with TLS, perform the following steps in
configuration mode.
Step Command
Set the local IP address of the vyatta@V2# set interfaces openvpn vtun0 local‐address
VPN tunnel. 192.168.200.2
Set the OpenVPN mode. vyatta@V2# set interfaces openvpn vtun0 mode site‐to‐site
Set the remote IP address of the vyatta@V2# set interfaces openvpn vtun0 remote‐address
VPN tunnel. 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
Set the role of this endpoint. vyatta@V2# set interfaces openvpn vtun0 tls role active
Specify the location of the CA vyatta@V2# set interfaces openvpn vtun0 tls ca‐cert‐file
certificate file. /config/auth/ca.crt
Specify the location of the host vyatta@V2# set interfaces openvpn vtun0 tls cert‐file
certificate file. /config/auth/V2.crt
Specify the location of the host vyatta@V2# set interfaces openvpn vtun0 tls key‐file
key file. /config/auth/V2.key
The configuration is the same as in the previous example, except for that the tls
option is specified, the optional crl-file option is not specified, and the fact that
endpoint V2 takes the active role means dh-file is not needed.
Client‐Server Mode
In a typical remote access VPN setup there is one OpenVPN endpoint that acts as the
server. Remote users will run OpenVPN as clients to connect to the server and establish
VPN tunnels. This is illustrated in Figure 5-5.
OpenVPN tunnel
One thing to note is that OpenVPN requires TLS in client-server mode, and the server
takes the passive role while the clients are active. Therefore, it is not necessary to specify
the tls role option when operating in this mode. In the above example, assuming that V1
is the server and V2 is a client, the configuration for V1 is shown below.
Step Command
Set the OpenVPN mode. vyatta@V1# set interfaces openvpn vtun0 mode server
Set the subnet for the OpenVPN vyatta@V1# set interfaces openvpn vtun0 server subnet
tunnel. 192.168.200.0/24
Specify the location of the host vyatta@V1# set interfaces openvpn vtun0 tls cert‐file
certificate file. /config/auth/V1.crt
Specify the location of the CRL vyatta@V1# set interfaces openvpn vtun0 tls crl‐file
parameters file. /config/auth/crl.pem
Specify the location of the DH vyatta@V1# set interfaces openvpn vtun0 tls dh‐file
file. /config/auth/dh1024.pem
Specify the location of the host vyatta@V1# set interfaces openvpn vtun0 tls key‐file
key file. /config/auth/V1.key
Step Command
Set the OpenVPN mode. vyatta@V2# set interfaces openvpn vtun0 mode client
Specify the location of the CA vyatta@V2# set interfaces openvpn vtun0 tls ca‐cert‐file
certificate file. /config/auth/ca.crt
Specify the location of the host vyatta@V2# set interfaces openvpn vtun0 tls cert‐file
certificate file. /config/auth/V2.crt
Specify the location of the host vyatta@V2# set interfaces openvpn vtun0 tls key‐file
key file. /config/auth/V2.key
This command establishes a VPN tunnel with the OpenVPN server V1 in Example 5-8.
Note that the referenced files must be in the same directory from which this command is
issued. Otherwise, full paths should be used for the files.
Alternatively, to control the OpenVPN client using the OpenVPN GUI,you must create
a control file. The file must be named with extension .ovpn; for example, vyatta.ovpn.
A configuration file that corresponds to the preceding command line contains would
look as shown in Example 5-10 (with corresponding changes for your site information).
dev tun
client
remote 12.34.56.78
ca ca.crt
cert V2.crt
key V2.key
Put the configuration file and the referenced files (certificates, etc.) into the
OpenVPN configuration directory. This is usually C:\Program files\
OpenVPN\config.
Start the OpenVPN GUI, which will show an icon in the notification area of the
Windows taskbar. To establish the OpenVPN tunnel, right-click the icon and select
Connect from the drop-down menu. If there are multiple ovpn configuration files, the
actions for each configuration appear in each file’s own drop-down menu.
Firewall Configuration
The firewall configuration for an OpenVPN tunnel interface is the same as the
configuration for other types of interfaces. Here is an example.
To configure firewall on V1, perform the following steps in configuration mode.
Step Command
Set the firewall rule for inbound vyatta@V1# set interfaces openvpn vtun0 firewall in
traffic on the vtun0 interface. name rules‐in
For more information on configuring firewall for interfaces, see the firewall chapter in
the Vyatta Firewall Reference Guide.
12.34.56.78
OpenVPN tunnel
192.168.100.0/24
Step Command
Specify the OpenVPN Access vyatta@V2# set interfaces openvpn vtun0 remote‐configuration
Server IP address. server 12.34.56.78
Specify the user name to be vyatta@V2# set interfaces openvpn vtun0 remote‐configuration
authenticated at the OpenVPN username abcd
Access Server.
This example is valid for a scenario where Autologin is enabled on the OpenVPN server
for tunnel establishment. If Autologin is disabled, the interfaces openvpn <vtunx>
remote-configuration tunnel-username <username> and interfaces openvpn
<vtunx> remote-configuration tunnel-password <password> commands must also be
used to establish the tunnel.
To configure V2 to establish an OpenVPN tunnel to an OpenVPN server (with
Autologin disabled) using an OpenVPN Access Server as shown in Figure 5-6,
perform the following steps in configuration mode.
Step Command
Specify the OpenVPN Access vyatta@V2# set interfaces openvpn vtun0 remote‐configuration
Server IP address. server 12.34.56.78
Specify the user name to be vyatta@V2# set interfaces openvpn vtun0 remote‐configuration
authenticated at the OpenVPN username abcd
Access Server.
Specify the user name required vyatta@V2# set interfaces openvpn vtun0 remote‐
to establish the tunnel with the configuration tunnel‐username tun‐un3
OpenVPN server.
Specify the password required vyatta@V2# set interfaces openvpn vtun0 remote‐
to establish the tunnel with configuration tunnel‐password tun‐pwdxyz
the OpenVPN server.