simple question about a "rule"

Nelson Garcia garcian002 at hawaii.rr.com
Tue Jun 26 13:14:40 PDT 2001


You can also use variables like this:
TRUSTEDHOST1="65.8.38.182"
TRUSTEDHOST2="65.8.38.183"

ipchains -A input -p tcp -s $TRUSTEDHOST1 -d $OUTERNET 22 -j ACCEPT
ipchains -A input -p tcp -s $TRUSTEDHOST2 -d $OUTERNET 22 -j ACCEPT

It makes it easier to make changes and to reuse the values for other rules.

More from the variables department.
I have this at the top of my script:
#capture the external ip address
extip="`/sbin/ifconfig eth0 | grep 'inet addr' | awk '{print $2}' | sed -e
's/.*://'`"
# EXTERNAL interface name
extint="eth0"
echo starting firewall on interface $extint, ip address: $extip

Then I use $extint and $extip throughout my script

I hope that helps.

----- Original Message -----
From: "dave" <d.eason at home.com>
To: "Linux & Unix Advocates & Users" <luau at maile.hi.net>
Sent: Tuesday, June 26, 2001 09:41 AM
Subject: [luau] simple question about a "rule"


> The pmfirewall script asked me if I wanted to allow access to SSH by ip
> I said yes, it created this rule for me
>
> #SSH
> $IPCHAINS -A input -p tcp -s 65.8.38.182 -d $OUTERNET 22 -j ACCEPT
>
>
> can I mimick that rule, and change the ip and paste it right below?
> There are only about 5 ip addresses, all static that need ssh access to
> my box.
>
>
>
> -Dave
>
>
> ---
> You are currently subscribed to luau as: garcian002 at hawaii.rr.com
> To unsubscribe send a blank email to $subst('Email.Unsub')
>



More information about the LUAU mailing list