URLフィルタリング・部分ドメインの指定(その2)
「URLフィルタリング・部分ドメインの指定(その1)」の続きです。
「URLフィルタリング(その1)」~「URLフィルタリング(その6)」でRouter_Aに設定した内容を変更していきます。
ネットワークの構成は、下図のとおりです。

※ブロードバンドルータには、IPマスカレードの設定をしておきます。
URLリストの削除
「goo」と「Yahoo!」のURLリストを削除します。
Router_A(config)#no ip urlfilter exclusive-domain deny www.goo.ne.jp
Router_A(config)#no ip urlfilter exclusive-domain deny www.yahoo.co.jp
URLリストの追加
部分ドメイン「.goo.ne.jp」、「.yahoo.co.jp」をURLリストに追加します。
「.goo.ne.jp」には、「goo」、「goo 辞書」がマッチすることになります。
「.yahoo.co.jp」には、「Yahoo!」、「Yahoo!きっず」がマッチすることになります。
Router_A(config)#ip urlfilter exclusive-domain deny .goo.ne.jp
Router_A(config)#ip urlfilter exclusive-domain deny .yahoo.co.jp
部分ドメイン指定のURLフィルタリングの検証
ブラウザを起動して、「goo」、「goo 辞書」、「Yahoo!」、「Yahoo!きっず」の全てのサイトにアクセスしてみます。
すると全てのサイトにアクセスできないことが確認できます。

●Router_Aの設定
! version 12.4 service config service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname Router_A ! boot-start-marker boot-end-marker ! enable password cisco ! no aaa new-model memory-size iomem 25 ! ip cef ip inspect name URL_FILTER http urlfilter ip urlfilter allow-mode on ip urlfilter exclusive-domain deny .goo.ne.jp ip urlfilter exclusive-domain deny .yahoo.co.jp ! interface Ethernet0 ip address 192.168.1.1 255.255.255.0 half-duplex ! interface FastEthernet0 ip address 192.168.2.1 255.255.255.0 ip inspect URL_FILTER in speed auto ! ip forward-protocol nd ip route 0.0.0.0 0.0.0.0 192.168.1.254 no ip http server no ip http secure-server ! control-plane ! line con 0 line aux 0 line vty 0 4 password cisco login ! end
このように部分ドメイン名をうまく指定することで、URLリストの数を減らすことができます。