🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.sys.sun.admin
Article #14462

Re: ipfilter problem solaris10

#14462
From: Koro
Date: Mon, 15 Oct 2007 07:51
110 lines
3990 bytes
Koro pisze:
> Mam dziwny problem z ipfilter. Nie ładuje mi sterownika karty sieciowej 
> podczas startu z pliczku /etc/ipf/pfil.ap. Karta to bge0.
> Usługi wstają przy starcie ale firewall nie filtruje
> svcs -a | grep pfil
> online         13:11:14 svc:/network/pfil:default
> online         13:11:20 svc:/network/ipfilter:default
> online         13:11:20 svc:/system/rmtmpfiles:default
> 
>  ipfstat |  grep packets
> bad packets:            in 0    out 0
>  IPv6 packets:          in 0 out 0
>  input packets:         blocked 0 passed 0 nomatch 0 counted 0 short 0
> output packets:         blocked 0 passed 0 nomatch 0 counted 0 short 0
>  input packets logged:  blocked 0 passed 0
> output packets logged:  blocked 0 passed 0
>  packets logged:        input 0 output 0
> 
>  ifconfig bge0 modlist
> 0 arp
> 1 ip
> 2 bge
> 
> 
> W związku z tym spróbowałem ręcznie załadować
> 
> ifconfig bge0 modinsert pfil@2
> autopush -f /etc/ipf/pfil.ap
> ifconfig bge0 unplumb
> ifconfig bge0 plumb
> 
> Jak ręcznie zrobię to wszystko chodzi jak należy, ale po ponownym 
> restarcie znowu to samo. Może ktoś z was wie w jaki sposób zrobić, żeby 
> ładowało w trakcie startu ??
> 
> 
> 

Znalazłem rozwiązanie. Moja maszyna jest regularnie patchowana, i 
któregoś razy wywaliło mi skrypt odpowiedzialny za ładowanie modułów w
/lib/svc/method/pfil

cat /lib/svc/method/pfil


cat pfil

#!/sbin/sh
#
# ident "@(#)pfil       1.5     07/05/15 SMI"
#
# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#

exit 0


A więc widzimy że jedyne co pozostało w tym pliku to Copyright:)
Zastąpiłem skrypt z niezpatchowanej maszyny i wszystko chodzi jak 
należy. Powinien on byc takiej treści.

# /lib/svc/method/pfil
#!/sbin/sh
#
# ident "@(#)pfil       1.2     04/11/24 SMI"
#
# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#

#
# Autopush pfil on to filtering interfaces and restrict
# network traffic during startup
#


PFILAP=/etc/ipf/pfil.ap

case "$1" in
'start')
         /sbin/autopush -f ${PFILAP}
         enabled=`svcprop -p general/enabled svc:/network/ipfilter:default`

         # To avoid a window of vulnerability during the time that 
networking
         # is being initialized but before the full ipf.conf 
configuration is
         # loaded, install a temporary, restrictive rule set now, early in
         # boot.  This gets replaced by the contents of ipf.conf when the
         # svc:/network/ipfilter service is started.  Note that if /usr 
is not
         # mounted, the window of vulnerability still exists because we 
can't
         # run the ipf command this early.

         if [ -x /usr/sbin/ipf ] && [ "$enabled" = "true" ]; then
                 echo "block in all" | /usr/sbin/ipf -Fa -f -
                 echo "block out all" | /usr/sbin/ipf -f -
                 echo "pass out from any to any port = 53 keep state" \
                      | /usr/sbin/ipf -f -
         fi
         ;;

*)
         echo "Usage: $0 start"
         exit 1
         ;;
esac
exit 0
Technical Details
Message-ID: <fev65j$bn$1@inews.gazeta.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!not-for-mail
References: <feqau8$drd$1@inews.gazeta.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!not-for-mail
From: Koro <koro@o2.pl>
Newsgroups: pl.comp.sys.sun.admin
Subject: Re: ipfilter problem solaris10
Date: Mon, 15 Oct 2007 09:51:15 +0200
Organization: "Portal Gazeta.pl -> http://www.gazeta.pl"
Lines: 110
Message-ID: <fev65j$bn$1@inews.gazeta.pl>
References: <feqau8$drd$1@inews.gazeta.pl>
NNTP-Posting-Host: 212.33.72.131
Mime-Version: 1.0
X-Trace: inews.gazeta.pl 1192434675 375 212.33.72.131 (15 Oct 2007 07:51:15 GMT)
X-Complaints-To: usenet@agora.pl
NNTP-Posting-Date: Mon, 15 Oct 2007 07:51:15 +0000 (UTC)
X-User: korobass
In-Reply-To: <feqau8$drd$1@inews.gazeta.pl>
User-Agent: Thunderbird 2.0.0.6 (Windows/20070728)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit