-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tried to translate a lot of Dutch comments into English
- Loading branch information
Showing
14 changed files
with
957 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
# Vagrant run stuff # | ||
##################### | ||
.vagrant | ||
.gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,41 @@ | ||
# Virtuele DIY Linux routers! | ||
Dit is een vingeroefening in Vagrant om een setje Linux routers op te spinnen en te kijken of hiermee de functionaliteit van bijvoorbeeld de NSX Edge is te benaderen. Ook zou zoiets gebruikt kunnen worden waar anders Vyatta o.i.d. toegepast wordt. | ||
|
||
Waarom deze? Voordeel van een DIY router is de vrijheid in maatwerk en daarmee flexibiliteit van de oplossing. Nadeel is het volledige gebrek aan support en daarmee ook het eigenhandig uitvoeren van het onderhoud. | ||
|
||
## Installatie | ||
Wat heb je nodig om los te gaan met deze spullen? | ||
* Installeer Vagrant | ||
* Installeer Virtualbox | ||
* git clone https://code.ogdsoftware.nl/bas.dusee/DIY-Linux-routers.git | ||
* cd *DIY-Linux-routers-repo-dir* | ||
# Virtual DIY Linux routers! | ||
This is a small excercise to configure Linux servers as (internet facing) routers. | ||
It's ment as a virtual solution and as a comparison to the functionality to solutions as Vyatta and NSX Edge routers. | ||
The whole thing is created in Vagrant, with SaltStack as provisioning language. It uses Virtualbox as a virtual platform. | ||
Testing is only done on a Windows machine due to lack of other equipment. YMMV on other platforms, although it shouldn't be hard to get this running under Linux or some form of BSD. | ||
|
||
But Why?!? Because the benefits of a DIY router is flexibility in the solution and freedom to create whatever solution suits your situation. | ||
The downside is the complete lack of (commercial) support and the complete responsibility for any form of maintenance. | ||
|
||
## Installation | ||
What do you need to go wild with this project? | ||
* Install Vagrant | ||
* Install Virtualbox | ||
* git clone https://code.ogdsoftware.nl/bas.dusee/vagrang-Linux-routers.git | ||
* cd *vagrant-Linux-routers-repo-dir* | ||
* Vagrant up | ||
* Vagrant ssh Edge1 (of Edge2 of Introuter, of Darkrouter, of Darkweb01/02) | ||
* Vagrant ssh Edge1 (or Edge2 or Introuter, or Darkrouter, or Darkweb01/02) | ||
|
||
## Design van het Vagrant netwerkje | ||
Hier een netwerktekening: | ||
![Netwerktekening](./documentatie/netwerktekening.png) | ||
Edge1 en Edge2 zijn twee redundante Edge routers en hangen aan het Internet (in dit geval is het Internet een Host-Only netwerk met de Virtualbox host). Het idee is dat deze Active/Passive of Active/Active werken en elkaars werk kunnen overnemen. | ||
## Network design of the Vagrant Linux router thingy | ||
For your amusement, a network diagram: | ||
![Networkdesign](./documentation/networkdrawing.png) | ||
Edge1 en Edge2 are two redundant Edge routers which are connected to the Internet (The "Internet" in this case is a Host-Only network connected to the Virtualbox host). The general idea is to configure these routers Active/Passive or Active/Active. They should be able to replace each other when one of them fail. | ||
|
||
Daarachter ligt een "intern" subnet (noem het een DMZ oid) waaraan een enkele interne router hangt (Introuter). Deze interne router ontsluit een nog dieper gelegen subnetje wat in eerste instantie niet bekend is bij de beide Edge routers (routing protocol nodig dus..). Op dat diepere netwerkje zitten twee webservers (ik voel een load balancing aankomen...). | ||
Right behind this router there's an "intern" subnet (call it some sort of DMZ, which is not the correct term) to which a single internal router is connected (the Introuter). This router discloses a much more internal subnet which should be anounced to the Edge routers via a routing protocol. There are two webservers connected to this internal subnet. That sounds like a job for a load balancer... | ||
|
||
Normaal gaat de routing naar internet door alle routers heen naar buiten, maar dankzij Vagrant en Virtualbox heeft elke router een eigen Virtualbox NAT adapter. De NAT adapters hebben op elke box exact hetzelfde IP adres (10.0.2.15) en altijd de default route erheen geforceerd. Dit is lastig eruit te slopen. Ik heb dit netwerk maar "mgmt" genoemd om het voor een management subnet te laten doorgaan, dat is in het echt vaak ook zo. Alleen de default gateway door het management VLAN is nogal funky. Wel is het makkelijk met deployen, Introuter kan zo simpel pakketten installeren. In een real life scenario wil je dit anders hebben natuurlijk! | ||
Virtualbox is a little weird considering networking, especially when you use Vagrant. It's very difficult to not use the "NAT" network connector on each router, because this is the interface Vagrant provisions over. So there is a funky default route problem, which points to the "NAT" interface by default. All routers have 10.0.2.15 as an IP on the "NAT" interface, and the default route allways points to 10.0.2.2. I'm still figuring out a good way to solve this. | ||
|
||
## Ontwerp van de DIY box | ||
De boxen zelf zijn op basis van Debian 9 (Ubuntu vertrouw ik niet 100%, die installeert nog wel eens meuk, en CentOS ben ik niet zo mee bekend). Ik gebruik de Bentobox ervan omdat daar de Virtualbox guest drivers al in zitten (nodig voor mounten host directory). In een prod environment is het handig zelf Debian te installeren en deployen vanaf de officiële distro repositories, uiteraard. | ||
## Design of the DIY routers | ||
The Vagrant routers are all made of "bento" boxes and I use the Debian 9 variety right now. It's really advisable to do a manual (or automated) install of Debian yourself in a real production environment. I do not really know what's in the Bento boxes exactly. The reason for choosing Bento, is the already installed guest drivers, which are needed for provisioning from Vagrant. | ||
|
||
### Configuratie management boxen | ||
Configuratie gebeurd via Salt vanuit Vagrant. Ik gebruik Salt omdat ik het ken. Dit kan net zo makkelijk met de Chef of Ansible plugin natuurlijk. Er gebeuren geen spannende dingen met Salt, alleen pakketjes installeren en config files parsen en plaatsen. Eenieder kan de files lezen en snappen wat er gebeurd en makkelijk dit nabouwen in je eigen favo config tool. | ||
### Configuration of the routers | ||
Vagrant configures the machines automatically, using it's builtin SaltStack provisioner. I choose Salt because I'm familiair to it. You can use "vagrant provision" to re-provision already created machines. | ||
You can just as easily implement this using Ansible or Chef (both supported in Vagrant). There are no special tricks involved in the provisioning which is only accessible to Salt. | ||
|
||
### software keuze | ||
De boxen krijgen (een deel van) de onderstaande software voor de volgende functies: | ||
* **BIRD** - voor de Routing protocollen. Ik gebruik OSPF. Quagga kon ook, maar BIRD is de industrie standaard tegenwoordig. BIRD heeft meer toeters en bellen, zoals multiple OSPF instances, wat Quagga niet kan. | ||
* **iptables-persistent** - Voor firewalling en NAT doe ik gewoon iptables. Dit geeft de meeste flexibiliteit. Wel kan het wat complex overkomen en is het iets foutgevoeliger. Alternatieven kunnen zijn: firewalld of ufw. Beiden ben ik niet zo'n fan van, maar deze zijn prima te gebruiken in dit scenario. | ||
* **OpenVPN** - Remote access SSL inbellen. site2site kan ook, maar dat doe ik liever met IPSEC. | ||
* **StrongSwan** - site to site ipsec VPN oplossing. Intersteunt IKEv1 en IKEv2. Remote Access kan ook. Zelfs met Windows 10 native tools. Ga ik wel mee testen. | ||
* **Failover** - Systeem om de Edges elkaar laten overnemen. Pacemaker gebruik ik daar nu voor, maar dit kan ook met Keelalived of kaal met Heartbeat (minder handig, maar kan). | ||
### Choice of installed software | ||
The routers are configured with (parts of) the following software: | ||
* **BIRD** - for Routing protocols. I use OSPF mainly here. Quagga was also an option in this environment, but BIRD is the industry standard at the moment. BIRD has more bells and whistles, like multiple OSPF instances, which Quagga is unable to do. | ||
* **iptables-persistent** - I use/choose plain iptables for firewalling and NAT. This gives me the most flexibility although it looks the most complex and is the most error prone due to typing errors. Considered alternatives were: firewalld or ufw. I dislike both, but they are very usefull in this scenario. | ||
* **OpenVPN** - For remote access SSL VPN. site2site is also possible with OpenVPN, but IPSEC is more suited for this. | ||
* **StrongSwan** - site to site ipsec VPN solution. Supports IKEv1 and IKEv2. Remote Access VPN is also possible, but cumbersome. | ||
* **Failover** - This example uses keepalived to manage a virtual IP address with failover capabilities. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
firewallpakkettenlijst: | ||
firewallpackagelist: | ||
pkg.installed: | ||
- pkgs: | ||
- iptables-persistent | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
vpnpakkettenlijst: | ||
vpnpackagelist: | ||
pkg.installed: | ||
- pkgs: | ||
- strongswan | ||
|
Oops, something went wrong.