From 9198ef2273d35e02501c16d87049c1381373b480 Mon Sep 17 00:00:00 2001 From: mbent Date: Wed, 11 Apr 2012 14:52:28 +0200 Subject: [PATCH] removed --- examples/macbook-install.mdwn | 91 ----------------------------------- 1 file changed, 91 deletions(-) delete mode 100644 examples/macbook-install.mdwn diff --git a/examples/macbook-install.mdwn b/examples/macbook-install.mdwn deleted file mode 100644 index a45a989..0000000 --- a/examples/macbook-install.mdwn +++ /dev/null @@ -1,91 +0,0 @@ -[[!meta title="installing tinc on Mac OS/X laptop"]] - -## Example: installing tinc on Mac OS/X laptop - -**This page is under construction, don't use what is written here yet.** - -This page explains how to intergrate tinc as a system service on a laptop. Allowing tinc to reconnect as soon as a internet connection is available. Installing an configuring tinc is explained on [[osx-install]]. I have used the compile-it-yourself method, as the intergration into OS X is currently a small application you have to compile yourself anyway. - -[[!toc levels=3]] - -### Configuration of tinc for a laptop - -The configuration as used on the [[osx-install]] page works on a laptop. The important thing is that the host-file descrbing the laptop does not give an ip address, because it changes to wherever the laptop will be. Instead, the laptop sould have a ConnectTo = myserver line in its tincd.conf file. - -Auto discovery (bonjour) of network services on the vpn might work when tinc runs in Router mode. But I use a switch-based network to make the laptop appear as part of my local network, which even allows dhcp to work over the vpn. Note that this can lower the performance of your vpn. To use the switch mode in tinc, just add the line 'Mode = Switch' in the tincd.conf on the server and laptop side. If you have a local network, you will also need a bridge on the server between your local network and the vpn. There are guides on how to setup such a bridge but I give an example below. - - -#### Setup a bridge on your server - -We assume *eth0* is your local network. We name the brigde *priv*, but you can use any name. On your server bring down eth0 using *ifdown eth0*. **Be careful not to shut yourself out**. In /etc/network/interfaces add: - - # Prevent NetworkManager to run on these interfaces - iface eth0 inet manual - - # Start priv on boot - auto priv - # make eth0 part of the bridge priv and configure priv via dhcp - iface priv inet dhcp - bridge_ports eth0 - -If there are other references to eth0, these should likely be removed. Now the tinc-up file of your vpn on your server should look like: - - #!/bin/sh - ifconfig "$INTERFACE" up - brctl addif priv "$INTERFACE" - -The tinc-down file should be: - - #!/bin/sh - brctl delif priv "$INTERFACE" - -This add and removes the vpn interface as part of the bridge if tinc starts or stops. A bridge is like a virtual switch and allows two network devices to be on the same subnet. - -### Start tinc at startup - -OS X has something called [launchd](http://en.wikipedia.org/wiki/Launchd). This is a system for monitoring services and make sure services are started if certain conditions are met. This is used at least on OS X 10.5 and maybe newer versions as well. (If you want me to check it, you have to give me a laptop with that version installed on it.) - -To use launchd, you have to create a property-list file for tinc and put it under /Library/LaunchDaemons/ - -For instance, I created */Library/LaunchDaemons/myvpn.tinc.plist* with the following: - - - - - - KeepAlive - - Label - tinc.myvpn - ProgramArguments - - /usr/local/tinc/sbin/tincd - -n - myvpn - -D - - - - -This will configures tincd to start the myvpn configuration in the foreground (-D). If tincd is started as background daemon, launchd will become confused. Launchd will directly start tincd if this file is found (it might be that you first have to use the load command as explained below - I cannot remember), the KeepAlive will ensure that if tincd will stop, it is restarted directly. To be able to stop tincd you have to use *launchctl*. Good commands to remember are: - - launchctl unload -w /Library/LaunchDaemons/myvpn.tinc.plist - -This adds a *disabled* key to the file and stops tincd. The disabled key ensure that launchd will not start tincd anymore. The inverse operation is: - - launchctl load -w /Library/LaunchDaemons/myvpn.tinc.plist - -This removes the *disabled* key from the file and starts tincd. Using: - - launchctl list - -you will get a list of all services monitored by launchd. If done correctly, you will see tinc.myvpn listed with some process id. - -There is also a stop command: - - launchctl stop tinc.myvpn - -But because the property list does not specify any condition when to start the command, launchd will directly start the tinc.myvpn service again. - -### Reconnect tinc if internet becomes available - -- 2.20.1