Search This Blog

Thursday, October 25, 2007

Re: Default Policy = DROP. Help-me

Paolo,

I really disappeared way because I do not know how to do this kind of
control. I interested by what you said to me.
Can I explain better the funcionalidadae the "&&\" at the end of the lines?

Thank you,

Yuri Rodrigues

Paolo escreveu:
> On Wed, Oct 24, 2007 at 03:57:08PM -0200, Yuri Rodrigues wrote:
>
>> # Firewall System
>> # Author - Yuri Rodrigues
>> # Mail - yurirbraz@gmail.com
>>
> ...
>
>> $iptables -t mangle -P OUTPUT ACCEPT
>> $iptables -t mangle -P INPUT ACCEPT
>> $iptables -t mangle -P POSTROUTING ACCEPT
>> echo "Policing .......................................... [ OK ]"
>>
> ...
>
>> modprobe iptable_mangle
>> modprobe iptable_nat
>> echo "0" > /proc/sys/net/ipv4/ip_forward
>> echo "Loading Modules ................................... [ OK ]"
>>
>
> that's the wrong way of saying 'OK'; you want to say 'OK' if all went really
> ok, else say 'NOK!' and perhaps bailout, ie something like:
>
> ...
> $iptables -t mangle -P OUTPUT ACCEPT &&\
> $iptables -t mangle -P INPUT ACCEPT &&\
> $iptables -t mangle -P POSTROUTING ACCEPT &&\
> echo "Policing .......................................... [ OK ]" || {
> echo "Something broke in 'Policing'!"
> exit 1
> }
> ...
> modprobe iptable_mangle &&\
> modprobe iptable_nat &&\
> echo "0" > /proc/sys/net/ipv4/ip_forward &&\
> echo "Loading Modules ................................... [ OK ]" || {
> echo "Something broke in 'Modules Loading'!"
> exit 2
> }
> ...
>
> or set 'set -e' but then your script would just exit on 1st error without
> telling too much.
>
> --
> paolo
>
>
>


--
To UNSUBSCRIBE, email to debian-firewall-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

No comments: