* [Comm] patch for iptables startup script
@ 2003-03-13 13:49 Владимир
0 siblings, 0 replies; only message in thread
From: Владимир @ 2003-03-13 13:49 UTC (permalink / raw)
To: community
[-- 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
-
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-03-13 13:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-13 13:49 [Comm] patch for iptables startup script Владимир
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