Last active
August 29, 2015 14:07
-
-
Save gdm85/652b4e1b355f6fc115e1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## iptables-debug.sh | |
## | |
## @author gdm85 | |
## | |
## debug some iptables traffic | |
# | |
IPT=/sbin/iptables | |
## you can use multiple ports to be ignored | |
IGNORE_PORTS=22 | |
set -e | |
$IPT -t nat -I PREROUTING -m multiport ! --dports $IGNORE_PORTS -j LOG --log-prefix "iptables debug PREROUTING: " --log-level 6 | |
$IPT -I INPUT -p tcp -m multiport ! --dports $IGNORE_PORTS -j LOG --log-prefix "iptables debug INPUT: " --log-level 6 | |
$IPT -I FORWARD -p tcp -m multiport ! --dports $IGNORE_PORTS -j LOG --log-prefix "iptables debug FORWARD: " --log-level 6 | |
$IPT -t nat -I DOCKER -m limit --limit 5/min ! --dports $IGNORE_PORTS -j LOG --log-prefix "iptables debug DOCKER: " --log-level 6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment