Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Andrew Beverley <andy@andybev.com>
To: "cmlitguy@gmail.com" <cmlitguy@gmail.com>
Cc: netfilter@vger.kernel.org
Subject: Re: Make a redirect if NAT out interface is down
Date: Sun, 04 Mar 2012 20:04:08 +0000	[thread overview]
Message-ID: <1330891448.30413.347.camel@andrew-desktop> (raw)
In-Reply-To: <4F515C9B.3030209@gmail.com>

On Sat, 2012-03-03 at 01:49 +0200, cmlitguy@gmail.com wrote:
> Hello,
> I have a question about possibility of making a redirect if  NAT out 
> interface tun0 is down.
> This is iptables rule for Masquerading our network via VPN connection.
> 
> iptables  --table  nat  --append  POSTROUTING  --out-interface  tun0  -j  MASQUERADE  -m  comment  --comment  "Masquerading"
> 
> When VPN goes down, we can't access some resources and we need to verify 
> its status and establish it again.
> Is it possible to make a redirect of all traffic to another host - Web 
> Site(via IP address) of tun0 is down ?

If the interface actually does "down", then I would use your operating
system's networking scripts to run a "down" script. E.g. for Debian
use /etc/network/interfaces

If it just stops responding, then I'd consider LSM[1] to monitor it and
do something similar.

[1] http://lsm.foobar.fi/



  reply	other threads:[~2012-03-04 20:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-02 23:49 Make a redirect if NAT out interface is down cmlitguy
2012-03-04 20:04 ` Andrew Beverley [this message]
2012-03-07 16:19   ` cmlitguy
  -- strict thread matches above, loose matches on Subject: below --
2012-03-02 23:45 cmlitgUy@gmail.com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1330891448.30413.347.camel@andrew-desktop \
    --to=andy@andybev.com \
    --cc=cmlitguy@gmail.com \
    --cc=netfilter@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox