From: Владимир <fmfm@symmetron.msk.ru>
To: community@altlinux.ru
Subject: [Comm] patch for iptables startup script
Date: Thu, 13 Mar 2003 16:49:06 +0300
Message-ID: <3E708C52.50700@symmetron.msk.ru> (raw)
[-- Attachment #1: Type: text/plain, Size: 596 bytes --]
Привет всем.
Продолжаю знакомство с master-2.2
Порадовало наличие возможности подгружать
необходимые модули для iptables по записям
в конфигурационном файле.
Небольшое дополнение - автогенерирование
конфигурационного файла для модулей.
patch iptables diff-iptables
добавит функцию save_modules() и параметр save-mod
Появляется возможность при загруженных iptables вручную
добавить необходимые модули (modprobe <module>) и
зафиксировать это в конфигурационном файле.
Дополнительная зависимость - в системе должен быть
инсталлирован пакет textutils (команда cut).
--
Best regards
Vladimir
[-- Attachment #2: diff-iptables --]
[-- Type: text/plain, Size: 809 bytes --]
--- /etc/init.d/iptables 2002-11-26 17:12:09 +0300
+++ iptables 2003-03-13 16:23:40 +0300
@@ -60,6 +60,10 @@
fi
}
+save_modules() {
+ lsmod | egrep "^ip_nat_|^ip_conntrack_" | cut -d " " -f1 | sort > $IPTABLES_MODCONFIG
+}
+
start() {
# don't do squat if we don't have the config file
if [ -f $IPTABLES_CONFIG ]; then
@@ -181,10 +185,17 @@
echo
;;
+ save-mod)
+ echo -n $"Saving config netfilter modules to $IPTABLES_MODCONFIG: "
+ save_modules
+ success $"Saving config netfilter modules to $IPTABLES_MODCONFIG" || \
+ failure $"Saving config netfilter modules to $IPTABLES_MODCONFIG"
+ echo
+ ;;
+
*)
- echo $"Usage: $0 {start|stop|restart|condrestart|status|panic|save}"
+ echo $"Usage: $0 {start|stop|restart|condrestart|status|panic|save|save-mod}"
exit 1
esac
exit 0
-
reply other threads:[~2003-03-13 13:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3E708C52.50700@symmetron.msk.ru \
--to=fmfm@symmetron.msk.ru \
--cc=community@altlinux.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Community general discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
public-inbox-index community
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.community
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git