From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-ID: <3E708C52.50700@symmetron.msk.ru> Date: Thu, 13 Mar 2003 16:49:06 +0300 From: =?KOI8-R?Q?=F7=CC=C1=C4=C9=CD=C9=D2?= User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; ru-RU; rv:1.2.1) Gecko/20021123 X-Accept-Language: ru-ru, en MIME-Version: 1.0 To: community@altlinux.ru X-Enigmail-Version: 0.70.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------060900060004020700060308" Subject: [Comm] patch for iptables startup script Sender: community-admin@altlinux.ru Errors-To: community-admin@altlinux.ru X-BeenThere: community@altlinux.ru X-Mailman-Version: 2.0.9 Precedence: bulk Reply-To: community@altlinux.ru List-Unsubscribe: , List-Id: List-Post: List-Help: List-Subscribe: , List-Archive: Archived-At: List-Archive: List-Post: This is a multi-part message in MIME format. --------------060900060004020700060308 Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 8bit Привет всем. Продолжаю знакомство с master-2.2 Порадовало наличие возможности подгружать необходимые модули для iptables по записям в конфигурационном файле. Небольшое дополнение - автогенерирование конфигурационного файла для модулей. patch iptables diff-iptables добавит функцию save_modules() и параметр save-mod Появляется возможность при загруженных iptables вручную добавить необходимые модули (modprobe ) и зафиксировать это в конфигурационном файле. Дополнительная зависимость - в системе должен быть инсталлирован пакет textutils (команда cut). -- Best regards Vladimir --------------060900060004020700060308 Content-Type: text/plain; name="diff-iptables" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diff-iptables" --- /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 - --------------060900060004020700060308--