123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>EdgeOS | dn42 wiki</title>
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="robots" content="index, follow">
- <meta name="keywords" content="dn42,wiki,routing,bgp">
- <link rel="canonical" href="https://dn42.obl.ong/howto/EdgeOS-Config.html">
- <link rel="icon" type="image/x-icon" href="/favicon.ico">
- <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
- <link rel="author" type="text/html" href="/docs/people">
- <link rel="stylesheet" href="/css/normalize.css">
- <link rel="stylesheet" href="/css/simple.min.css">
- <link rel="stylesheet" href="/css/style.css">
- <link rel="stylesheet" href="/css/menu.css">
- </head>
-
- <body>
- <header>
- <b>dn42 wiki / EdgeOS</b>
- <div id="dn42_header">
-
- <p><a href="/"><img src="/dn42.png" alt="dn42" /></a></p>
- </div>
- </header>
- <main>
- <h1 id="edgeos">EdgeOS</h1>
- <p>This document describes some possibilities for connecting to dn42 using an Ubiquiti EdgeRouter:</p>
- <ul>
- <li>IPv4/IPv6 tunnel via:
- <ul>
- <li>OpenVPN - support built into EdgeOS already - covered below</li>
- <li>IPsec/IKEv2 - support built into EdgeOS already - not covered here</li>
- <li>QuickTun - see <a href="https://github.com/neilalexander/vyatta-quicktun">vyatta-quicktun package</a> - not covered here</li>
- </ul>
- </li>
- <li>Route exchange using BGP</li>
- <li>DNS resolution for the .dn42 TLD</li>
- </ul>
- <h2 id="first-steps">First Steps</h2>
- <ol>
- <li>Create the required objects in the Registry - see <a href="/howto/Getting-Started">Getting Started</a></li>
- <li>Find a peer - ask nicely in <a href="/services/IRC">IRC</a>!</li>
- <li>Get the following details:
- <ul>
- <li>Tunnel configuration (OpenVPN, IPsec, QuickTun)</li>
- <li>AS numbers</li>
- </ul>
- </li>
- </ol>
- <h3 id="tunnel-configuration">Tunnel Configuration</h3>
- <h3 id="openvpn">OpenVPN</h3>
- <p>Using the below as examples:</p>
- <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Own ASN: AS111111
- Own IPv4 Space: 172.AA.AA.64/27
- Own IPv6 Space: fdBB:BBBB:CCCC::/48
- Own IPv4 If-Address: 172.AA.AA.65
- Own IPv6 If-Address: fdBB:BBBB:CCCC::1
- Peer OpenVPN Remote Address: 172.X.X.X //that's the peers OpenVPN IF IP
- Peer OpenVPN Remote Host: X.X.X.Y //that's the peers clearnet IP
- Peer OpenVPN IP for you: fdAA::BBB/64
- Peer OpenVPN IP: fdAA::CC
- Peer OpenVPN Port: 1194
- Peer OpenVPN encryption: aes256
- Peer ASN: AS222222
- Peer BGP Neighbour IPv4: Z.Z.Z.Z
- Peer BGP Neighbour IPv6: fdAA::CC
- </code></pre></div></div>
- <h4 id="copy-openvpn-key-to-the-edgerouter">Copy OpenVPN key to the EdgeRouter</h4>
- <p>Copy the VPN key to <code class="language-plaintext highlighter-rouge">/config/auth/SomeSharedKey.key</code>:</p>
- <div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo cat</span> <span class="o">></span> /config/auth/SomeSharedKey.key
- </code></pre></div></div>
- <p>Paste the key in the terminal window, hit return once and kill <code class="language-plaintext highlighter-rouge">cat</code> with CTRL+C. Then type <code class="language-plaintext highlighter-rouge">exit</code>.</p>
- <h4 id="create-ipv4-openvpn-interface">Create IPv4 OpenVPN Interface</h4>
- <p>Create the OpenVPN virtual interface, i.e. using <code class="language-plaintext highlighter-rouge">vtun0</code>:</p>
- <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>configure
- set interfaces openvpn vtun0
- set interfaces openvpn vtun0 mode site-to-site
- set interfaces openvpn vtun0 local-port 1194
- set interfaces openvpn vtun0 remote-port 1194
- set interfaces openvpn vtun0 local-address 172.AA.AA.65
- set interfaces openvpn vtun0 remote-address 172.X.X.X
- set interfaces openvpn vtun0 remote-host X.X.X.Y
- set interfaces openvpn vtun0 shared-secret-key-file /config/auth/SomeSharedKey.key
- set interfaces openvpn vtun0 encryption aes256
- set interfaces openvpn vtun0 openvpn-option "--comp-lzo" //if your peer support compression
- commit
- save
- exit
- </code></pre></div></div>
- <p>The OpenVPN tunnel should now be up and running.</p>
- <p>Check it with:</p>
- <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>show interfaces openvpn
- show interfaces openvpn detail
- show openvpn status site-to-site
- </code></pre></div></div>
- <h3 id="create-bgp-session">Create BGP Session</h3>
- <h4 id="open-firewall">Open Firewall</h4>
- <p>You need to open the firewall to local for the tunnel Interface on port 179/tcp</p>
- <h4 id="configure-the-bgp-neighbor">Configure the BGP Neighbor</h4>
- <p>When entering AS numbers, do not include the “AS” prefix, i.e. enter AS111111 as just 111111.</p>
- <p>Build the BGP session with your peer:</p>
- <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>configure
- set protocols bgp 111111 neighbor Z.Z.Z.Z remote-as 222222
- set protocols bgp 111111 neighbor Z.Z.Z.Z soft-reconfiguration inbound
- set protocols bgp 111111 neighbor Z.Z.Z.Z update-source 172.AA.AA.65
- commit
- save
- </code></pre></div></div>
- <p>Check that the BGP session has come up:</p>
- <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>show ip bgp summary
- </code></pre></div></div>
- <h4 id="create-blackhole-route">Create Blackhole Route</h4>
- <p>so bgp can announce the route</p>
- <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>set protocols static route 172.AA.AA.64/27 blackhole
- commit
- save
- </code></pre></div></div>
- <h4 id="announce-route-to-bgp">Announce Route to BGP</h4>
- <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>set protocols bgp 111111 network 172.A.A.64/27
- commit
- save
- exit
- </code></pre></div></div>
- <p>You should now be able to see networks being advertised to your peer:</p>
- <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>show ip bgp neighbors Z.Z.Z.Z advertised-routes
- </code></pre></div></div>
- <h3 id="set-dns-forwarding">Set DNS Forwarding</h3>
- <p>Try to ping <code class="language-plaintext highlighter-rouge">172.23.0.53</code> (anycast DNS resolver). If you get a response then you are good to continue.</p>
- <p>Add the DNS forwarder:</p>
- <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>configure
- set service dns forwarding options server=/23.172.in-addr.arpa/172.23.0.53
- set service dns forwarding options server=/22.172.in-addr.arpa/172.23.0.53
- set service dns forwarding options server=/dn42/172.23.0.53
- commit
- save
- exit
- </code></pre></div></div>
- <h3 id="create-nat-rule">Create NAT rule</h3>
- <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>set service nat rule 5013 outbound-interface vtun0
- set service nat rule 5013 type masquerade
- set service nat rule 5013 description "Masquerade for dn42"
- </code></pre></div></div>
- <p>You should now be able to access .dn42 domains.</p>
- <div id="menu-container" class="menu-container">
- <hr>
- <div id="menu" class="menu">
-
- <ul>
- <li><a href="/Home">Home</a>
- <ul>
- <li><a href="/howto/Getting-Started">Getting Started</a></li>
- <li><a href="/howto/Registry-Authentication">Registry Authentication</a></li>
- <li><a href="/howto/Address-Space">Address Space</a></li>
- <li><a href="/howto/BGP-communities">BGP communities</a></li>
- <li><a href="/FAQ">FAQ</a></li>
- </ul>
- </li>
- <li>How-To
- <ul>
- <li><a href="/howto/wireguard">Wireguard</a></li>
- <li><a href="/howto/openvpn">Openvpn</a></li>
- <li><a href="/howto/IPsec-with-PublicKeys">IPsec With Public Keys</a></li>
- <li><a href="/howto/tinc">Tinc</a></li>
- <li><a href="/howto/GRE-on-FreeBSD">GRE on FreeBSD</a></li>
- <li><a href="/howto/GRE-on-OpenBSD">GRE on OpenBSD</a></li>
- <li><a href="/howto/IPv6-Multicast">IPv6 Multicast (PIM-SM)</a></li>
- <li><a href="/howto/multicast">SSM Multicast</a></li>
- <li><a href="/howto/mpls">MPLS</a></li>
- <li><a href="/howto/Bird2">Bird2</a></li>
- <li><a href="/howto/frr">FRRouting</a></li>
- <li><a href="/howto/OpenBGPD">OpenBGPD</a></li>
- <li><a href="/howto/mikrotik">Mikrotik RouterOS</a></li>
- <li><a href="/howto/EdgeOS-Config">EdgeRouter</a></li>
- <li><a href="/howto/Static-routes-on-Windows">Static routes on Windows</a></li>
- <li><a href="/howto/networksettings">Universal Network Requirements</a></li>
- <li><a href="/howto/vyos1.4.x">VyOS</a></li>
- <li><a href="/howto/nixos">NixOS</a></li>
- </ul>
- </li>
- <li>Services
- <ul>
- <li><a href="/services/IRC">IRC</a></li>
- <li><a href="/services/Whois">Whois registry</a></li>
- <li><a href="/services/DNS">DNS</a></li>
- <li><a href="/services/IX-Collection">IX Collection</a></li>
- <li><a href="/services/Clearnet-Domains">Public DNS</a></li>
- <li><a href="/services/Looking-Glasses">Looking Glasses</a></li>
- <li><a href="/services/Automatic-Peering">Automatic Peering</a></li>
- <li><a href="/services/Repository-Mirrors">Repository Mirrors</a></li>
- <li><a href="/services/Distributed-Wiki">Distributed Wiki</a></li>
- <li><a href="/services/Certificate-Authority">Certificate Authority</a></li>
- <li><a href="/services/Route-Collector">Route Collector</a></li>
- </ul>
- </li>
- <li>Internal
- <ul>
- <li><a href="/internal/Internal-Services">Internal services</a></li>
- <li><a href="/internal/Interconnections">Interconnections</a></li>
- <li><a href="/internal/APIs">APIs</a></li>
- <li><a href="/internal/ShowAndTell">Show and Tell</a></li>
- <li><a href="/internal/Historical-Services">Historical services</a></li>
- </ul>
- </li>
- <li>Historical
- <ul>
- <li><a href="/historical/Bird">Bird 1</a></li>
- <li><a href="/historical/Quagga">Quagga</a></li>
- </ul>
- </li>
- <li>External Tools
- <ul>
- <li><a href="https://paste.dn42.us">Paste Board</a></li>
- <li><a href="https://git.dn42.dev">Git Repositories</a></li>
- </ul>
- </li>
- </ul>
- <hr />
- </div>
- </div>
- </main>
-
- <footer><div class="center">
- <div id="dn42_footer">
-
- <table>
- <tbody>
- <tr>
- <td>Hosted by: <a href="mailto:dn42@burble.com">BURBLE-MNT</a>, <a href="mailto:nurtic-vibe@grmml.net">GRMML-MNT</a>, <a href="mailto:xuu@dn42.us">XUU-MNT</a>, <a href="mailto:janeric@ortgies.it">JAN-MNT</a>, <a href="mailto:lare@lare.cc">LARE-MNT</a>, <a href="mailto:danny@saru.moe">SARU-MNT</a>, <a href="mailto:androw95220@gmail.com">ANDROW-MNT</a>, <a href="mailto:dn42@mk16.de">MARK22K-MNT</a></td>
- <td>Accessible via: <a href="https://wiki.dn42">dn42</a>, <a href="https://dn42.dev/">dn42.dev</a>, <a href="https://dn42.eu/">dn42.eu</a>, <a href="https://wiki.dn42.us/">wiki.dn42.us</a>, <a href="https://dn42.de/">dn42.de</a> (IPv6-only), <a href="https://dn42.cc/">dn42.cc</a> (wiki-ng), <a href="https://dn42.wiki/">dn42.wiki</a>, <a href="https://dn42.pp.ua/">dn42.pp.ua</a>, <a href="https://dn42.obl.ong/">dn42.obl.ong</a></td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- </footer>
-
- </body>
- </html>
|