This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
user:nsr1:open_swan_vpn [2010/11/02 03:06] – nsr1 | user:nsr1:open_swan_vpn [2010/11/02 03:21] (current) – nsr1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ==== Open Swan VPN ==== | ||
+ | OpenSwan is a VPN that implements IPsec. Through the addition of the xl2tp package we can implement a complete VPN setup that works with that mac and the iPhone natively. | ||
+ | |||
+ | === Setup === | ||
+ | |||
+ | == Building StrongSwan from source == | ||
+ | |||
+ | apt-get install build-essential fakeroot dpkg-dev devscripts | ||
+ | apt-get source strongswan | ||
+ | apt-get install libcurl4-openssl-dev ipsec-tools | ||
+ | apt-get build-dep strongswan | ||
+ | |||
+ | This set of commands gets the tools needed to build packages (you probably have them, but this is safe), gets the source for strongswan, gets some tools that are needed by strongswan, and then makes sure that all the build dependencies are satisfied. | ||
+ | cd strongswan-*.*.*/ | ||
+ | As of this writing the command is actually | ||
+ | cd strongswan-4.2.4/ | ||
+ | But this will increment with time. Next you want to increment the version, this indicates that you're making you're version to the debian package system. | ||
+ | dch -i | ||
+ | The -i indicated that you are incrementing the release number. | ||
+ | |||
+ | Next you want to change the build rules to enable NAT translation. | ||
+ | |||
+ | vim debian/ | ||
+ | |||
+ | Look for the line: | ||
+ | –disable-md5 –disable-sha1 –disable-sha2 \ | ||
+ | and change it to: | ||
+ | | ||
+ | |||
+ | Ready to build: | ||
+ | dpkg-buildpackage -rfakeroot -uc -b | ||
+ | |||
+ | And then to install: | ||
+ | dpkg -i ../*.deb | ||
+ | |||
+ | If everything went well strongswan is now installed! | ||
+ | |||
+ | == Configuring StrongSwan == | ||
+ | |||
+ | Important Files | ||
+ | / | ||
+ | / | ||
+ | |||
+ | == Configuring L2TP == | ||
+ | |||
+ | Important Files | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | |||
+ | === Troubleshooting === | ||
+ | |||
+ | == Making Sure traffic is arriving to the Server == | ||
+ | The thing to check for is that traffic is arriving at the server. | ||
+ | tcpdump -i eth0 -n -p udp port 500 or udp port 4500 | ||
+ | You will need to either be root or execute this command as a superuser because tcpdump grabs the raw unix socket information. | ||
+ | |||
+ | == Watching how ipsec handles the incoming traffic == | ||
+ | tail -f / | ||
+ | | ||
+ | == Looking at available shared secrets == | ||
+ | ipsec secrets | ||
+ | Needs to be executed by a super user or root | ||
+ | |||
+ | == Checking the status of ipsec == | ||
+ | ipsec status | ||
+ | Needs to be executed by a super user or root | ||
+ | |||
+ | == authby Problems == | ||
+ | This comes from the [[https:// | ||
+ | > Hi | ||
+ | > | ||
+ | > This is perhaps a stupid Question .. but with a simple apt-get install build-essential fakeroot dpkg-dev devscripts | ||
+ | apt-get source strongswan | ||
+ | apt-get install libcurl4-openssl-dev ipsec-tools | ||
+ | apt-get build-dep strongswan configuration | ||
+ | > auth=secret and a valid ipsec.secrets (one PSK Entry) i got this | ||
+ | > Message: | ||
+ | > | ||
+ | > Jun 1 09:20:12 vm1 pluto[4383]: | ||
+ | > Main Mode message received on 172.16.101.250: | ||
+ | > been authorized with policy=PSK | ||
+ | |||
+ | Have you enabled **nat_traversal=yes** in the config setup section? | ||
+ | |||
+ | If the answer is no then any source port different from UDP/500 | ||
+ | will be recejected independently of the fact that the authentication | ||
+ | is based on RSA or PSK. | ||
+ | |||
+ | |||
+ | [[user: |