]> www.infradead.org Git - users/dwmw2/vpnc-scripts.git/log
users/dwmw2/vpnc-scripts.git
5 years agoFix tab typo
Alexander Huynh [Tue, 19 Mar 2019 06:31:08 +0000 (06:31 +0000)]
Fix tab typo

Signed-off-by: Alexander Huynh <alex@grande.coffee>
5 years agoFix IPv6 /128 route addition
Alexander Huynh [Tue, 19 Mar 2019 06:18:51 +0000 (06:18 +0000)]
Fix IPv6 /128 route addition

Previously, a split tunnel with a /128 request would result in a default
tunnel, rather than a specific route.

Correctly set the default route if we request a /0.

Signed-off-by: Alexander Huynh <alex@grande.coffee>
6 years agovpnc-script: hide EROFS for ip route flush cache
Robin H. Johnson [Wed, 20 Jun 2018 06:34:16 +0000 (06:34 +0000)]
vpnc-script: hide EROFS for ip route flush cache

Inside a container, running 'ip route flush cache' can spam with
"ip: can't open '/proc/sys/net/ipv4/route/flush': Read-only file system"

Hide that the error output for that command.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
6 years agovpnc-script: squelch EEXIST from grep
Robin H. Johnson [Wed, 20 Jun 2018 06:26:38 +0000 (06:26 +0000)]
vpnc-script: squelch EEXIST from grep

In a container, /etc/nsswitch.conf might not exist.
Silence the error grep: /etc/nsswitch.conf: No such file or directory

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
6 years agoresolvconf: set search instead of domain
Robin H. Johnson [Wed, 20 Jun 2018 06:26:37 +0000 (06:26 +0000)]
resolvconf: set search instead of domain

Some vpn clients pass multiple domains for DNS search scope, which
requires that we use search rather than domain. The generic path was
already using search, so just switch the resolvconf path to also use
search.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
6 years agoDetect iproute2 ip binary path
Robin H. Johnson [Wed, 20 Jun 2018 06:26:36 +0000 (06:26 +0000)]
Detect iproute2 ip binary path

vpnc-script correctly detects the path to the 'ip' binary, but
vpnc-script-ptrtd and vpnc-script-sshd never got the same fix.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
6 years agoAdd attempt-reconnect invocation
David Woodhouse [Wed, 16 Jan 2019 08:33:50 +0000 (10:33 +0200)]
Add attempt-reconnect invocation

See https://gitlab.com/openconnect/openconnect/issues/17

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
6 years agoAdd IPv6 DNS addresses using "netsh interface ipv6 add dns" command.
Kai Takahashi [Thu, 10 Jan 2019 21:13:40 +0000 (21:13 +0000)]
Add IPv6 DNS addresses using "netsh interface ipv6 add dns" command.

Signed-off-by: Kai Takahashi <www.carrotsoft@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
7 years agoSupport routes with different devs and gateways
Gernot Hillier [Wed, 21 Feb 2018 16:46:44 +0000 (17:46 +0100)]
Support routes with different devs and gateways

Extend the *_network_route helper functions by parameters to specify device
and, optionally, gateway for the route.

Signed-off-by: Gernot Hillier <gernot.hillier@siemens.com>
Tested-by: Thomas Zander <thomas.zander@siemens.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
7 years agoRevive route cleanup for /sbin/route code
Gernot Hillier [Wed, 21 Feb 2018 16:46:43 +0000 (17:46 +0100)]
Revive route cleanup for /sbin/route code

Cleanup our routes upon disconnect also when using /sbin/route command - even
if OS will do it for us when TUNDEV gets removed. That's the same what the
ip-route code already does.

Additionally, we obviously didn't need route deletion in set_network_route for
/sbin/route mode - this function didn't do anything until now. So remove this
call -- it's a bad idea to call del_network_route inside set_network_route
anyways because both modify the same global variables.

Signed-off-by: Gernot Hillier <gernot.hillier@siemens.com>
Tested-by: Thomas Zander <thomas.zander@siemens.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
7 years agoSupport split-exclude rules from Pulse gateway
Gernot Hillier [Wed, 21 Feb 2018 16:46:42 +0000 (17:46 +0100)]
Support split-exclude rules from Pulse gateway

The vpnc-script used by OpenConnect only supports "split include" rules (default
route unchanged, specific VPN routes added). We add support for Pulse's "split
exclude" rules (default route to VPN, exclude rules for targets to be connected
via normal uplink).

For targets specified as split-exclude by the gateway, we add additional routes
which keep traffic as-is (i.e. separate from tunnel). On platforms only
providing /sbin/route, we guess that those are reached via default gateway.
Please note that IPv6 variant is completely untested as I have no
access to according testbeds.

Tested on Linux (using ip and route command) in a IPv4 environment, "ip"
case also tested in a IPv6 dialup config (gateway is IPv4 only).

Signed-off-by: Gernot Hillier <gernot.hillier@siemens.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
7 years agoCheck if resolved is enabled in nsswitch.conf prior to using it
Nikos Mavrogiannopoulos [Wed, 4 Oct 2017 09:53:06 +0000 (11:53 +0200)]
Check if resolved is enabled in nsswitch.conf prior to using it

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
8 years agoAdd support for systemd-resolved
Thiago Padilha [Thu, 20 Oct 2016 05:03:50 +0000 (02:03 -0300)]
Add support for systemd-resolved

Add support for modifying DNS information on systems using systemd-resolved.
The communication with systemd-resolved is done through dbus, which is
possible with the `busctl` program that comes with systemd version 229
and later.

Signed-off-by: Thiago de Arruda <tpadilha84@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
8 years agoMerge branch 'master' of bombadil.infradead.org:/home/dwmw2/public_git/vpnc-scripts
David Woodhouse [Wed, 14 Dec 2016 13:11:39 +0000 (13:11 +0000)]
Merge branch 'master' of bombadil.infradead.org:/home/dwmw2/public_git/vpnc-scripts

8 years agorewrite resolv.conf parsing
Corey Hickey [Sun, 28 Aug 2016 05:45:14 +0000 (22:45 -0700)]
rewrite resolv.conf parsing

This patch simplifies parsing and changes behavior in two ways:

1. Domains for searching are now parsed from "search" and "domain"
lines. Only a "search" line is outputted, since "search" supports
multiple domains and is mutually exclusive with "domain". The motivation
for this is to make vpnc-script behave sanely when there are existing
resolv.conf files with only "domain" or with both "domain" and "search".

2. All original "nameserver" lines are discarded and replaced rather
than only the number of nameservers from $INTERNAL_IP4_DNS. The
rationale here is that vpnc-script should be consistent and either
retain all original nameservers or overwrite all of them. Retaining them
is problematic because there is a limit of three, and overwriting is
closer to the original behavior.

The Darwin changes are untested, but are a simple search/replace and
thus should work fine.

Signed-off-by: Corey Hickey <bugfood-ml@fatooh.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8 years agoavoid multiple "domain" entries in resolv.conf
Corey Hickey [Sat, 6 Aug 2016 03:21:33 +0000 (20:21 -0700)]
avoid multiple "domain" entries in resolv.conf

This fixes a bug when $CISCO_DEF_DOMAIN contains multiple domains. When
resolv.conf has a line like this:

domain example.com example.org

...then the "host" command fails:

 $ host web001
host: parse of /etc/resolv.conf failed

This patch makes vpnc-script use the first entry in CISCO_DEF_DOMAIN for
the "domain" entry.

Signed-off-by: Corey Hickey <bugfood-ml@fatooh.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
10 years agoDo not create /dev/net/tun when checking for its existence
David Woodhouse [Wed, 25 Mar 2015 11:30:46 +0000 (11:30 +0000)]
Do not create /dev/net/tun when checking for its existence

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
10 years agofix comment
David Woodhouse [Tue, 17 Mar 2015 08:05:51 +0000 (08:05 +0000)]
fix comment

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
10 years agoOSX - Fix split DNS when doing split routing
Björn Ketelaars [Sat, 14 Mar 2015 18:31:38 +0000 (19:31 +0100)]
OSX - Fix split DNS when doing split routing

Currently one can choose between two scenarios:

- overriding the default gateway, which breaks split routing, and honoring the
  DNS server as proposed by the server
- not overriding the default gateway, which enables split routing, but without
  honoring the DNS server as proposed by the server

446  # next line overrides the default gateway and breaks split routing
447  # d.add Router $INTERNAL_IP4_ADDRESS

Split DNS, when doing split routing, is enabled by adding INTERNAL_IP4_DNS to
the list of DNS servers.

Signed-off-by: Björn Ketelaars <bjorn.ketelaars@hydroxide.nl>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
10 years agoEnable resolvconf on FreeBSD too
John Baldwin [Thu, 12 Mar 2015 15:28:51 +0000 (15:28 +0000)]
Enable resolvconf on FreeBSD too

According to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195359
this should work fine. I've no idea why it wasn't enable for FreeBSD
in the first place; perhaps just lack of testing and conservatism.

Signed-off-by: John Baldwin <jhb@FreeBSD.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
10 years agoAdd support for "unbound" DNS resolver
Antonio Borneo [Sun, 1 Dec 2013 07:06:41 +0000 (15:06 +0800)]
Add support for "unbound" DNS resolver

Original patch from Erinn Looney-Triggs <erinn.looneytriggs@gmail.com>
posted at Red Hat Bugzilla - Bug #865092
https://bugzilla.redhat.com/show_bug.cgi?id=865092

Removed bashism, removed trailing spaces, use tab for indentation.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
10 years agoFix quoting on network comparisons
David Woodhouse [Thu, 31 Jul 2014 22:03:00 +0000 (23:03 +0100)]
Fix quoting on network comparisons

Spotted by Marcus Müller <marcus@hostalia.de>

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoFix default route handling in vpnc-script-win.js
Jonathan Lauvernier [Fri, 21 Mar 2014 09:02:40 +0000 (09:02 +0000)]
Fix default route handling in vpnc-script-win.js

Implement full tunnel route setup, and get the $VPNGATEWAY route correct.

Signed-off-by: Jonathan Lauvernier <Jonathan.Lauvernier@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoSet MTU on Windows
David Woodhouse [Tue, 11 Mar 2014 18:44:07 +0000 (11:44 -0700)]
Set MTU on Windows

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoSupport IPv6 on Windows
David Woodhouse [Thu, 13 Feb 2014 15:29:35 +0000 (15:29 +0000)]
Support IPv6 on Windows

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
11 years agoImport vpnc-script-win.js from vpnc (r540).
David Woodhouse [Wed, 12 Feb 2014 14:28:28 +0000 (14:28 +0000)]
Import vpnc-script-win.js from vpnc (r540).

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agovpnc-script: document "reason=reconnect"
Antonio Borneo [Sun, 10 Mar 2013 11:53:37 +0000 (19:53 +0800)]
vpnc-script: document "reason=reconnect"

After recent modification, a new value can be passed through
environment variable "reason".
Add it in comment header.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoFix various issues on FreeBSD
Emanuel Haupt [Mon, 28 Jan 2013 15:33:38 +0000 (15:33 +0000)]
Fix various issues on FreeBSD

- duplicate creation of tun devices
- cleanup of created tun device
- deadlock of vpnc holding an open file descriptor on /dev/tunN
- properly restoring /etc/resolv.conf

Signed-off-by: Emanuel Haupt <ehaupt@FreeBSD.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agohandle creating/destroying the tun device on OpenBSD
Stuart Henderson [Thu, 8 Nov 2012 19:37:59 +0000 (19:37 +0000)]
handle creating/destroying the tun device on OpenBSD

Signed-off-by: Stuart Henderson <sthen@openbsd.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoredirect stderr from which (not grep) to /dev/null
Stuart Henderson [Thu, 8 Nov 2012 19:37:35 +0000 (19:37 +0000)]
redirect stderr from which (not grep) to /dev/null

Signed-off-by: Stuart Henderson <sthen@openbsd.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoFix bashisms for shell compatibility
Mike Miller [Fri, 1 Jun 2012 12:53:25 +0000 (08:53 -0400)]
Fix bashisms for shell compatibility

Signed-off-by: Mike Miller <mtmiller@ieee.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoHandle IPv6 configuration in sshd variant
Mike Miller [Fri, 1 Jun 2012 12:53:12 +0000 (08:53 -0400)]
Handle IPv6 configuration in sshd variant

Signed-off-by: Mike Miller <mtmiller@ieee.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoReplace netunshare with ip netns
Mike Miller [Fri, 1 Jun 2012 12:53:03 +0000 (08:53 -0400)]
Replace netunshare with ip netns

Signed-off-by: Mike Miller <mtmiller@ieee.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoUse /32 for netmask to iproute, not /255.255.255.255
David Woodhouse [Fri, 25 May 2012 07:03:37 +0000 (08:03 +0100)]
Use /32 for netmask to iproute, not /255.255.255.255

Older versions of iproute (e.g. 2.6.18-7 on RHEL5.2) can't cope with seeing
/255.255.255.255.

Thanks to Andrew Daviel for pointing it out.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoAdd COPYING file and clarify licences
David Woodhouse [Thu, 17 May 2012 00:19:36 +0000 (01:19 +0100)]
Add COPYING file and clarify licences

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
13 years agoAdd script hooks
David Woodhouse [Mon, 23 Apr 2012 00:20:34 +0000 (01:20 +0100)]
Add script hooks

This is based loosely in concept on the Debian patch, and is also needed for
OpenWrt unless we want to add a bunch of OpenWrt-specific stuff in here too.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
13 years agoAdd support for OpenWrt DNS management
David Woodhouse [Mon, 23 Apr 2012 00:04:54 +0000 (01:04 +0100)]
Add support for OpenWrt DNS management

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
13 years agoBusyBox ifconfig doesn't like the "inet" argument.
David Woodhouse [Mon, 23 Apr 2012 00:04:27 +0000 (01:04 +0100)]
BusyBox ifconfig doesn't like the "inet" argument.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
13 years agoFix compatibility with Solaris 10 /bin/sh
David Woodhouse [Thu, 19 Apr 2012 23:21:31 +0000 (00:21 +0100)]
Fix compatibility with Solaris 10 /bin/sh

It doesn't support $( ) or $(( )) or [ -e ] or if !

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
13 years agodocument INTERNAL_IP4_MTU
Antonio Borneo [Sun, 8 Jan 2012 03:37:00 +0000 (11:37 +0800)]
document INTERNAL_IP4_MTU

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
13 years agoSupport for /sbin/netconfig under OpenSuse 11.1
Mike Kienenberger [Sun, 8 Jan 2012 03:36:59 +0000 (11:36 +0800)]
Support for /sbin/netconfig under OpenSuse 11.1

I added support for OpenSuse 11.1's netconfig system for managing
resolv.conf as modify_resolvconf no longer exists.

Signed-off-by: Mike Kienenberger <mkienenb@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
13 years agoFix typo inside comment
Antonio Borneo [Sun, 8 Jan 2012 03:36:58 +0000 (11:36 +0800)]
Fix typo inside comment

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
13 years agoAdd IPv6 new variables to comment header
Antonio Borneo [Sun, 8 Jan 2012 03:36:57 +0000 (11:36 +0800)]
Add IPv6 new variables to comment header

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
13 years agoReuse function and value for default GW
Antonio Borneo [Sun, 8 Jan 2012 03:36:56 +0000 (11:36 +0800)]
Reuse function and value for default GW

Remove duplicated code to get default GW and
use existing get_default_gw().

Reuse default GW value just obtained, don't
call get_default_gw() twice.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
13 years agoNo need to add link-local address on Solaris.
David Woodhouse [Tue, 13 Dec 2011 23:39:14 +0000 (23:39 +0000)]
No need to add link-local address on Solaris.

Revert commit 9e277b5e64315aa3e1a2f2472e9c2d55f9b0f788. Now that we plumb
the interface from openconnect instead of with ifconfig from vpnc-script,
the issues with link-local addresses no longer seem to bother us.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
13 years agovpnc-script: fix for Suse pre 11.1
Antonio Borneo [Mon, 12 Dec 2011 20:39:06 +0000 (04:39 +0800)]
vpnc-script: fix for Suse pre 11.1

To handle /etc/resolv.conf file, Suse Linux pre 11.1
uses /sbin/modify_resolvconf script.
The same parameter "-s <service>" have to be passed
to modify_resolvconf on both "modify" and "restore".

Original vpnc-script.in from vpnc project runs:
  /sbin/modify_resolvconf modify -s $SCRIPTNAME ...
  /sbin/modify_resolvconf restore -s vpnc  ...
with $SCRIPTNAME=="vpnc".

In this repository, vpnc-script.in has been converted
to vpnc-script. Doing this, the value $SCRIPTNAME has
changed from "vpnc" to "vpnc-script".
This breaks the "restore" and left /etc/resolv.conf
modified for the (already closed) VPN tunnel.

Replace "-s $SCRIPTNAME" with fixed value "-s vpnc".

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
13 years agoDo not plumb interface for IPv6 on Solaris. The VPN client should do that.
David Woodhouse [Mon, 12 Dec 2011 18:16:54 +0000 (18:16 +0000)]
Do not plumb interface for IPv6 on Solaris. The VPN client should do that.

... and does, as of openconnect commit c77af62db. (vpnc doesn't do IPv6 yet)

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
13 years agoManually assign link-local IPv6 addresses on Solaris
David Woodhouse [Fri, 9 Dec 2011 13:14:07 +0000 (13:14 +0000)]
Manually assign link-local IPv6 addresses on Solaris

Solaris 11 *really* wants the interface to have a link-local address, and
doesn't add one automatically.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
13 years agoFix stderr redirection for 'which ip' output
David Woodhouse [Fri, 9 Dec 2011 13:13:10 +0000 (13:13 +0000)]
Fix stderr redirection for 'which ip' output

We really want to redirect stderr from 'which'; not from 'grep'.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
13 years agoTidy up IPv6 address/netmask handling a little, fix netmask handling on *BSD.
David Woodhouse [Thu, 8 Dec 2011 01:04:35 +0000 (01:04 +0000)]
Tidy up IPv6 address/netmask handling a little, fix netmask handling on *BSD.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
13 years agoRemove dest_address from IPv6 ifconfig for all but Solaris
David Woodhouse [Thu, 8 Dec 2011 00:55:30 +0000 (00:55 +0000)]
Remove dest_address from IPv6 ifconfig for all but Solaris

This makes OpenBSD unhappy, and it looks like OpenVPN *only* does it on
Solaris.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
13 years agoAdd restorecon calls for /var/run/vpnc and /dev/net/tun (Red Hat bug #731382)
David Woodhouse [Thu, 24 Nov 2011 12:42:33 +0000 (12:42 +0000)]
Add restorecon calls for /var/run/vpnc and /dev/net/tun (Red Hat bug #731382)

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
13 years agoFix calculation of MTU. Bash doesn't like numbers in quotes.
Christian Krause [Sun, 4 Sep 2011 23:21:51 +0000 (00:21 +0100)]
Fix calculation of MTU. Bash doesn't like numbers in quotes.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
13 years agoFix MTU calculation (Red Hat bug #693235)
Fred Wittekind IV [Sun, 4 Sep 2011 22:10:40 +0000 (23:10 +0100)]
Fix MTU calculation (Red Hat bug #693235)

Newer iproute doesn't give the mtu in 'ip route get' output, so get the
device and then get the device's MTU (which theoretically could be
different to the route MTU but this is good enough for now).

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
13 years agoMerge branch 'vpnc-script' of git://github.com/falconindy/vpnc-scripts
David Woodhouse [Wed, 17 Aug 2011 12:58:46 +0000 (13:58 +0100)]
Merge branch 'vpnc-script' of git://github.com/falconindy/vpnc-scripts

13 years agoBe more robust with unknown 'ip route get' output.
David Woodhouse [Wed, 17 Aug 2011 10:20:24 +0000 (11:20 +0100)]
Be more robust with unknown 'ip route get' output.

Make it opt-in, not opt-out for unknown options.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
13 years agovpnc-script: use iproute to create ptp link if possible
Dave Reisner [Mon, 15 Aug 2011 00:39:11 +0000 (20:39 -0400)]
vpnc-script: use iproute to create ptp link if possible

This should make net-tools completely optional on Linux.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
13 years agovpnc-script: prevent negative MTU
Dave Reisner [Mon, 15 Aug 2011 00:01:24 +0000 (20:01 -0400)]
vpnc-script: prevent negative MTU

We can't be sure that the route shown by 'ip route get' will return
anything. Restructure the logic to only perform the subtraction if it
does. Otherwise, fall back to the default 1412.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
13 years agoCope with new kernel/iproute including ipid in route list
Alessandro Suardi [Sat, 28 May 2011 22:20:15 +0000 (23:20 +0100)]
Cope with new kernel/iproute including ipid in route list

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
15 years agoSet route to VPN gateway before configuring tunnel
Bernhard Schmidt [Tue, 23 Feb 2010 18:11:53 +0000 (18:11 +0000)]
Set route to VPN gateway before configuring tunnel

In some circumstances (with $VPNGATEWAY being inside of
$INTERNAL_IP4_ADDRESS/$INTERNAL_IP4_NETMASK, for example when the netmask
was set incorrectly) the hostroute to $VPNGATEWAY pointed to the
tunnel device, creating a routing recursion.

Set the host route before configuring the tun interface to fix this.

Signed-off-by: Bernhard Schmidt <berni@birkenwald.de>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
15 years agoOnly remove IPv6 default route if we had IPv6
David Woodhouse [Mon, 25 Jan 2010 05:27:20 +0000 (18:27 +1300)]
Only remove IPv6 default route if we had IPv6

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
15 years agoFix up FreeBSD support
David Woodhouse [Fri, 13 Nov 2009 16:24:00 +0000 (16:24 +0000)]
Fix up FreeBSD support

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
15 years agoAdd IPv6 support for Solaris (and maybe BSD)
David Woodhouse [Fri, 13 Nov 2009 15:02:51 +0000 (15:02 +0000)]
Add IPv6 support for Solaris (and maybe BSD)

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
15 years agono grep -q on solaris
David Woodhouse [Fri, 13 Nov 2009 14:56:01 +0000 (14:56 +0000)]
no grep -q on solaris

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
15 years agoHandle IPv6 nameservers (in $INTERNAL_IP4_DNS variable)
David Woodhouse [Wed, 11 Nov 2009 00:52:24 +0000 (00:52 +0000)]
Handle IPv6 nameservers (in $INTERNAL_IP4_DNS variable)

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
15 years agoHandle IPv6 routes
David Woodhouse [Wed, 11 Nov 2009 00:42:28 +0000 (00:42 +0000)]
Handle IPv6 routes

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
15 years agoSet IPv6 address on interface; no routes yet
David Woodhouse [Wed, 4 Nov 2009 07:34:49 +0000 (07:34 +0000)]
Set IPv6 address on interface; no routes yet

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
15 years agoFix MTU when no default route
David Woodhouse [Tue, 3 Nov 2009 20:57:46 +0000 (20:57 +0000)]
Fix MTU when no default route

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=525389

Patch from Jonathan Miner

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
15 years agoMake basic vpnc-script work with Solaris
David Woodhouse [Tue, 3 Nov 2009 19:11:55 +0000 (19:11 +0000)]
Make basic vpnc-script work with Solaris

Add -interface flag when adding routes, specify gateway for default
route when deleting it.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
15 years agoAdd pTRTd script for NAT-PT address to VPN
David Woodhouse [Sat, 6 Jun 2009 13:45:55 +0000 (14:45 +0100)]
Add pTRTd script for NAT-PT address to VPN

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
15 years agoAdd netunshare
David Woodhouse [Sat, 6 Jun 2009 12:19:27 +0000 (13:19 +0100)]
Add netunshare

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
15 years agoset up dnsmasq in netns
David Woodhouse [Sat, 6 Jun 2009 11:55:57 +0000 (12:55 +0100)]
set up dnsmasq in netns

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
15 years agoAdd ssh-inside-vpn-namespace script
David Woodhouse [Sat, 6 Jun 2009 11:22:54 +0000 (12:22 +0100)]
Add ssh-inside-vpn-namespace script

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
15 years agoRemove the substitution in vpnc-script, to remove the need for vpnc-script.in
David Woodhouse [Sat, 6 Jun 2009 09:01:26 +0000 (10:01 +0100)]
Remove the substitution in vpnc-script, to remove the need for vpnc-script.in

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
15 years agoImport vpnc-script from vpnc
David Woodhouse [Sat, 6 Jun 2009 08:53:01 +0000 (09:53 +0100)]
Import vpnc-script from vpnc

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>