X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=examples%2Fproxy-arp.mdwn;h=834e84cd8d3e1362792bda301472ff7e724db63d;hb=e50284820a4aae5b4503db026afc29330b2e0fb2;hp=70cb092f3e02330b096c80a1bcf7e6c90782e21c;hpb=e8902ec27a050f2c62253ea73ee7acda88c6ac9b;p=wiki diff --git a/examples/proxy-arp.mdwn b/examples/proxy-arp.mdwn index 70cb092..834e84c 100644 --- a/examples/proxy-arp.mdwn +++ b/examples/proxy-arp.mdwn @@ -22,46 +22,46 @@ The network setup is as follows: ### Configuration of tinc at the office -> host# cat /etc/tinc/vpn/tinc.conf -> Name = office -> #Optional: -> #Mode = switch -> -> host# cat /etc/tinc/vpn/tinc-up -> #!/bin/sh -> -> ifconfig $INTERFACE 192.168.1.2 netmask 255.255.255.255 -> route add 192.168.1.123 dev $INTERFACE -> echo 1 >/proc/sys/net/ipv4/conf/eth0/proxy_arp -> echo 1 >/proc/sys/net/ipv4/conf/$INTERFACE/proxy_arp -> -> host# ls /etc/tinc/vpn/hosts -> office roadwarrior ... -> -> host# cat /etc/tinc/vpn/hosts/office -> Address = 123.234.123.42 -> Subnet = 192.168.1.0/24 -> -----BEGIN RSA PUBLIC KEY----- -> ... -> -----END RSA PUBLIC KEY----- -> -> host# cat /etc/tinc/vpn/hosts/roadwarrior -> Subnet = 192.168.1.123 -> -----BEGIN RSA PUBLIC KEY----- -> ... -> -----END RSA PUBLIC KEY----- + host# cat /etc/tinc/vpn/tinc.conf + Name = office + #Optional: + #Mode = switch + + host# cat /etc/tinc/vpn/tinc-up + #!/bin/sh + + ifconfig $INTERFACE 192.168.1.2 netmask 255.255.255.255 + route add 192.168.1.123 dev $INTERFACE + echo 1 >/proc/sys/net/ipv4/conf/eth0/proxy_arp + echo 1 >/proc/sys/net/ipv4/conf/$INTERFACE/proxy_arp + + host# ls /etc/tinc/vpn/hosts + office roadwarrior ... + + host# cat /etc/tinc/vpn/hosts/office + Address = 123.234.123.42 + Subnet = 192.168.1.0/24 + -----BEGIN RSA PUBLIC KEY----- + ... + -----END RSA PUBLIC KEY----- + + host# cat /etc/tinc/vpn/hosts/roadwarrior + Subnet = 192.168.1.123 + -----BEGIN RSA PUBLIC KEY----- + ... + -----END RSA PUBLIC KEY----- ### Configuration of tinc at the road warrior -> host# cat /etc/tinc/vpn/tinc.conf -> Name = roadwarrior -> #Optional: -> #Mode = switch -> -> host# cat /etc/tinc/vpn/tinc-up -> #!/bin/sh -> -> ifconfig $INTERFACE 192.168.1.123 netmask 255.255.255.0 + host# cat /etc/tinc/vpn/tinc.conf + Name = roadwarrior + #Optional: + #Mode = switch + + host# cat /etc/tinc/vpn/tinc-up + #!/bin/sh + + ifconfig $INTERFACE 192.168.1.123 netmask 255.255.255.0 The host config files are, of course, identical to those on the office node. @@ -72,7 +72,7 @@ to the roadwarrior's address hardcoded. To have tinc automatically add the necessary routes, remove the `route add` command from the `tinc-up` script, and instead add this `subnet-up` script: -> host# cat /etc/tinc/vpn/subnet-up -> #!/bin/sh -> [ "$NAME" = "$NODE" ] && exit 0 -> ip route replace $SUBNET dev $INTERFACE + host# cat /etc/tinc/vpn/subnet-up + #!/bin/sh + [ "$NAME" = "$NODE" ] && exit 0 + ip route replace $SUBNET dev $INTERFACE