git:// links no longer work, refer to the https:// one.
[wiki] / examples / redirect-gateway.mdwn
index a6b2001..7fb1691 100644 (file)
@@ -9,6 +9,8 @@ With tinc, there is no such option, but the behaviour can be replicated with a h
 First there is an explaination of the theory behind redirecting the default gateway,
 then example scripts will follow.
 
+[[!toc levels=2]]
+
 ### Theory
 
 Normally, there are two entries in the routing table.
@@ -112,8 +114,10 @@ running on the clients from the rest of the Internet.
 
 The examples given above will work with both router and switch mode.
 However, in router mode, there is actually no such thing as a gateway route.
-For example, the following three lines in the tinc-up script:
+In that mode, the following four lines in the tinc-up script:
 
+       VPN_GATEWAY=...
+       
        ip route add $VPN_GATEWAY dev $INTERFACE
        ip route add 0.0.0.0/1 via $VPN_GATEWAY dev $INTERFACE
        ip route add 128.0.0.0/1 via $VPN_GATEWAY dev $INTERFACE
@@ -122,8 +126,3 @@ Can be replaced with the following two lines without any problem:
 
        ip route add 0.0.0.0/1 dev $INTERFACE
        ip route add 128.0.0.0/1 dev $INTERFACE
-
-In fact, one does not have to set the VPN_GATEWAY variable at all.
-In switch mode, the gateway routes are necessary.
-However, since Subnet statements are ignored in switch mode,
-you do not have to add `Subnet = 0.0.0.0/0` to `/etc/tinc/myvpn/hosts/server` in that case.