From cf675b4ab8e56267b56e2d8bc2a30f87f3502abb Mon Sep 17 00:00:00 2001 From: Anthony Ruhier Date: Sun, 11 Jan 2015 19:47:17 +0100 Subject: Add support for keys to tunnel connections Only relevant for GRE tunneling. --- docs/examples/tunnel | 13 +++++++++++++ docs/examples/tunnel-he-ipv6 | 10 ---------- docs/netctl.profile.5.txt | 3 +++ src/lib/connections/tunnel | 2 +- 4 files changed, 17 insertions(+), 11 deletions(-) create mode 100644 docs/examples/tunnel delete mode 100644 docs/examples/tunnel-he-ipv6 diff --git a/docs/examples/tunnel b/docs/examples/tunnel new file mode 100644 index 0000000..feb3976 --- /dev/null +++ b/docs/examples/tunnel @@ -0,0 +1,13 @@ +Description='Example tunnel connection' +Interface=tun-ipv6 +Connection=tunnel +Mode=sit +Remote='216.66.80.26' +#Local='172.16.0.1' + +## Optional key in case of Mode=gre +#Key=1234 + +IP6=static +Address6='2001:470:1f08:d87::2/64' +Routes6=('::/0') diff --git a/docs/examples/tunnel-he-ipv6 b/docs/examples/tunnel-he-ipv6 deleted file mode 100644 index 2a19406..0000000 --- a/docs/examples/tunnel-he-ipv6 +++ /dev/null @@ -1,10 +0,0 @@ -Description='An example ipv6 tunnel with Hurricane Electric' -Interface=he-ipv6 -Connection=tunnel -Mode='sit' -Remote='216.66.80.26' -#Local='172.16.0.1' - -IP6=static -Address6='2001:470:1f08:d87::2/64' -Routes6=('::/0') diff --git a/docs/netctl.profile.5.txt b/docs/netctl.profile.5.txt index 82946da..212bbb7 100644 --- a/docs/netctl.profile.5.txt +++ b/docs/netctl.profile.5.txt @@ -461,6 +461,9 @@ the *ip options*, the following are understood for connections of the 'Remote=':: The address of the remote end of the tunnel. +'Key=' [requires 'Mode=gre']:: + A key identifying an individual traffic flow within a tunnel. + OPTIONS FOR `tuntap' CONNECTIONS -------------------------------- diff --git a/src/lib/connections/tunnel b/src/lib/connections/tunnel index 6f35793..927f7f4 100644 --- a/src/lib/connections/tunnel +++ b/src/lib/connections/tunnel @@ -14,7 +14,7 @@ tunnel_up() { [[ $Mode == *ip6* || $Mode == "any" ]] && family="-6" do_debug ip "$family" tunnel add "$Interface" mode "$Mode" \ - remote "$Remote" ${Local+local "$Local"} || return + remote "$Remote" ${Local:+local "$Local"} ${Key:+key "$Key"} || return bring_interface_up "$Interface" ip_set -- cgit v1.2.3-24-g4f1b