Inserir comentários em regras do iptables
Dica publicada em Linux / Segurança
Inserir comentários em regras do iptables
O iptables tem um módulo chamado "comment" para inserir comentários nas regras. Seu efeito é que os comentários irão aparecer ao executar um iptables -L.
Exemplo:
# iptables -A INPUT -p tcp --dport 22 -j ACCEPT -m comment --comment "Liberando SSH"
# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh /* Liberando SSH */
Observe que aparece a string de comentário na listagem.
Exemplo:
# iptables -A INPUT -p tcp --dport 22 -j ACCEPT -m comment --comment "Liberando SSH"
# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh /* Liberando SSH */
Observe que aparece a string de comentário na listagem.
Thanks!