All of lore.kernel.org
 help / color / mirror / Atom feed
From: Visham Ramsurrun <vishamr2000@gmail.com>
To: netfilter@lists.netfilter.org
Subject: Re: rc.local
Date: Tue, 26 Jul 2005 15:30:48 +0400	[thread overview]
Message-ID: <9927912d0507260430275d8239@mail.gmail.com> (raw)
In-Reply-To: <42e607e9.6446401e.6174.46a7SMTPIN_ADDED@mx.gmail.com>

Here is my rc.local file:

#!/bin/bash
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

IPT="/sbin/iptables"

$IPT -F
$IPT -Z

if [ ! -r x ]; then

# No value from previous run - initialize x
  x=1
else
  x=$((`cat x`))
  echo "Value of x from previous run = $x"
fi

if [ $x -eq 1 ]; then
  #FW1 IP: 192.168.10.2
  $IPT -A FORWARD -i eth0 -o eth0 -s 192.168.10.0/24 -d
192.168.10.0/24 -p icmp --icmp-type echo-request -j ACCEPT
  $IPT -A FORWARD -i eth0 -o eth0 -s 192.168.10.0/24 -d
192.168.10.0/24 -p icmp --icmp-type echo-reply -j ACCEPT
  x=0;
else
  #FW2 IP: 192.168.10.3
  $IPT -A FORWARD -i eth0 -o eth1 -s 192.168.10.0/24 -d
192.168.10.0/24 -p icmp --icmp-type echo-request -j ACCEPT
  $IPT -A FORWARD -i eth0 -o eth1 -s 192.168.10.0/24 -d
192.168.10.0/24 -p icmp --icmp-type echo-reply -j ACCEPT
  x=1;
fi

# Save variable to file
echo $x >x


       reply	other threads:[~2005-07-26 11:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <42e607e9.6446401e.6174.46a7SMTPIN_ADDED@mx.gmail.com>
2005-07-26 11:30 ` Visham Ramsurrun [this message]
2005-07-26 15:38   ` rc.local curby .
     [not found]     ` <9927912d050726221615fe208f@mail.gmail.com>
2005-07-27 16:42       ` rc.local curby .
2005-07-28  5:31         ` rc.local Visham Ramsurrun
2005-07-28  6:34           ` rc.local Jan Engelhardt
2005-07-28  6:54             ` rc.local Visham Ramsurrun
2005-07-28  7:34         ` rc.local Visham Ramsurrun
     [not found]           ` <3075.217.166.67.34.1122545502.squirrel@217.166.67.34>
     [not found]             ` <9927912d050728035556e1f9c2@mail.gmail.com>
     [not found]               ` <3255.217.166.67.34.1122550077.squirrel@217.166.67.34>
2005-07-28 12:03                 ` rc.local Visham Ramsurrun
2005-07-29  7:55           ` rc.local Jan Engelhardt
2005-07-26 11:57 ` executing a firewall script!! Visham Ramsurrun
2005-07-26 12:23   ` Carl Holtje ;021;vcsg6;
     [not found]     ` <9927912d0507260546168ad046@mail.gmail.com>
2005-07-26 13:09       ` Carl Holtje ;021;vcsg6;
     [not found] <42e5502e.57dde3f4.2ba3.ffff9d47SMTPIN_ADDED@mx.gmail.com>
2005-07-26  9:51 ` rc.local Visham Ramsurrun
2005-07-26 10:41   ` rc.local /dev/rob0

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=9927912d0507260430275d8239@mail.gmail.com \
    --to=vishamr2000@gmail.com \
    --cc=netfilter@lists.netfilter.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.