[AsteriskBrasil] iptables e fail2ban

Oséias Ferreira ferreira.oseias em gmail.com
Domingo Outubro 10 15:23:46 BRT 2010


Em 8 de outubro de 2010 12:11, SkFogo <skfogo em gmail.com> escreveu:
> Mas você alterou para a 5061?
>
> Tenta assim:
>
> iptables -D INPUT -p tcp -m multiport --dport 5060:5060 -j ACCEPT
>

Se não funciona assim:
iptables -D INPUT -p tcp -m multiport --dport 5060:5061 -j ACCEPT

não é assim que vai funcionar:
iptables -D INPUT -p tcp -m multiport --dport 5060:5060 -j ACCEPT


Primeiro:
Não faz o menor sentido fazer range de uma porta só.
poderria ser escrito assim:
iptables -D INPUT -p tcp --dport 5060 -j ACCEPT
se o intuito fosse deletar tal regra do firewall.


Segundo:
Para funcionar, primeiramente tente man iptables.
Você deverá ver algo assim:

  -A, --append chain rule-specification
              Append one or more rules to the end of the selected chain.  When
              the  source  and/or  destination  names resolve to more than one
              address, a rule will be added for each possible address combina‐
              tion.

-D, --delete chain rule-specification
-D, --delete chain rulenum
              Delete one or more rules from the selected chain.  There are two
              versions of this command: the rule can be specified as a  number
              in  the  chain  (starting  at 1 for the first rule) or a rule to
              match.

Portanto para adicionar uma regra no iptables é preciso -A:
iptables -A INPUT -p tcp -m multiport --dport 5060:5061 -j ACCEPT
etc, etc.

-- 
Oséias Ferreira.


Mais detalhes sobre a lista de discussão AsteriskBrasil