システムがパケットの復号化を試みずに別のインタフェースに転送することを防止するには、IP のスプーフィングをチェックする必要があります。その方法の 1 つは、ndd コマンドを使用して IP 厳密宛先マルチホームのパラメータを設定することです。SMF マニフェストでこのパラメータが設定されている場合、システムのリブート時にこのパラメータが設定されます。
両方のシステムでこの手順を実行してください。
システムコンソール上で、Primary Administrator の役割を引き受けるか、スーパーユーザーになります。
Primary Administrator 役割には、Primary Administrator プロファイルが含まれます。役割を作成してユーザーに役割を割り当てるには、『Solaris のシステム管理 (基本編)』の第 2 章「Solaris 管理コンソールの操作 (手順)」を参照してください。
IP のスプーフィングをチェックするように、サイト固有の SMF マニフェストを作成します。
次のサンプルスクリプト /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>
このマニフェストを SMF リポジトリにインポートします。
# svccfg import /var/svc/manifest/site/spoof_check.xml |
ip_spoofcheck サービスを有効にします。
マニフェストで定義されている名前 /site/ip_spoofcheck を使用します。
# svcadm enable /site/ip_spoofcheck |
ip_spoofcheck サービスがオンラインになっていることを確認します。
# svcs /site/ip_spoofcheck |