[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Default Policy = DROP. Help-me



Em Qui, 2007-10-25 às 08:16 -0200, Yuri Rodrigues escreveu:
> Paolo,
> 
> Fiz desa forma porque realmente não sei como fazer este tipo de
> controle. Eu interessei pelo que você disse a mim.
> Pode me explicar melhor a funcionalidadae do "&&\" no final das
> linhas?
> 


vc pode ver pelo man bash


isto que dizer o segunte.

se a 1ª expressão for verdadeira faça a segunda e se a segunda for
verdadeira faça a 3ª

o && significa um and lógico e ele só ser´a verdadeiro se todas as
expressês forem verdadeiras . Em suma ele só vai rodar o programa se
todas as expressões estiverem ok. Se uma delas for dar erro ela não roda
nehuma....


[]s
> Grato,
> 
> 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



Reply to: