Is there a way to have tinc change the interface according to whether it thinks it is successfully connected to a [external] next hop? We've got a problem where the tinc provided tun0 is sitting there (obviously not going anywhere because there's no uplink via eth0 or whatever anymore after a suspend/resume cycle & having moved locations) but various programs see that as "an interface" and think they can connect through it to get to the internet; result is numerous "connection failed" type error popups from those applications. I'm trying to find out if I can teach those programs to ignore tun0, but meanwhile can anyone suggest an ifconfig parameter change that might make tun0 look less appealing? Failing that, is there something tinc itself could do as the mesh comes and goes? I'm sure typing # ifconfig tun0 down would do the trick, but presumably we want something a touch more elegant ? and automatic ? than that. AfC Sydney -- Andrew Frederick Cowie Consulting Engineer Operational Dynamics Consulting, Pty Ltd
On Wed, Jun 27, 2012 at 04:36:48PM +1000, Andrew Cowie wrote:> Is there a way to have tinc change the interface according to whether it > thinks it is successfully connected to a [external] next hop?[...]> I'm sure typing > > # ifconfig tun0 down > > would do the trick, but presumably we want something a touch more > elegant ? and automatic ? than that.You could do this with up/down scripts for a specific host you are interested in. Say you want to have the interface be up when node foo is reachable, then create the following files: hosts/foo-up: #!/bin/sh ifconfig $INTERFACE up hosts/foo-down: #!/bin/sh ifconfig $INTERFACE down -- Met vriendelijke groet / with kind regards, Guus Sliepen <guus at tinc-vpn.org> -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: <http://www.tinc-vpn.org/pipermail/tinc/attachments/20120702/742c2995/attachment.pgp>