erro no protocolo [RESOLVIDO]

1. erro no protocolo [RESOLVIDO]

carlos eduardo da silva braga
cadu405

(usa Outra)

Enviado em 24/05/2020 - 18:48h

Boa noite!
Estou iniciando Iptables na faculdade e durante a pratica dos exercicios fui tentar implementar a seguinte regra:
iptables -A INPUT -s 200.18.33.0/24 -p smtp -j ACCEPT

Porém apresenta esse erro:
iptables v1.8.4 (legacy): unknown protocol "smtp" specified
Try `iptables -h' or 'iptables --help' for more information.
alguém sabe me informar onde está o meu erro?


  


2. MELHOR RESPOSTA

Carlos A. P. Cunha
Carlos_Cunha

(usa Linux Mint)

Enviado em 25/05/2020 - 18:49h

Esta ocorrendo o erro por o protocolo smtp não pode ser informado por nome, e sim por porta(25/465/etc), para nome são alguns apenas
Como tcp/udp/icmp..., segue o as informações do man





-->> https://linux.die.net/man/8/iptables

[!] -p, --protocol protocol
The protocol of the rule or of the packet to check. The specified protocol can be one of tcp, udp, udplite, icmp, icmpv6,esp, ah,
sctp, mh or the special keyword "all", or it can be a numeric value, representing one of these protocols or a different one. A pro‐
tocol name from /etc/protocols is also allowed. A "!" argument before the protocol inverts the test. The number zero is equivalent
to all. "all" will match with all protocols and is taken as default when this option is omitted. Note that, in ip6tables, IPv6
extension headers except esp are not allowed. esp and ipv6-nonext can be used with Kernel version 2.6.11 or later. The number zero
is equivalent to all, which means that you cannot test the protocol field for the value 0 directly. To match on a HBH header, even if
it were the last, you cannot use -p 0, but always need -m hbh.



#-------------------------------------------------------------------------------------#
Administrador de Redes Mistas Linux/Windows
LPI 101-102
LPI 201
Para consultas particulares acesse:
www.cunhatec.com.br

"Falar é fácil, me mostre o código." - Linus Torvalds





Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts