iptables question
Noah
noah-list at enabled.com
Wed Dec 31 23:33:46 UTC 2014
Hi there,
Merry Gnu Year!
Ive read this page and still not understanding something
https://help.ubuntu.com/community/IptablesHowTo
I am using Solution #2 for saving and installing iptables rules on
reboot: /etc/network/if-pre-up.d and ../if-post-down.d
I am trying to figure out the best method for adding "--log-prefix
"iptables denied: " --log-level 7" to my log line
so this line is:
-A block-and-log -m limit --limit 1/sec --limit-burst 20 -j LOG
should be this:
-A block-and-log -m limit --limit 1/sec --limit-burst 20 -j LOG
--log-prefix "iptables denied: " --log-level 7
How do I change that upon reboot. Here are some files to keep in mind:
root at www-virt:/etc# cat /etc/network/if-pre-up.d/iptablesload
#!/bin/sh
iptables-restore < /etc/iptables.rules
exit 0
root at www-virt:/etc# cat /etc/network/if-post-down.d/iptablessave
#!/bin/sh
iptables-save -c > /etc/iptables.rules
if [ -f /etc/iptables.downrules ]; then
iptables-restore < /etc/iptables.downrules
fi
exit 0
Thanks
More information about the ubuntu-users
mailing list