(ipv4)IPSec + GRE + Routing

This document intends to describe how to build a scalable VPN based using (IPv4) IPSec tunnels, GRE tunnels and dynamic routing protocols like OSPF and BGP. Not only does this document provide a guideline for (new) members seeking how to connect to the Undernet #ipsec VPN, but it also tries to provide configuration examples and a little design philosophy for those seeking to implement a similar VPN of their own.


Table of Contents
1. Preface
1.1. Who should read this
1.2. Background
1.3. Acknowledgements
1.4. Document layout
1.5. Conventions
1.6. Disclaimer
2. How it all fits together
2.1. Network layout
2.2. Point-to-point links
3. Prerequisites
3.1. Generic prerequisites
3.2. Linux
3.3. BSD
3.4. Windows
4. X.509 certificate
5. Connecting things
5.1. Linux
5.1.1. Linux 2.4 with FreeS/Wan
5.1.2. Linux 2.6
5.1.3. Adding GRE
5.1.4. Obtaining routing information
5.1.5. Automating
5.2. BSD
5.3. Windows
6. Troubleshooting
7. References
8. Further reading
9. Glossary

1. Preface

1.1. Who should read this

This document is intended for people who are interrested in joining the VLAN project, or in general people who are interested in building a similar VPN. Knowledge on basic Unix system administration (including compiling custom kernels for your preferred flavour of Unix like operating system), routing and routing protocols and VPN technology is assumed, together with some experience in setting up a basic IPSec tunnel in your OS of choice.

1.2. Background

The experiences and configurations used in this document are currently (at date of writing) used in a wide area VPN, spanning from New Zealand to Canada to Europe. The goal of this WAVPN (we call it “VLAN”, and that's the term which will be used when referring to this functional implementation) is to function as a testbed for its members to try out new (to us) technology, and teach ourselves in the art of designing, building, configuring, managing and troubleshooting a larger scale network than would be possible with more conventional means.

1.3. Acknowledgements

Everything which is described in this document has come to be as a group effort. Without most of the people in the Undernet #ipsec IRC channel, various people in the Undernet #linux IRC channel, various people in the Undernet #linuxhelp IRC channel, people on various mailing lists and of course the numerous people who have been writing documentation on the web or in books, all this wouldn't have been possible. Credit where credit is due, without the entire FLOSS community which provides such a massive amount of software, documentation and support for free, mere mortals would be unable to undertake projects like these. Special mention deserves the people behind the Linux Advanced Routing & Traffic Control Howto (generally known as LARTC, see references). Without the work you guys put into this invaluable resource

1.4. Document layout

After you finish this, this document continues with a small explanation on how the VLAN is put together. It's short, and will leave out most details as to continue as fast as possible with the more interresting technical details. This starts with providing a list of prerequisites (“stuff you need”), only to continue with a description of how to connect your favourite IPSec implementation to the VLAN. Configuration examples and all. Not assuming everything will work in one stroke, a section on troubleshooting your connection(s) is provided, which brings you to the obligatory document endings like a list of references, literature and a glossary.

1.5. Conventions

Configuration snippets are formatted as follows:

configuration snippet
   

Furthermore, it's assumed that your local IP address is w.x.y.z, and the IP address of the IPSec peer you're connecting to is a.b.c.d with e.f.g.h as its nexthop.