<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>http://vwiki.co.uk/index.php?action=history&amp;feed=atom&amp;title=IPSec_VPN_%28Vyatta%29</id>
	<title>IPSec VPN (Vyatta) - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://vwiki.co.uk/index.php?action=history&amp;feed=atom&amp;title=IPSec_VPN_%28Vyatta%29"/>
	<link rel="alternate" type="text/html" href="http://vwiki.co.uk/index.php?title=IPSec_VPN_(Vyatta)&amp;action=history"/>
	<updated>2026-05-29T21:10:44Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>http://vwiki.co.uk/index.php?title=IPSec_VPN_(Vyatta)&amp;diff=2688&amp;oldid=prev</id>
		<title>Sstrutt: Initial creation</title>
		<link rel="alternate" type="text/html" href="http://vwiki.co.uk/index.php?title=IPSec_VPN_(Vyatta)&amp;diff=2688&amp;oldid=prev"/>
		<updated>2018-10-09T08:47:02Z</updated>

		<summary type="html">&lt;p&gt;Initial creation&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Overview ==&lt;br /&gt;
This page covers the three overall steps of Vyatta configuration required to build an IPSec VPN endpoint&lt;br /&gt;
* &amp;lt;b&amp;gt;FIREWALL&amp;lt;/b&amp;gt;&lt;br /&gt;
** Create network-group for remote VPN subnets&lt;br /&gt;
** Allow traffic from remote VPN subnets&lt;br /&gt;
** Allow Vyatta to receive ESP protocol&lt;br /&gt;
** Allow Vyatta to receive IKE protocol&lt;br /&gt;
*&amp;lt;b&amp;gt;NETWORK ADDRESS TRANSLATION&amp;lt;/b&amp;gt;&lt;br /&gt;
** Exclude traffic destined for remote VPN subnets from NAT&lt;br /&gt;
*&amp;lt;b&amp;gt;VIRTUAL PRIVATE NETWORK&amp;lt;/b&amp;gt;&lt;br /&gt;
** Define ESP group&lt;br /&gt;
** Define IKE group&lt;br /&gt;
** Set Vyatta IPSec interface&lt;br /&gt;
** Build tunnel configuration&lt;br /&gt;
&lt;br /&gt;
== Procedure ==&lt;br /&gt;
Create a firewall network group containing each of the remote subnets.&lt;br /&gt;
 set firewall group network-group VPN-SUBNETS network &amp;lt;b&amp;gt;%REMOTE_SUBNETS%&amp;lt;/b&amp;gt;			**** Add each remote subnet ****&lt;br /&gt;
 &lt;br /&gt;
Add a new rule to allow all traffic from the VPN remote subnets to the Vyatta&lt;br /&gt;
 set firewall name eth0-in rule &amp;lt;b&amp;gt;%AA%&amp;lt;/b&amp;gt; action accept&lt;br /&gt;
 set firewall name eth0-in rule &amp;lt;b&amp;gt;%AA%&amp;lt;/b&amp;gt; source group network-group VPN-SUBNETS&lt;br /&gt;
&lt;br /&gt;
Add a new rule to allow ESP traffic to reach the Vyatta&lt;br /&gt;
 set firewall name eth0-in rule &amp;lt;b&amp;gt;%BB%&amp;lt;/b&amp;gt; action accept&lt;br /&gt;
 set firewall name eth0-in rule &amp;lt;b&amp;gt;%BB%&amp;lt;/b&amp;gt; description ESP&lt;br /&gt;
 set firewall name eth0-in rule &amp;lt;b&amp;gt;%BB%&amp;lt;/b&amp;gt; protocol esp&lt;br /&gt;
&lt;br /&gt;
Add a rule to allow IKE traffic to reach the Vyatta&lt;br /&gt;
 set firewall name eth0-in rule &amp;lt;b&amp;gt;%CC%&amp;lt;/b&amp;gt; action accept&lt;br /&gt;
 set firewall name eth0-in rule &amp;lt;b&amp;gt;%CC%&amp;lt;/b&amp;gt; description IKE&lt;br /&gt;
 set firewall name eth0-in rule &amp;lt;b&amp;gt;%CC%&amp;lt;/b&amp;gt; destination port 500&lt;br /&gt;
 set firewall name eth0-in rule &amp;lt;b&amp;gt;%CC%&amp;lt;/b&amp;gt; protocol udp&lt;br /&gt;
&lt;br /&gt;
Define a NAT exclusion rule so local traffic destined for the VPN remote subnets is not NAT&amp;#039;d and sent out the external interface.&lt;br /&gt;
 set service nat rule QQ description &amp;quot;VPN EXCLUSION - &amp;lt;b&amp;gt;%REMOTE_SUBNET%&amp;lt;/b&amp;gt;&amp;quot;			**** Repeat rule for each remote subnet ****&lt;br /&gt;
 set service nat rule QQ destination address &amp;lt;b&amp;gt;%REMOTE_SUBNET%&amp;lt;/b&amp;gt;				**** Remote subnet ****&lt;br /&gt;
 set service nat rule QQ exclude &lt;br /&gt;
 set service nat rule QQ outbound-interface eth0&lt;br /&gt;
 set service nat rule QQ source address &amp;lt;b&amp;gt;%LOCAL_SUBNET%&amp;lt;/b&amp;gt; 					**** Local subnet ****&lt;br /&gt;
 set service nat rule QQ type source&lt;br /&gt;
&lt;br /&gt;
If not already defined, create an ESP group. The settings below are typical.&amp;lt;br&amp;gt; &lt;br /&gt;
If you need to modify the ESP settings, add additional groups (e.g. ESP2, ESP3 etc) rather than change the default.&lt;br /&gt;
 set vpn ipsec esp-group ESP1&lt;br /&gt;
 set vpn ipsec esp-group ESP1 compression disable&lt;br /&gt;
 set vpn ipsec esp-group ESP1 lifetime 3600&lt;br /&gt;
 set vpn ipsec esp-group ESP1 mode tunnel&lt;br /&gt;
 set vpn ipsec esp-group ESP1 pfs dh-group2&lt;br /&gt;
 set vpn ipsec esp-group ESP1 proposal 1 encryption 3des&lt;br /&gt;
 set vpn ipsec esp-group ESP1 proposal 1 hash md5&lt;br /&gt;
&lt;br /&gt;
If not already defined, create an IKE group. The settings below are typical.&amp;lt;br&amp;gt; &lt;br /&gt;
If you need to modify the IKE settings, add additional groups (e.g. IKE2, IKE3 etc) rather than change the default.&lt;br /&gt;
 set vpn ipsec ike-group IKE1&lt;br /&gt;
 set vpn ipsec ike-group IKE1 dead-peer-detection&lt;br /&gt;
 set vpn ipsec ike-group IKE1 dead-peer-detection action restart&lt;br /&gt;
 set vpn ipsec ike-group IKE1 dead-peer-detection interval 30&lt;br /&gt;
 set vpn ipsec ike-group IKE1 dead-peer-detection timeout 120&lt;br /&gt;
 set vpn ipsec ike-group IKE1 lifetime 28800&lt;br /&gt;
 set vpn ipsec ike-group IKE1 proposal 1 dh-group 2&lt;br /&gt;
 set vpn ipsec ike-group IKE1 proposal 1 encryption 3des&lt;br /&gt;
 set vpn ipsec ike-group IKE1 proposal 1 hash md5&lt;br /&gt;
&lt;br /&gt;
Define the Vyatta interface to use for the IPSec VPN&lt;br /&gt;
 set vpn ipsec ipsec-interfaces interface eth0&lt;br /&gt;
&lt;br /&gt;
Build the IPSec VPN policy for this particular remote peer. Repeat the tunnel section for each local &amp;amp; remote subnet pairing.&lt;br /&gt;
Repeat the remote peer section for each distinct IPSec VPN you require.&lt;br /&gt;
 set vpn ipsec site-to-site peer &amp;lt;b&amp;gt;%REMOTE_PEER_IP%&amp;lt;/b&amp;gt; 						**** Add peer for each remote VPN endpoint ***&lt;br /&gt;
 set vpn ipsec site-to-site peer &amp;lt;b&amp;gt;%REMOTE_PEER_IP%&amp;lt;/b&amp;gt; authentication mode pre-shared-secret&lt;br /&gt;
 set vpn ipsec site-to-site peer &amp;lt;b&amp;gt;%REMOTE_PEER_IP%&amp;lt;/b&amp;gt; authentication pre-shared-secret ****************&lt;br /&gt;
&lt;br /&gt;
 set vpn ipsec site-to-site peer &amp;lt;b&amp;gt;%REMOTE_PEER_IP%&amp;lt;/b&amp;gt; ike-group IKE1&lt;br /&gt;
 set vpn ipsec site-to-site peer &amp;lt;b&amp;gt;%REMOTE_PEER_IP%&amp;lt;/b&amp;gt; local-ip &amp;lt;b&amp;gt;%VYATTA_IPSEC_IP%&amp;lt;/b&amp;gt;			**** External eth0 IP Vyatta listens for IPSec on ****&lt;br /&gt;
 set vpn ipsec site-to-site peer &amp;lt;b&amp;gt;%REMOTE_PEER_IP%&amp;lt;/b&amp;gt; tunnel 1 allow-nat-networks disable&lt;br /&gt;
 set vpn ipsec site-to-site peer &amp;lt;b&amp;gt;%REMOTE_PEER_IP%&amp;lt;/b&amp;gt; tunnel 1 allow-public-networks disable&lt;br /&gt;
 set vpn ipsec site-to-site peer &amp;lt;b&amp;gt;%REMOTE_PEER_IP%&amp;lt;/b&amp;gt; tunnel 1 esp-group ESP1&lt;br /&gt;
 set vpn ipsec site-to-site peer &amp;lt;b&amp;gt;%REMOTE_PEER_IP%&amp;lt;/b&amp;gt; tunnel 1 local-subnet a.b.c.d/n		**** Local subnet ****&lt;br /&gt;
 set vpn ipsec site-to-site peer &amp;lt;b&amp;gt;%REMOTE_PEER_IP%&amp;lt;/b&amp;gt; tunnel 1 remote-subnet a.b.c.d/n		**** Remote subnet ****&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Show Phase 1 status&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** &amp;lt;code&amp;gt; show vpn ike sa peer 213.253.2.10 &amp;lt;/code&amp;gt;&lt;br /&gt;
** Replace IP with peer address (just tab)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Show Phase 2 status&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** &amp;lt;code&amp;gt; show vpn ipsec sa detail &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Show log&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
** &amp;lt;code&amp;gt; show log &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reset VPN ===&lt;br /&gt;
You can&amp;#039;t disable and renable a VPN tunnel, you can reset the process, but this isn&amp;#039;t always effective&lt;br /&gt;
# Show the current config&lt;br /&gt;
#* &amp;lt;code&amp;gt; show configuration commands &amp;lt;/code&amp;gt;&lt;br /&gt;
# Copy all lines starting &amp;lt;code&amp;gt; set vpn ipsec &amp;lt;/code&amp;gt;&lt;br /&gt;
# Enter config mode&lt;br /&gt;
#* &amp;lt;code&amp;gt; configuration &amp;lt;/code&amp;gt;&lt;br /&gt;
# Delete Site 2 Site config&lt;br /&gt;
#* &amp;lt;code&amp;gt; delete vpn ipsec &amp;lt;/code&amp;gt;&lt;br /&gt;
# Apply change&lt;br /&gt;
#* &amp;lt;code&amp;gt; commit &amp;lt;/code&amp;gt;&lt;br /&gt;
# Re-add site 2 site config - paste in copied lines&lt;br /&gt;
# Apply change&lt;br /&gt;
#* &amp;lt;code&amp;gt; commit &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Vyatta]]&lt;br /&gt;
[[Category:VPN]]&lt;/div&gt;</summary>
		<author><name>Sstrutt</name></author>
	</entry>
</feed>