<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>9 – Yeri Tiete</title>
    <link>https://yeri.be/tag/9/</link>
    <description>Yeri Tiete&#39;s blog</description>
    <language>en</language>
    <copyright>© Yeri Tiete</copyright>
    <lastBuildDate>Wed, 08 Feb 2017 21:18:10 +0100</lastBuildDate>
    <atom:link href="https://yeri.be/tag/9/index.xml" rel="self" type="application/rss+xml" />
    
    <item>
      <title>Edgerouter IPsec tunnel to Fritzbox</title>
      <link>https://yeri.be/edgerouter-fritzbox-ipsec/</link>
      <pubDate>Wed, 08 Feb 2017 21:18:10 +0100</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/edgerouter-fritzbox-ipsec/</guid>
      <description>&lt;p&gt;So, I have an EdgeRouter Lite in Singapore (Starhub) and a FritzBox in Belgium (EDPnet).&lt;/p&gt;&#xA;&lt;p&gt;This is mostly stuff that I have found from several articles, mostly from &lt;a href=&#34;https://community.ubnt.com/t5/EdgeMAX/HOW-TO-IPSec-Site-to-Site-VPN-with-both-dynamic-IPs-between/m-p/1548055#U1548055&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;ERL: eth0 is WAN, eth1 (10.60.111.0/24) and eth2 (unused, not VPN&amp;rsquo;ed) are LAN&#xA;FritzBoz: 192.168.1.0/24&lt;/p&gt;&#xA;&lt;p&gt;This is the FritzBox config (go to VPN and them Import a config) &lt;code&gt;fritzvpn.cfg&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre&gt;vpncfg {&#xA;        connections {&#xA;                enabled = yes;&#xA;                conn_type = conntype_lan;&#xA;                name = &#34;VPN Yeri&#34;;&#xA;                always_renew = yes;&#xA;                reject_not_encrypted = no;&#xA;                dont_filter_netbios = yes;&#xA;                localip = 0.0.0.0;&#xA;                local_virtualip = 0.0.0.0;&#xA;                remoteip = 0.0.0.0;&#xA;                remote_virtualip = 0.0.0.0;&#xA;                remotehostname = &#34;erl.yeri.be&#34;;&#xA;                localid {&#xA;                        fqdn = &#34;fritz.yeri.be&#34;;&#xA;                }&#xA;                remoteid {&#xA;                        fqdn = &#34;erl.yeri.be&#34;;&#xA;                }&#xA;                mode = phase1_mode_idp;&#xA;                phase1ss = &#34;all/all/all&#34;;&#xA;                keytype = connkeytype_pre_shared;&#xA;                key = &#34;SOMEPASSWORD&#34;;&#xA;                cert_do_server_auth = no;&#xA;                use_nat_t = yes;&#xA;                use_xauth = no;&#xA;                use_cfgmode = no;&#xA;                phase2localid {&#xA;                        ipnet {&#xA;                                ipaddr = 192.168.1.0;&#xA;                                mask = 255.255.255.0;&#xA;                        }&#xA;                }&#xA;                phase2remoteid {&#xA;                        ipnet {&#xA;                                ipaddr = 10.60.111.0;&#xA;                                mask = 255.255.255.0;&#xA;                        }&#xA;                }&#xA;                phase2ss = &#34;esp-all-all/ah-none/comp-all/pfs&#34;;&#xA;                accesslist = &#34;permit ip any 10.60.111.0 255.255.255.0&#34;;&#xA;        }&#xA;        ike_forward_rules = &#34;udp 0.0.0.0:500 0.0.0.0:500&#34;, &#xA;                            &#34;udp 0.0.0.0:4500 0.0.0.0:4500&#34;;&#xA;}&lt;/pre&gt;&#xA;&lt;p&gt;Be sure to modify the password, local (Fritz) and remote (ERL) LAN and edit the local and remote fqdn.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>So, I have an EdgeRouter Lite in Singapore (Starhub) and a FritzBox in Belgium (EDPnet).</p>
<p>This is mostly stuff that I have found from several articles, mostly from <a href="https://community.ubnt.com/t5/EdgeMAX/HOW-TO-IPSec-Site-to-Site-VPN-with-both-dynamic-IPs-between/m-p/1548055#U1548055" target="_blank" rel="noopener">here</a>.</p>
<p>ERL: eth0 is WAN, eth1 (10.60.111.0/24) and eth2 (unused, not VPN&rsquo;ed) are LAN
FritzBoz: 192.168.1.0/24</p>
<p>This is the FritzBox config (go to VPN and them Import a config) <code>fritzvpn.cfg</code>:</p>
<pre>vpncfg {
        connections {
                enabled = yes;
                conn_type = conntype_lan;
                name = "VPN Yeri";
                always_renew = yes;
                reject_not_encrypted = no;
                dont_filter_netbios = yes;
                localip = 0.0.0.0;
                local_virtualip = 0.0.0.0;
                remoteip = 0.0.0.0;
                remote_virtualip = 0.0.0.0;
                remotehostname = "erl.yeri.be";
                localid {
                        fqdn = "fritz.yeri.be";
                }
                remoteid {
                        fqdn = "erl.yeri.be";
                }
                mode = phase1_mode_idp;
                phase1ss = "all/all/all";
                keytype = connkeytype_pre_shared;
                key = "SOMEPASSWORD";
                cert_do_server_auth = no;
                use_nat_t = yes;
                use_xauth = no;
                use_cfgmode = no;
                phase2localid {
                        ipnet {
                                ipaddr = 192.168.1.0;
                                mask = 255.255.255.0;
                        }
                }
                phase2remoteid {
                        ipnet {
                                ipaddr = 10.60.111.0;
                                mask = 255.255.255.0;
                        }
                }
                phase2ss = "esp-all-all/ah-none/comp-all/pfs";
                accesslist = "permit ip any 10.60.111.0 255.255.255.0";
        }
        ike_forward_rules = "udp 0.0.0.0:500 0.0.0.0:500", 
                            "udp 0.0.0.0:4500 0.0.0.0:4500";
}</pre>
<p>Be sure to modify the password, local (Fritz) and remote (ERL) LAN and edit the local and remote fqdn.</p>
<p>This is the ERL config (via ssh, you&rsquo;ll need to <code>set</code> this:</p>
<pre>yeri@sg-erl# show vpn ipsec 
 auto-update 60
 auto-firewall-nat-exclude enable
 esp-group FOO0 {
     proposal 1 {
         encryption aes256
         hash sha1
     }
 }
 ike-group FOO0 {
     dead-peer-detection {
         action restart
         interval 60
         timeout 60
     }
     lifetime 3600
     proposal 1 {
         dh-group 2
         encryption aes256
         hash sha1
     }
 }
 ipsec-interfaces {
     interface eth0
 }
 nat-networks {
     allowed-network 0.0.0.0/0 {
     }
 }
 nat-traversal enable
 site-to-site {
     peer fritz.yeri.be {
         authentication {
             mode pre-shared-secret
             pre-shared-secret SOMEPASSWORD
         }
         connection-type initiate
         description "VPN to fritz.yeri.be"
         ike-group FOO0
         local-address erl.yeri.be
         tunnel 1 {
             esp-group FOO0
             local {
                 prefix 10.60.111.0/24
             }
             remote {
                 prefix 192.168.1.0/24
             }
         }
     }
 }</pre>
<p>Status:</p>
<pre>yeri@sg:~$ show vpn ipsec status
IPSec Process Running PID: 20140

1 Active IPsec Tunnels

IPsec Interfaces :
        eth0    (no IP on interface statically configured as local-address for any VPN peer)
yeri@sg:~$ show vpn ipsec sa
peer-be.yeri.be-tunnel-1: #9, ESTABLISHED, IKEv1, 85a2d010ada73113:ca439c40ac3bca06
  local  'erl.yeri.be' @ 116.87.x.y
  remote 'fritz.yeri.be' @ 109.236.x.y
  AES_CBC-256/HMAC_SHA1_96/PRF_HMAC_SHA1/MODP_1024
  established 1592s ago, reauth in 1333s
  peer-fritz.yeri.be-tunnel-1: #1, INSTALLED, TUNNEL, ESP:AES_CBC-256/HMAC_SHA1_96/MODP_1024
    installed 1592 ago, rekeying in 1200s, expires in 2009s
    in  c0bb652e, 1038032 bytes, 10726 packets,     0s ago
    out 8d5df3f5, 532685 bytes,  6062 packets,     0s ago
    local  10.60.111.0/24
    remote 192.168.1.0/24</pre>
<p>I haven&rsquo;t really figured out what <code>no IP on interface statically configured as local-address for any VPN peer</code> means yet though.</p>
<p>Next up: VLANs</p>
]]></content:encoded>
      <category>hardware</category><category>linux</category><category>networking</category>
      <category>1</category><category>9</category><category>ubiquiti</category><category>vpn</category>
    </item>
    
  </channel>
</rss>
