Systemverwaltungshandbuch: IP Services

ProcedureSo verhindern Sie IP-Spoofing

Um IP-Spoofing auszuschließen, muss das System daran gehindert werden, Pakete ohne Entschlüsselung an eine andere Schnittstelle weiterzuleiten. Eine Methode ist das Festlegen der strengen IP-Ziel-Multihoming-Parameter mithilfe des Befehls ndd. Wird dieser Parameter in einem SMF-Manifest festgelegt, wird er beim erneuten Booten des Systems eingestellt.


Hinweis –

Führen Sie die Schritte dieses Verfahrens auf beiden Systemen aus.


  1. Nehmen Sie über die Systemkonsole die Rolle eines Primäradministrators an, oder melden Sie sich als Superuser an.

    Die Rolle des Primäradministrators enthält das Primary Administrator-Profil. Informationen zum Erstellen von Rollen und Zuweisen von Rollen zu Benutzern finden Sie in Kapitel 2, Working With the Solaris Management Console (Tasks) in System Administration Guide: Basic Administration.

  2. Erstellen Sie das standortspezifische SMF-Manifest zur Verhinderung von IP-Spoofing.

    Verwenden Sie das Beispielskript /var/svc/manifest/site/spoof_check.xml.

    <?xml version="1.0"?>
    <!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
    
    <service_bundle type='manifest' name='Custom:ip_spoof_checking'>
    
    <!--    This is a custom smf(5) manifest for this system. Place this
            file in /var/svc/manifest/site, the directory for local
            system customizations. The exec method uses an unstable
            interface to provide a degree of protection against IP
            spoofing attacks when this system is acting as a router.
    
            IP spoof protection can also be achieved by using ipfilter(5).
            If ipfilter is configured, this service can be disabled.
    
            Note: Unstable interfaces might be removed in later
            releases.  See attributes(5).
    -->
    
    <service
            name='site/ip_spoofcheck'
            type='service'
            version='1'>
    
            <create_default_instance enabled='false' />
            <single_instance />
    
            <!--    Don't enable spoof protection until the
                    network is up.
            -->
            <dependency
                    name='basic_network'
                    grouping='require_all'
                    restart_on='none'
                    type='service'>
            <service_fmri value='svc:/milestone/network' />
            </dependency>
    
            <exec_method
                    type='method'
                    name='start'
                    exec='/usr/sbin/ndd -set /dev/ip ip_strict_dst_multihoming 1'
    <!--    
         For an IPv6 network, use the IPv6 version of this command, as in:
                    exec='/usr/sbin/ndd -set /dev/ip ip6_strict_dst_multihoming 1
    -->
                    timeout_seconds='60'
            />
    
            <exec_method
                    type='method'
                    name='stop'
                    exec=':true'
                    timeout_seconds='3'
            />
    
            <property_group name='startd' type='framework'>
                    <propval
                            name='duration'
                            type='astring'
                            value='transient'
                    />
            </property_group>
    
            <stability value='Unstable' />
    
    </service>
    </service_bundle>
  3. Importieren Sie dieses Manifest in das SMF-Repository.


    # svccfg import /var/svc/manifest/site/spoof_check.xml
    
  4. Aktivieren Sie den ip_spoofcheck-Service.

    Verwenden Sie den Namen, der im Manifest /site/ip_spoofcheck definiert wird.


    # svcadm enable /site/ip_spoofcheck
    
  5. Stellen Sie sicher, dass der ip_spoofcheck-Service online ist.


    # svcs /site/ip_spoofcheck