Skip to content

Instantly share code, notes, and snippets.

@olivx
Last active November 5, 2021 20:10
Show Gist options
  • Save olivx/ba61dfe9b98d82b3a70078102eed16dc to your computer and use it in GitHub Desktop.
Save olivx/ba61dfe9b98d82b3a70078102eed16dc to your computer and use it in GitHub Desktop.
Incluir regras de firewall:
iptables -t nat -A PREROUTING -p udp --dport <31001> -i ens3 -j DNAT --to <ip-destino>:<porta-destino> <- ip:port
Listar regras de firewall:
iptables -t nat -nL --lin
Deletar regra:
iptables -t nat -D PREROUTING <numero de regra> <- 1
iptables -t nat -D PREROUTING -p udp --dport 80 -i ens3 -j DNAT --to <ip-destino>:<porta-destino>
Para eliminar a regra tem que ter todas as condicoes iguais.
tcpdump -i ens3 -Nnl udp and port 80
Mostrar todos os pacotes filtrados por protocolo e numero de porta.
watch -n0 iptables -t nat -v -nL PREROUTING
Comando para verificar todos os pacotes sendo enviados atraves do PREROUTING
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment