ポリシーベースルーティング(送信元 その1)
標準的なルーティングでは、宛先への最短パスに基づいてルーティングが行われます。ポリシーベースルーティングでは、管理者がルーティング処理に関して、送信元アドレスやトラフィックタイプなどに基づいて関与することができます。
ここでは、送信元IPベースによるポリシーベースルーティングの設定を行っていきます。
ポリシーベースルーティングを有効にするには、対象となるトラフィックが入ってくるルータの入力インターフェイスにポリシーを適用します。
ポリシーベースルーティングの設定手順
- 対象となるトラフィックをACLで指定する。
- ルートマップでポリシーを作成する。
- インターフェイスにポリシーを適用させる。
ポリシーを適用させるインターフェイス上で以下のコマンドを入力します。
Router(config-if)#ip policy route-map name
name: ルートマップの名前
まず、下のネットワークを構築します。

Router_A、Router_Bでは、ルーティングプロトコルの設定は行いません。これには理由があります。
理由については、こちら「ポリシーベースルーティング(設定ミス例)」で紹介しています。
Router_Bにおいて、デフォルトルートを設定します。
Router(config)#ip route 0.0.0.0 0.0.0.0 Serial0/1
Router_Aから発信するトラフィックの戻りは、下の経路を通るようにしておきます。
各ルータの設定は、以下のようになります。
●Router_Aの設定
!
version 12.0
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname Router_A
!
enable password cisco
!
ip subnet-zero
!
interface Ethernet0/0
ip address 10.0.0.1 255.0.0.0
!
interface Serial0/0
bandwidth 64
ip address 172.16.0.1 255.255.0.0
clockrate 64000
!
interface Ethernet0/1
ip address 20.0.0.1 255.0.0.0
!
interface Serial0/1
bandwidth 64
ip address 172.17.0.1 255.255.0.0
clockrate 64000
!
ip classless
!
line con 0
exec-timeout 0 0
transport input none
line aux 0
line vty 0 4
password cisco
login
!
end
●Router_Bの設定
!
version 12.0
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname Router_B
!
enable password cisco
!
ip subnet-zero
!
interface Ethernet0/0
ip address 192.168.1.1 255.255.255.0
!
interface Serial0/0
bandwidth 64
ip address 172.16.0.2 255.255.0.0
!
interface Ethernet0/1
no ip address
no ip directed-broadcast
shutdown
!
interface Serial0/1
bandwidth 64
ip address 172.17.0.2 255.255.0.0
!
ip classless
ip route 0.0.0.0 0.0.0.0 Serial0/1
!
line con 0
exec-timeout 0 0
transport input none
line aux 0
line vty 0 4
password cisco
login
!
end
次に、送信元IPベースによるポリシーベースルーティングの設定を行っていきます。
続きは、次の「ポリシーベースルーティング(送信元 その2)」で説明します。
