Created
May 10, 2015 12:37
-
-
Save BenKnisley/8034e559c54e52cf98dd to your computer and use it in GitHub Desktop.
Iptables Traffic Monitor
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
## Create new chain | |
iptables -N <Name> | |
## Create outgoing monitor | |
iptables -A INPUT -s <IpAddr> -j <Name> | |
## Create incoming monitor | |
iptables -D INPUT -s <IpAddr> -j <Name> |
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
## Delete outgoing | |
iptables -D INPUT -s <IpAddr> -j <Name> | |
## Delete incomming | |
iptables -D OUTPUT -d <IpAddr> -j <Name> | |
## Delete chain | |
iptables -X <Name> |
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
## To read outgoing | |
iptables -L INPUT -vnx | grep <Name> | |
## To read incomming | |
iptables -L OUTPUT -vnx | grep <Name> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment