{"id":4922,"date":"2020-08-08T19:13:29","date_gmt":"2020-08-08T22:13:29","guid":{"rendered":"https:\/\/blog.clusterweb.com.br\/?p=4922"},"modified":"2020-08-08T19:13:29","modified_gmt":"2020-08-08T22:13:29","slug":"iptables-como-listar-e-deletar-regras-de-firewall","status":"publish","type":"post","link":"https:\/\/blog.clusterweb.com.br\/?p=4922","title":{"rendered":"iptables: Como listar e deletar regras de Firewall"},"content":{"rendered":"<p>Em alguns casos as regras de firewall de seu servidor podem limitar seu acesso ou impedir que algum sistema funcione adequadamente.<\/p>\n<p>Veja logo abaixo alguns comandos que auxiliam na manuten\u00e7\u00e3o das regras de firewall em seu servidor:<\/p>\n<p>&nbsp;<\/p>\n<h3>LISTAR TODAS AS REGRAS<\/h3>\n<pre># iptables -S<\/pre>\n<p>Exemplo:<\/p>\n<pre># iptables -S\r\n-P INPUT DROP\r\n-P FORWARD DROP\r\n-P OUTPUT DROP\r\n-N ALLOWIN\r\n-N ALLOWOUT\r\n-N DENYIN\r\n-N DENYOUT\r\n-N INVALID\r\n-N INVDROP\r\n-N LOCALINPUT\r\n-N LOCALOUTPUT\r\n-N LOGDROPIN\r\n-N LOGDROPOUT\r\n-N SMTPOUTPUT\r\n-N SYNFLOOD\r\n-A INPUT ! -i lo -p tcp -m tcp --dport 8889 -m limit --limit 100\/sec --limit-burst 150 -j ACCEPT\r\n-A INPUT ! -i lo -p tcp -m tcp --dport 8888 -m limit --limit 100\/sec --limit-burst 150 -j ACCEPT\r\n-A INPUT -s 8.8.4.4\/32 ! -i lo -p tcp -m tcp --dport 53 -j ACCEPT\r\n-A INPUT -s 8.8.4.4\/32 ! -i lo -p udp -m udp --dport 53 -j ACCEPT\r\n-A INPUT -s 8.8.4.4\/32 ! -i lo -p tcp -m tcp --sport 53 -j ACCEPT<\/pre>\n<h3><!--more--><br \/>\nLISTAR UMA CHAIN ESPEC\u00cdFICA<\/h3>\n<pre># iptables -S INPUT<\/pre>\n<p>Exemplo:<\/p>\n<pre># iptables -S INPUT\r\n-P INPUT DROP\r\n-A INPUT ! -i lo -p tcp -m tcp --dport 8889 -m limit --limit 100\/sec --limit-burst 150 -j ACCEPT\r\n-A INPUT ! -i lo -p tcp -m tcp --dport 8888 -m limit --limit 100\/sec --limit-burst 150 -j ACCEPT\r\n-A INPUT -s 8.8.4.4\/32 ! -i lo -p tcp -m tcp --dport 53 -j ACCEPT\r\n-A INPUT -s 8.8.4.4\/32 ! -i lo -p udp -m udp --dport 53 -j ACCEPT\r\n-A INPUT -s 8.8.4.4\/32 ! -i lo -p tcp -m tcp --sport 53 -j ACCEPT\r\n-A INPUT -s 8.8.4.4\/32 ! -i lo -p udp -m udp --sport 53 -j ACCEPT\r\n-A INPUT -s 8.8.8.8\/32 ! -i lo -p tcp -m tcp --dport 53 -j ACCEPT\r\n-A INPUT -s 8.8.8.8\/32 ! -i lo -p udp -m udp --dport 53 -j ACCEPT\r\n-A INPUT -s 8.8.8.8\/32 ! -i lo -p tcp -m tcp --sport 53 -j ACCEPT\r\n-A INPUT -s 8.8.8.8\/32 ! -i lo -p udp -m udp --sport 53 -j ACCEPT\r\n-A INPUT ! -i lo -j LOCALINPUT\r\n-A INPUT -i lo -j ACCEPT\r\n-A INPUT ! -i lo -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -j SYNFLOOD\r\n-A INPUT ! -i lo -p tcp -j INVALID\r\n-A INPUT ! -i lo -m state --state RELATED,ESTABLISHED -j ACCEPT\r\n-A INPUT ! -i lo -p tcp -m state --state NEW -m tcp --dport 20 -j ACCEPT\r\n-A INPUT ! -i lo -p tcp -m state --state NEW -m tcp --dport 21 -j ACCEPT\r\n-A INPUT ! -i lo -p tcp -m state --state NEW -m tcp --dport 25 -j ACCEPT\r\n-A INPUT ! -i lo -p tcp -m state --state NEW -m tcp --dport 53 -j ACCEPT\r\n-A INPUT ! -i lo -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT\r\n-A INPUT ! -i lo -p tcp -m state --state NEW -m tcp --dport 110 -j ACCEPT\r\n-A INPUT ! -i lo -p tcp -m state --state NEW -m tcp --dport 143 -j ACCEPT\r\n-A INPUT ! -i lo -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT\r\n-A INPUT ! -i lo -p tcp -m state --state NEW -m tcp --dport 465 -j ACCEPT\r\n-A INPUT ! -i lo -p tcp -m state --state NEW -m tcp --dport 587 -j ACCEPT\r\n-A INPUT ! -i lo -p tcp -m state --state NEW -m tcp --dport 993 -j ACCEPT\r\n-A INPUT ! -i lo -p tcp -m state --state NEW -m tcp --dport 995 -j ACCEPT\r\n-A INPUT ! -i lo -p tcp -m state --state NEW -m tcp --dport 2080 -j ACCEPT\r\n-A INPUT ! -i lo -p tcp -m state --state NEW -m tcp --dport 2082 -j ACCEPT\r\n-A INPUT ! -i lo -p tcp -m state --state NEW -m tcp --dport 2083 -j ACCEPT\r\n-A INPUT ! -i lo -p tcp -m state --state NEW -m tcp --dport 2086 -j ACCEPT\r\n-A INPUT ! -i lo -p tcp -m state --state NEW -m tcp --dport 2087 -j ACCEPT\r\n-A INPUT ! -i lo -p tcp -m state --state NEW -m tcp --dport 2095 -j ACCEPT\r\n-A INPUT ! -i lo -p tcp -m state --state NEW -m tcp --dport 2096 -j ACCEPT\r\n-A INPUT ! -i lo -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT\r\n-A INPUT ! -i lo -p tcp -m state --state NEW -m tcp --dport 4443 -j ACCEPT\r\n-A INPUT ! -i lo -p tcp -m state --state NEW -m tcp --dport 19000 -j ACCEPT\r\n-A INPUT ! -i lo -p tcp -m state --state NEW -m tcp --dport 49152:65534 -j ACCEPT\r\n-A INPUT ! -i lo -p udp -m state --state NEW -m udp --dport 20 -j ACCEPT\r\n-A INPUT ! -i lo -p udp -m state --state NEW -m udp --dport 21 -j ACCEPT\r\n-A INPUT ! -i lo -p udp -m state --state NEW -m udp --dport 53 -j ACCEPT\r\n-A INPUT ! -i lo -p icmp -m icmp --icmp-type 8 -m limit --limit 1\/sec -j ACCEPT\r\n-A INPUT ! -i lo -p icmp -m icmp --icmp-type 0 -m limit --limit 1\/sec -j ACCEPT\r\n-A INPUT ! -i lo -p icmp -m icmp --icmp-type 11 -j ACCEPT\r\n-A INPUT ! -i lo -p icmp -m icmp --icmp-type 3 -j ACCEPT\r\n-A INPUT ! -i lo -j LOGDROPIN<\/pre>\n<h3>\nLISTAR REGRAS COMO TABELA<\/h3>\n<pre># iptables -L<\/pre>\n<p>Exemplo:<\/p>\n<pre># iptables -L\r\nChain INPUT (policy DROP)\r\ntarget     prot opt source               destination\r\nACCEPT     tcp  --  anywhere             anywhere             tcp dpt:ddi-tcp-2 limit: avg 100\/sec burst 150\r\nACCEPT     tcp  --  anywhere             anywhere             tcp dpt:ddi-tcp-1 limit: avg 100\/sec burst 150\r\nACCEPT     tcp  --  google-public-dns-b.google.com  anywhere             tcp dpt:domain\r\nACCEPT     udp  --  google-public-dns-b.google.com  anywhere             udp dpt:domain\r\nACCEPT     tcp  --  google-public-dns-b.google.com  anywhere             tcp spt:domain\r\nACCEPT     udp  --  google-public-dns-b.google.com  anywhere             udp spt:domain\r\nACCEPT     tcp  --  google-public-dns-a.google.com  anywhere             tcp dpt:domain\r\nACCEPT     udp  --  google-public-dns-a.google.com  anywhere             udp dpt:domain\r\nACCEPT     tcp  --  google-public-dns-a.google.com  anywhere             tcp spt:domain\r\nACCEPT     udp  --  google-public-dns-a.google.com  anywhere             udp spt:domain\r\nLOCALINPUT  all  --  anywhere             anywhere\r\nACCEPT     all  --  anywhere             anywhere\r\nSYNFLOOD   tcp  --  anywhere             anywhere             tcp flags:FIN,SYN,RST,ACK\/SYN\r\nINVALID    tcp  --  anywhere             anywhere\r\nACCEPT     all  --  anywhere             anywhere             state RELATED,ESTABLISHED\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:ftp-data\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:ftp\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:smtp\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:domain\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:http\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:pop3\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:imap\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:https\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:urd\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:submission\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:imaps\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:pop3s\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:autodesk-nlm\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:infowave\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:radsec\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:gnunet\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:eli\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:nbx-ser\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:nbx-dir\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:mysql\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:pharos\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:igrid\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpts:49152:65534\r\n<\/pre>\n<h3>\nLISTAR UMA CHAIN ESPEC\u00cdFICA COMO TABELA<\/h3>\n<pre># iptables -L INPUT<\/pre>\n<p>Exemplo:<\/p>\n<pre># iptables -L INPUT\r\nChain INPUT (policy DROP)\r\ntarget     prot opt source               destination\r\nACCEPT     tcp  --  anywhere             anywhere             tcp dpt:ddi-tcp-2 limit: avg 100\/sec burst 150\r\nACCEPT     tcp  --  anywhere             anywhere             tcp dpt:ddi-tcp-1 limit: avg 100\/sec burst 150\r\nACCEPT     tcp  --  google-public-dns-b.google.com  anywhere             tcp dpt:domain\r\nACCEPT     udp  --  google-public-dns-b.google.com  anywhere             udp dpt:domain\r\nACCEPT     tcp  --  google-public-dns-b.google.com  anywhere             tcp spt:domain\r\nACCEPT     udp  --  google-public-dns-b.google.com  anywhere             udp spt:domain\r\nACCEPT     tcp  --  google-public-dns-a.google.com  anywhere             tcp dpt:domain\r\nACCEPT     udp  --  google-public-dns-a.google.com  anywhere             udp dpt:domain\r\nACCEPT     tcp  --  google-public-dns-a.google.com  anywhere             tcp spt:domain\r\nACCEPT     udp  --  google-public-dns-a.google.com  anywhere             udp spt:domain\r\nLOCALINPUT  all  --  anywhere             anywhere\r\nACCEPT     all  --  anywhere             anywhere\r\nSYNFLOOD   tcp  --  anywhere             anywhere             tcp flags:FIN,SYN,RST,ACK\/SYN\r\nINVALID    tcp  --  anywhere             anywhere\r\nACCEPT     all  --  anywhere             anywhere             state RELATED,ESTABLISHED\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:ftp-data\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:ftp\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:smtp\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:domain\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:http\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:pop3\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:imap\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:https\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:urd\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:submission\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:imaps\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:pop3s\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:autodesk-nlm\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:infowave\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:radsec\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:gnunet\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:eli\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:nbx-ser\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:nbx-dir\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:mysql\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:pharos\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:igrid\r\nACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpts:49152:65534\r\nACCEPT     udp  --  anywhere             anywhere             state NEW udp dpt:ftp-data\r\nACCEPT     udp  --  anywhere             anywhere             state NEW udp dpt:ftp\r\nACCEPT     udp  --  anywhere             anywhere             state NEW udp dpt:domain\r\nACCEPT     icmp --  anywhere             anywhere             icmp echo-request limit: avg 1\/sec burst 5\r\nACCEPT     icmp --  anywhere             anywhere             icmp echo-reply limit: avg 1\/sec burst 5\r\nACCEPT     icmp --  anywhere             anywhere             icmp time-exceeded\r\nACCEPT     icmp --  anywhere             anywhere             icmp destination-unreachable\r\nLOGDROPIN  all  --  anywhere             anywhere\r\n<\/pre>\n<h3>\nLISTAR A CONTAGEM DE PACOTES E TAMANHO AGREGADO POR REGRAS<\/h3>\n<pre># iptables -L INPUT -v<\/pre>\n<p>Exemplo:<\/p>\n<pre># iptables -L INPUT -v\r\nChain INPUT (policy DROP 0 packets, 0 bytes)\r\n pkts bytes target     prot opt in     out     source               destination\r\n    3   124 ACCEPT     tcp  --  !lo    any     anywhere             anywhere             tcp dpt:ddi-tcp-2 limit: avg 100\/sec burst 150\r\n  465 19628 ACCEPT     tcp  --  !lo    any     anywhere             anywhere             tcp dpt:ddi-tcp-1 limit: avg 100\/sec burst 150\r\n    0     0 ACCEPT     tcp  --  !lo    any     google-public-dns-b.google.com  anywhere             tcp dpt:domain\r\n    0     0 ACCEPT     udp  --  !lo    any     google-public-dns-b.google.com  anywhere             udp dpt:domain\r\n    0     0 ACCEPT     tcp  --  !lo    any     google-public-dns-b.google.com  anywhere             tcp spt:domain\r\n 141K 9784K ACCEPT     udp  --  !lo    any     google-public-dns-b.google.com  anywhere             udp spt:domain\r\n    0     0 ACCEPT     tcp  --  !lo    any     google-public-dns-a.google.com  anywhere             tcp dpt:domain\r\n    0     0 ACCEPT     udp  --  !lo    any     google-public-dns-a.google.com  anywhere             udp dpt:domain\r\n  537  342K ACCEPT     tcp  --  !lo    any     google-public-dns-a.google.com  anywhere             tcp spt:domain\r\n4755K  491M ACCEPT     udp  --  !lo    any     google-public-dns-a.google.com  anywhere             udp spt:domain\r\n  91M   40G LOCALINPUT  all  --  !lo    any     anywhere             anywhere\r\n5903K 3575M ACCEPT     all  --  lo     any     anywhere             anywhere\r\n2339K  132M SYNFLOOD   tcp  --  !lo    any     anywhere             anywhere             tcp flags:FIN,SYN,RST,ACK\/SYN\r\n  81M   39G INVALID    tcp  --  !lo    any     anywhere             anywhere\r\n  78M   39G ACCEPT     all  --  !lo    any     anywhere             anywhere             state RELATED,ESTABLISHED\r\n   61  2488 ACCEPT     tcp  --  !lo    any     anywhere             anywhere             state NEW tcp dpt:ftp-data\r\n 9267  513K ACCEPT     tcp  --  !lo    any     anywhere             anywhere             state NEW tcp dpt:ftp\r\n 322K   18M ACCEPT     tcp  --  !lo    any     anywhere             anywhere             state NEW tcp dpt:smtp\r\n   44  1960 ACCEPT     tcp  --  !lo    any     anywhere             anywhere             state NEW tcp dpt:domain\r\n1488K   86M ACCEPT     tcp  --  !lo    any     anywhere             anywhere             state NEW tcp dpt:http\r\n 104K 5496K ACCEPT     tcp  --  !lo    any     anywhere             anywhere             state NEW tcp dpt:pop3\r\n 7846  462K ACCEPT     tcp  --  !lo    any     anywhere             anywhere             state NEW tcp dpt:imap\r\n93399 5184K ACCEPT     tcp  --  !lo    any     anywhere             anywhere             state NEW tcp dpt:https\r\n 4386  240K ACCEPT     tcp  --  !lo    any     anywhere             anywhere             state NEW tcp dpt:urd\r\n 175K 9442K ACCEPT     tcp  --  !lo    any     anywhere             anywhere             state NEW tcp dpt:submission\r\n15377  928K ACCEPT     tcp  --  !lo    any     anywhere             anywhere             state NEW tcp dpt:imaps\r\n 5755  344K ACCEPT     tcp  --  !lo    any     anywhere             anywhere             state NEW tcp dpt:pop3s\r\n    1    40 ACCEPT     tcp  --  !lo    any     anywhere             anywhere             state NEW tcp dpt:autodesk-nlm\r\n  100  5872 ACCEPT     tcp  --  !lo    any     anywhere             anywhere             state NEW tcp dpt:infowave\r\n 2718  151K ACCEPT     tcp  --  !lo    any     anywhere             anywhere             state NEW tcp dpt:radsec\r\n    2    80 ACCEPT     tcp  --  !lo    any     anywhere             anywhere             state NEW tcp dpt:gnunet\r\n 1343 75584 ACCEPT     tcp  --  !lo    any     anywhere             anywhere             state NEW tcp dpt:eli\r\n  151  8220 ACCEPT     tcp  --  !lo    any     anywhere             anywhere             state NEW tcp dpt:nbx-ser\r\n12091  632K ACCEPT     tcp  --  !lo    any     anywhere             anywhere             state NEW tcp dpt:nbx-dir\r\n24325 1391K ACCEPT     tcp  --  !lo    any     anywhere             anywhere             state NEW tcp dpt:mysql\r\n  199  7972 ACCEPT     tcp  --  !lo    any     anywhere             anywhere             state NEW tcp dpt:pharos\r\n   14   724 ACCEPT     tcp  --  !lo    any     anywhere             anywhere             state NEW tcp dpt:igrid\r\n 4132  210K ACCEPT     tcp  --  !lo    any     anywhere             anywhere             state NEW tcp dpts:49152:65534\r\n    0     0 ACCEPT     udp  --  !lo    any     anywhere             anywhere             state NEW udp dpt:ftp-data\r\n    0     0 ACCEPT     udp  --  !lo    any     anywhere             anywhere             state NEW udp dpt:ftp\r\n   44  2826 ACCEPT     udp  --  !lo    any     anywhere             anywhere             state NEW udp dpt:domain\r\n  964 62604 ACCEPT     icmp --  !lo    any     anywhere             anywhere             icmp echo-request limit: avg 1\/sec burst 5\r\n    0     0 ACCEPT     icmp --  !lo    any     anywhere             anywhere             icmp echo-reply limit: avg 1\/sec burst 5\r\n   35  3300 ACCEPT     icmp --  !lo    any     anywhere             anywhere             icmp time-exceeded\r\n  206 14999 ACCEPT     icmp --  !lo    any     anywhere             anywhere             icmp destination-unreachable\r\n25936 1519K LOGDROPIN  all  --  !lo    any     anywhere             anywhere<\/pre>\n<h3>\nRESETAR A CONTAGEM DE PACOTES E TAMANHO AGREGADO<\/h3>\n<p>Reseta todas as regras<\/p>\n<pre># iptables -Z<\/pre>\n<p>Reseta somente a CHAIN desejada<\/p>\n<pre># iptables -Z INPUT<\/pre>\n<h3>\nEXIBIR\u00a0REGRAS IPTABLES NUMERADAS<\/h3>\n<pre># iptables -L --line-numbers<\/pre>\n<p>Exemplo:<\/p>\n<pre># iptables -L --line-numbers\r\nChain INPUT (policy DROP)\r\nnum  target     prot opt source               destination\r\n1    ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:ddi-tcp-2 limit: avg 100\/sec burst 150\r\n2    ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:ddi-tcp-1 limit: avg 100\/sec burst 150\r\n3    ACCEPT     tcp  --  google-public-dns-b.google.com  anywhere             tcp dpt:domain\r\n4    ACCEPT     udp  --  google-public-dns-b.google.com  anywhere             udp dpt:domain\r\n5    ACCEPT     tcp  --  google-public-dns-b.google.com  anywhere             tcp spt:domain\r\n6    ACCEPT     udp  --  google-public-dns-b.google.com  anywhere             udp spt:domain\r\n7    ACCEPT     tcp  --  google-public-dns-a.google.com  anywhere             tcp dpt:domain\r\n8    ACCEPT     udp  --  google-public-dns-a.google.com  anywhere             udp dpt:domain\r\n9    ACCEPT     tcp  --  google-public-dns-a.google.com  anywhere             tcp spt:domain\r\n10   ACCEPT     udp  --  google-public-dns-a.google.com  anywhere             udp spt:domain\r\n11   LOCALINPUT  all  --  anywhere             anywhere\r\n12   ACCEPT     all  --  anywhere             anywhere\r\n13   SYNFLOOD   tcp  --  anywhere             anywhere             tcp flags:FIN,SYN,RST,ACK\/SYN\r\n14   INVALID    tcp  --  anywhere             anywhere\r\n15   ACCEPT     all  --  anywhere             anywhere             state RELATED,ESTABLISHED\r\n16   ACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:ftp-data\r\n17   ACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:ftp\r\n18   ACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:smtp\r\n19   ACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:domain\r\n20   ACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:http\r\n<\/pre>\n<h3>\nREMOVER REGRA ESPECIFICA<\/h3>\n<p>Remove a regra n\u00famero 3 da CHAIN INPUT:<\/p>\n<pre># iptables -D INPUT 3<\/pre>\n<p>&nbsp;<\/p>\n<h3>FLUSH CHAIN<\/h3>\n<p>Simples CHAIN:<\/p>\n<pre># iptables -F INPUT<\/pre>\n<p>Todas as CHAINS:<\/p>\n<pre># iptables -F<\/pre>\n<p>&nbsp;<\/p>\n<h3>REMOVER TODAS AS REGRAS, DELETAR TODAS AS CHAINS E ACEITAR TODO O TR\u00c1FEGO<\/h3>\n<p>Primeiro, libere todo o tr\u00e1fego no servidor:<\/p>\n<pre># iptables -P INPUT ACCEPT\r\n# iptables -P FORWARD ACCEPT\r\n# iptables -P OUTPUT ACCEPT<\/pre>\n<p>Agora, limpe todas as chains incluindo a NAT e MANGLE.<br \/>\nLembre-se: -F (limpar) e -X (Remover):<\/p>\n<pre># iptables -t nat -F\r\n# iptables -t mangle -F\r\n# iptables -F\r\n# iptables -X<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Em alguns casos as regras de firewall de seu servidor podem limitar seu acesso ou impedir que algum sistema funcione adequadamente. Veja logo abaixo alguns comandos que auxiliam na manuten\u00e7\u00e3o das regras de firewall em seu servidor: &nbsp; LISTAR TODAS AS REGRAS # iptables -S Exemplo: # iptables -S -P INPUT DROP -P FORWARD DROP [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1082,1,730,830,79,42,51,495,68,271,548],"tags":[378,353,1482,351,80,117,1481,263],"class_list":["post-4922","post","type-post","status-publish","format-standard","hentry","category-centos-7-rhel-7","category-viazap","category-clusterweb","category-debian","category-firewall","category-leitura-recomendada","category-linux-linuxrs","category-profissional-de-ti","category-redes-2","category-seguranca-2","category-ubuntu-2","tag-como","tag-de","tag-deletar","tag-e","tag-firewall-2","tag-iptables","tag-listar","tag-regras"],"_links":{"self":[{"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=\/wp\/v2\/posts\/4922","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4922"}],"version-history":[{"count":1,"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=\/wp\/v2\/posts\/4922\/revisions"}],"predecessor-version":[{"id":4923,"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=\/wp\/v2\/posts\/4922\/revisions\/4923"}],"wp:attachment":[{"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4922"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4922"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4922"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}