概要

コア/ディストリビューション/アクセス層の3階層モデルのLANにおいて、OSPFでのルーティングを行う設定例です。

拠点1はコア/ディストリビューション/アクセス層の3階層モデルのLANです。拠点2は小規模なLANで、コア層を省略した2階層モデルです。ディストリビューション層やコア層は冗長化します。冗長化したディストリビューション層のレイヤ3スイッチでVRRPを利用します。また、拠点1と拠点2を接続する広域イーサネット網も冗長化します。

ネットワーク構成

物理構成

図 ネットワーク構成 物理構成
図 ネットワーク構成 物理構成

IPアドレス

機器インタフェースIPアドレス/サブネットマスク
DSW111Vlan1110.1.11.1/24
 Vlan10110.1.101.1/24
 Vlan10210.1.102.1/24
 Lo010.1.0.1/32
DSW112Vlan1110.1.11.2/24
 Vlan10310.1.103.2/24
 Vlan10410.1.104.2/24
 Lo010.1.0.2/32
PC1F0/010.1.11.100/24
DSW121Vlan2110.1.21.1/24
 Vlan10510.1.105.1/24
 Vlan10610.1.106.1/24
 Lo010.1.0.3/32
DSW122Vlan2110.1.21.2/24
 Vlan10710.1.107.2/24
 Vlan10810.1.108.2/24
 Lo010.1.0.4/32
PC1F0/010.1.21.100/24
DSW131Vlan3110.1.31.1/24
 Vlan10910.1.109.1/24
 Vlan11010.1.110.1/24
 Lo010.1.0.5/32
DSW132Vlan3110.1.31.2/24
 Vlan11110.1.111.2/24
 Vlan11210.1.112.2/24
 Lo010.1.0.6/32
SRVF0/010.1.11.100/24
BBSW1Vlan10110.1.101.11/24
 Vlan10310.1.103.11/24
 Vlan10510.1.105.11/24
 Vlan10710.1.107.11/24
 Vlan10910.1.109.11/24
 Vlan11110.1.111.11/24
 Vlan11310.1.113.11/24
 Vlan11510.1.115.11/24
 Lo010.1.0.7/32
BBSW2Vlan10210.1.102.12/24
 Vlan10410.1.104.12/24
 Vlan10610.1.106.12/24
 Vlan10810.1.108.12/24
 Vlan11010.1.110.12/24
 Vlan11210.1.112.12/24
 Vlan11410.1.114.12/24
 Vlan11610.1.116.12/24
 Lo010.1.0.8/32
EDSW1Vlan11310.1.113.1/24
 Vlan11410.1.114.1/24
 Vlan11710.1.117.1/24
 Vlan11810.1.118.1/24
 Lo010.1.0.9/32
EDSW2Vlan11510.1.115.2/24
 Vlan11610.1.116.2/24
 Vlan11910.1.119.2/24
 Vlan12010.1.120.2/24
 Lo010.1.0.10/32
WSW11Vlan10010.0.1.11/24
 Vlan20010.0.2.11/24
 Vlan11710.1.117.11/24
 Vlan11910.1.119.11/24
 Lo010.1.0.11/32
WSW12Vlan10010.0.1.12/24
 Vlan20010.0.2.12/24
 Vlan11810.1.118.12/24
 Vlan12010.1.120.12/24
 Lo010.1.0.12/32
WSW21Vlan10010.0.1.21/24
 Vlan20010.0.2.21/24
 Vlan1110.2.11.21/24
 Lo010.2.0.13/32
WSW22Vlan10010.0.1.22/24
 Vlan20010.0.2.22/24
 Vlan1110.2.11.22/24
 Lo010.2.0.14/32
PC3F0/010.2.11.100/24
表 IPアドレスリスト

VRRP

インタフェースグループ番号仮想IPマスタルータトラック
Vlan111110.1.11.254DSW111DSW111 F0/2、F0/3
Vlan212110.1.21.254DSW121DSW121 F0/2、F0/3
Vlan313110.1.31.254DSW131DSW131 F0/2、F0/3
Vlan11(拠点2)1110.2.11.254WSW21WSW21 F0/3、F0/3
表 VRRPの設定

論理構成

図 ネットワーク構成 論理構成
図 ネットワーク構成 論理構成

3階層モデルLANのOSPFルーティングの構成例

エリア構成の概要

  • バックボーンエリア:広域イーサネット1、広域イーサネット2
  • エリア1:拠点1
  • エリア2:拠点2
図 エリア構成の概要
図 エリア構成の概要

各機器の設定ファイル

VLAN/SVIの設定を行ったうえで、基本的なOSPFの設定まで完了している状態の各機器の設定ファイルの内容を以下に挙げています。

拠点1

ASW111 設定ファイル(OSPF基本)

version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname ASW111
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
!
interface FastEthernet0/1
 switchport trunk allowed vlan 1,11,1002-1005
 switchport mode trunk
!
interface FastEthernet0/2
 switchport trunk allowed vlan 1,11,1002-1005
 switchport mode trunk
!
interface FastEthernet0/3
 switchport access vlan 11
 spanning-tree portfast
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface Vlan1
 no ip address
!
!
ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
 privilege level 15
line aux 0
line vty 0 4
 login
!
!
end

ASW121 設定ファイル(OSPF基本)

version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname ASW121
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
!
interface FastEthernet0/1
 switchport trunk allowed vlan 1,21,1002-1005
 switchport mode trunk
!
interface FastEthernet0/2
 switchport trunk allowed vlan 1,21,1002-1005
 switchport mode trunk
!
interface FastEthernet0/3
 switchport access vlan 21
 spanning-tree portfast
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface Vlan1
 no ip address
!
!
ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
 privilege level 15
line aux 0
line vty 0 4
 login
!
!
end

ASW131 設定ファイル(OSPF基本)

version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname ASW131
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
!
interface FastEthernet0/1
 switchport trunk allowed vlan 1,31,1002-1005
 switchport mode trunk
!
interface FastEthernet0/2
 switchport trunk allowed vlan 1,31,1002-1005
 switchport mode trunk
!
interface FastEthernet0/3
 switchport access vlan 31
 spanning-tree portfast
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface Vlan1
 no ip address
!
!
ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
 privilege level 15
line aux 0
line vty 0 4
 login
!
!
end

DSW111設定ファイル(OSPF基本)

!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname DSW111
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
track 1 interface FastEthernet0/2 line-protocol
!
track 2 interface FastEthernet0/3 line-protocol
!
!
!
interface Loopback0
 ip address 10.1.0.1 255.255.255.255
!
interface FastEthernet0/0
!
interface FastEthernet0/1
 switchport trunk allowed vlan 1,11,1002-1005
 switchport mode trunk
!
interface FastEthernet0/2
 switchport access vlan 101
 spanning-tree portfast
!
interface FastEthernet0/3
 switchport access vlan 102
 spanning-tree portfast
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface Vlan1
 no ip address
!
interface Vlan11
 ip address 10.1.11.1 255.255.255.0
 vrrp 11 ip 10.1.11.254
 vrrp 11 priority 150
 vrrp 11 track 1 decrement 30
 vrrp 11 track 2 decrement 30
!
interface Vlan101
 ip address 10.1.101.1 255.255.255.0
!
interface Vlan102
 ip address 10.1.102.1 255.255.255.0
!
!
router ospf 1
 log-adjacency-changes
 passive-interface Vlan11
 network 10.1.0.0 0.0.255.255 area 1
!
ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
 privilege level 15
line aux 0
line vty 0 4
 login
!
!
end

DSW112設定ファイル(OSPF基本)

!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname DSW112
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
 ip address 10.1.0.2 255.255.255.0
!
interface FastEthernet0/0
!
interface FastEthernet0/1
 switchport trunk allowed vlan 1,11,1002-1005
 switchport mode trunk
!
interface FastEthernet0/2
 switchport access vlan 103
 spanning-tree portfast
!
interface FastEthernet0/3
 switchport access vlan 104
 spanning-tree portfast
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface Vlan1
 no ip address
!
interface Vlan11
 ip address 10.1.11.2 255.255.255.0
 vrrp 11 ip 10.1.11.254
!
interface Vlan103
 ip address 10.1.103.2 255.255.255.0
!
interface Vlan104
 ip address 10.1.104.2 255.255.255.0
!
!
router ospf 1
 log-adjacency-changes
 passive-interface Vlan11
 network 10.1.0.0 0.0.255.255 area 1
!
ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
 privilege level 15
line aux 0
line vty 0 4
 login
!
!
end

DSW121設定ファイル(OSPF基本)

!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname DSW121
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
track 1 interface FastEthernet0/2 line-protocol
!
track 2 interface FastEthernet0/3 line-protocol
!
!
!
interface Loopback0
 ip address 10.1.0.3 255.255.255.255
!
interface FastEthernet0/0
!
interface FastEthernet0/1
 switchport trunk allowed vlan 1,21,1002-1005
 switchport mode trunk
!
interface FastEthernet0/2
 switchport access vlan 105
 spanning-tree portfast
!
interface FastEthernet0/3
 switchport access vlan 106
 spanning-tree portfast
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface Vlan1
 no ip address
!
interface Vlan21
 ip address 10.1.21.1 255.255.255.0
 vrrp 21 ip 10.1.21.254
 vrrp 21 priority 150
 vrrp 21 track 1 decrement 30
 vrrp 21 track 2 decrement 30
!
interface Vlan105
 ip address 10.1.105.1 255.255.255.0
!
interface Vlan106
 ip address 10.1.106.1 255.255.255.0
!
!
router ospf 1
 log-adjacency-changes
 passive-interface Vlan21
 network 10.1.0.0 0.0.255.255 area 1
!
ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
 privilege level 15
line aux 0
line vty 0 4
 login
!
!
end

DSW122設定ファイル(OSPF基本)

!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname DSW122
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
 ip address 10.1.0.4 255.255.255.255
!
interface FastEthernet0/0
!
interface FastEthernet0/1
 switchport trunk allowed vlan 1,21,1002-1005
 switchport mode trunk
!
interface FastEthernet0/2
 switchport access vlan 107
 spanning-tree portfast
!
interface FastEthernet0/3
 switchport access vlan 108
 spanning-tree portfast
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface Vlan1
 no ip address
!
interface Vlan21
 ip address 10.1.21.2 255.255.255.0
 vrrp 21 ip 10.1.21.254
!
interface Vlan107
 ip address 10.1.107.2 255.255.255.0
!
interface Vlan108
 ip address 10.1.108.2 255.255.255.0
!
!
router ospf 1
 log-adjacency-changes
 passive-interface Vlan21
 network 10.1.0.0 0.0.255.255 area 1
!
ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
 privilege level 15
line aux 0
line vty 0 4
 login
!
!
end

DSW131設定ファイル(OSPF基本)

!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname DSW131
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
track 1 interface FastEthernet0/2 line-protocol
!
track 2 interface FastEthernet0/3 line-protocol
!
!
!
interface Loopback0
 ip address 10.1.0.5 255.255.255.255
!
interface FastEthernet0/0
!
interface FastEthernet0/1
 switchport trunk allowed vlan 1,31,1002-1005
 switchport mode trunk
!
interface FastEthernet0/2
 switchport access vlan 109
 spanning-tree portfast
!
interface FastEthernet0/3
 switchport access vlan 110
 spanning-tree portfast
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface Vlan1
 no ip address
!
interface Vlan31
 ip address 10.1.31.1 255.255.255.0
 vrrp 31 ip 10.1.31.254
 vrrp 31 priority 150
 vrrp 31 track 1 decrement 30
 vrrp 31 track 2 decrement 30
!
interface Vlan109
 ip address 10.1.109.1 255.255.255.0
!
interface Vlan110
 ip address 10.1.110.1 255.255.255.0
!
!
router ospf 1
 log-adjacency-changes
 passive-interface Vlan31
 network 10.1.0.0 0.0.255.255 area 1
!
ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
 privilege level 15
line aux 0
line vty 0 4
 login
!
!
end

DSW132設定ファイル(OSPF基本)

!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname DSW132
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
 ip address 10.1.0.6 255.255.255.255
!
interface FastEthernet0/0
!
interface FastEthernet0/1
 switchport trunk allowed vlan 1,31,1002-1005
 switchport mode trunk
!
interface FastEthernet0/2
 switchport access vlan 111
 spanning-tree portfast
!
interface FastEthernet0/3
 switchport access vlan 112
 spanning-tree portfast
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface Vlan1
 no ip address
!
interface Vlan31
 ip address 10.1.31.2 255.255.255.0
 vrrp 31 ip 10.1.31.254
!
interface Vlan111
 ip address 10.1.111.2 255.255.255.0
!
interface Vlan112
 ip address 10.1.112.2 255.255.255.0
!
!
router ospf 1
 log-adjacency-changes
 passive-interface Vlan31
 network 10.1.0.0 0.0.255.255 area 1
!
ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
 privilege level 15
line aux 0
line vty 0 4
 login
!
!
end

EDSW1設定ファイル(OSPF基本)

version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname EDSW1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
 ip address 10.1.0.9 255.255.255.255
!
interface FastEthernet0/0
!
interface FastEthernet0/1
 switchport access vlan 113
 spanning-tree portfast
!
interface FastEthernet0/2
 switchport access vlan 114
 spanning-tree portfast
!
interface FastEthernet0/3
 switchport access vlan 117
 spanning-tree portfast
!
interface FastEthernet0/4
 switchport access vlan 118
 spanning-tree portfast
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface Vlan1
 no ip address
!
interface Vlan113
 ip address 10.1.113.1 255.255.255.0
!
interface Vlan114
 ip address 10.1.114.1 255.255.255.0
!
interface Vlan117
 ip address 10.1.117.1 255.255.255.0
!
interface Vlan118
 ip address 10.1.118.1 255.255.255.0
!
!
router ospf 1
 log-adjacency-changes
 network 10.1.0.0 0.0.255.255 area 1
!
ip http server
ip forward-protocol nd
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
 privilege level 15
line aux 0
line vty 0 4
 login
!
!
end

EDSW2設定ファイル(OSPF基本)

version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname EDSW2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
 ip address 10.1.0.10 255.255.255.255
!
interface FastEthernet0/0
!
interface FastEthernet0/1
 switchport access vlan 115
 spanning-tree portfast
!
interface FastEthernet0/2
 switchport access vlan 116
 spanning-tree portfast
!
interface FastEthernet0/3
 switchport access vlan 119
 spanning-tree portfast
!
interface FastEthernet0/4
 switchport access vlan 120
 spanning-tree portfast
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface Vlan1
 no ip address
!
interface Vlan115
 ip address 10.1.115.2 255.255.255.0
!
interface Vlan116
 ip address 10.1.116.2 255.255.255.0
!
interface Vlan119
 ip address 10.1.119.2 255.255.255.0
!
interface Vlan120
 ip address 10.1.120.2 255.255.255.0
!
!
router ospf 1
 log-adjacency-changes
 network 10.1.0.0 0.0.255.255 area 1
!
ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
 privilege level 15
line aux 0
line vty 0 4
 login
!
!
end

WSW11設定ファイル(OSPF基本)

version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname WSW11
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
 ip address 10.1.0.11 255.255.255.255
!
interface FastEthernet0/0
!
interface FastEthernet0/1
 switchport access vlan 117
 spanning-tree portfast
!
interface FastEthernet0/2
 switchport access vlan 119
 spanning-tree portfast
!
interface FastEthernet0/3
 switchport access vlan 100
 spanning-tree portfast
!
interface FastEthernet0/4
 switchport access vlan 200
 spanning-tree portfast
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface Vlan1
 no ip address
!
interface Vlan100
 ip address 10.0.1.11 255.255.255.0
!
interface Vlan117
 ip address 10.1.117.11 255.255.255.0
!
interface Vlan119
 ip address 10.1.119.11 255.255.255.0
!
interface Vlan200
 ip address 10.0.2.11 255.255.255.0
!
!
router ospf 1
 log-adjacency-changes
 network 10.0.0.0 0.0.255.255 area 0
 network 10.1.0.0 0.0.255.255 area 1
!
ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
 privilege level 15
line aux 0
line vty 0 4
 login
!
!
end

WSW12設定ファイル(OSPF基本)

version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname WSW12
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
 ip address 10.1.0.12 255.255.255.255
!
interface FastEthernet0/0
!
interface FastEthernet0/1
 switchport access vlan 118
 spanning-tree portfast
!
interface FastEthernet0/2
 switchport access vlan 120
 spanning-tree portfast
!
interface FastEthernet0/3
 switchport access vlan 100
 spanning-tree portfast
!
interface FastEthernet0/4
 switchport access vlan 200
 spanning-tree portfast
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface Vlan1
 no ip address
!
interface Vlan100
 ip address 10.0.1.12 255.255.255.0
!
interface Vlan118
 ip address 10.1.118.12 255.255.255.0
!
interface Vlan120
 ip address 10.1.120.12 255.255.255.0
!
interface Vlan200
 ip address 10.0.2.12 255.255.255.0
!
!
router ospf 1
 log-adjacency-changes
 network 10.0.0.0 0.0.255.255 area 0
 network 10.1.0.0 0.0.255.255 area 1
!
ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
 privilege level 15
line aux 0
line vty 0 4
 login
!
!
end

PC1設定ファイル(OSPF基本)

version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname PC1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
no ip routing
!
!
no ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
 ip address 10.1.11.100 255.255.255.0
 no ip route-cache
 duplex auto
 speed auto
!
!
ip default-gateway 10.1.11.254
ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
 privilege level 15
line aux 0
line vty 0 4
 login
!
!
end

PC2設定ファイル(OSPF基本)

version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname PC2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
no ip routing
!
!
no ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
 ip address 10.1.21.100 255.255.255.0
 no ip route-cache
 duplex auto
 speed auto
!
!
ip default-gateway 10.1.12.254
ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
 privilege level 15
line aux 0
line vty 0 4
 login
!
!
end

SRV設定ファイル(OSPF基本)

version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname SRV
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
no ip routing
!
!
no ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
 ip address 10.1.31.100 255.255.255.0
 no ip route-cache
 duplex auto
 speed auto
!
!
ip default-gateway 10.1.31.254
ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
 privilege level 15
line aux 0
line vty 0 4
 login
!
!
end

拠点2

ASW211設定ファイル(OSPF基本)

version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname ASW211
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
!
interface FastEthernet0/1
 switchport trunk allowed vlan 1,11,1002-1005
 switchport mode trunk
!
interface FastEthernet0/2
 switchport trunk allowed vlan 1,11,1002-1005
 switchport mode trunk
!
interface FastEthernet0/3
 switchport access vlan 11
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface Vlan1
 no ip address
!
!
ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
 privilege level 15
line aux 0
line vty 0 4
 login
!
!
end

WSW21設定ファイル(OSPF基本)

!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname WSW21
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
track 1 interface FastEthernet0/3 line-protocol
!
track 2 interface FastEthernet0/3 line-protocol
!
!
!
interface Loopback0
 ip address 10.2.0.21 255.255.255.255
 shutdown
!
interface FastEthernet0/0
!
interface FastEthernet0/1
 switchport trunk allowed vlan 1,11,1002-1005
 switchport mode trunk
!
interface FastEthernet0/2
!
interface FastEthernet0/3
 switchport access vlan 100
 spanning-tree portfast
!
interface FastEthernet0/4
 switchport access vlan 200
 spanning-tree portfast
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface Vlan1
 no ip address
!
interface Vlan11
 ip address 10.2.11.21 255.255.255.0
 vrrp 11 ip 10.2.11.254
 vrrp 11 priority 150
 vrrp 11 track 1 decrement 30
 vrrp 11 track 2 decrement 30
!
interface Vlan100
 ip address 10.0.1.21 255.255.255.0
!
interface Vlan200
 ip address 10.0.2.21 255.255.255.0
!
!
router ospf 1
 log-adjacency-changes
 passive-interface Vlan11
 network 10.0.0.0 0.0.255.255 area 0
 network 10.2.0.0 0.0.255.255 area 2
!
ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
 privilege level 15
line aux 0
line vty 0 4
 login
!
!
end

WSW22設定ファイル(OSPF基本)

!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname WSW22
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
 ip address 10.2.0.22 255.255.255.255
!
interface FastEthernet0/0
!
interface FastEthernet0/1
 switchport trunk allowed vlan 1,11,1002-1005
 switchport mode trunk
!
interface FastEthernet0/2
!
interface FastEthernet0/3
 switchport access vlan 100
 spanning-tree portfast
!
interface FastEthernet0/4
 switchport access vlan 200
 spanning-tree portfast
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface Vlan1
 no ip address
!
interface Vlan11
 ip address 10.2.11.22 255.255.255.0
 vrrp 11 ip 10.2.11.254
!
interface Vlan100
 ip address 10.0.1.22 255.255.255.0
!
interface Vlan200
 ip address 10.0.2.22 255.255.255.0
!
!
router ospf 1
 log-adjacency-changes
 passive-interface Vlan11
 network 10.0.0.0 0.0.255.255 area 0
 network 10.2.0.0 0.0.255.255 area 2
!
ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
 privilege level 15
line aux 0
line vty 0 4
 login
!
!
end

PC3設定ファイル(OSPF基本)

version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname PC3
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
no ip routing
!
!
no ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
 ip address 10.2.11.100 255.255.255.0
 no ip route-cache
 duplex auto
 speed auto
!
!
ip default-gateway 10.2.11.254
ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
 privilege level 15
line aux 0
line vty 0 4
 login
!
!
end

OSPF 追加の設定と確認

基本的なOSPFの設定が完了した状態から、さらに以下の設定と確認を行います。

  • Hello/Deadインターバルの確認
  • OSPFコスト
  • 等コストロードバランス
  • DR/BDR
  • ルート集約

Step1:Hello/Deadインターバルの確認

ネイバーの状態は定期的なHelloパケットの送受信で確認します。イーサネットのインタフェースでは、デフォルトのHello/Deadインターバルは10/40秒です。show ip ospf interfaceコマンドでHello/Deadインターバルを確認します。DSW111では、次のような状態です。

DSW111 show ip ospf interface

DSW111#show ip ospf interface 
Loopback0 is up, line protocol is up 
  Internet Address 10.1.0.1/32, Area 1 
  Process ID 1, Router ID 10.1.0.1, Network Type LOOPBACK, Cost: 1
  Loopback interface is treated as a stub Host
Vlan11 is up, line protocol is up 
  Internet Address 10.1.11.1/24, Area 1 
  Process ID 1, Router ID 10.1.0.1, Network Type BROADCAST, Cost: 1
  Transmit Delay is 1 sec, State DR, Priority 1 
  Designated Router (ID) 10.1.0.1, Interface address 10.1.11.1
  No backup designated router on this network
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
-- omitted --

ネイバーのダウンを素早く検出するためには、Hello/Deadインターバルを短くして頻繁にHelloパケットを送受信するようにします。Helloパケットのトラフィックは増加しますが、パケットサイズや処理負荷はそれほど大きいものではありません。Hello/Deadインターバルを変更する際は、ネイバーで一致しなければいけないことに注意をしてください。

ここでは、Hello/Deadインターバルの値の確認だけとしています。

Step2:OSPFコストの確認

OSPFコストはインタフェースの帯域幅から自動的に計算されます。SVIでは、帯域幅は100Mbpsなので、OSPFコストは1です。目的のネットワークまでのコストは、累積して考えます。DSW111からVlan31 10.1.31.0/24のコストを確認すると、3であることがわかります。

DSW111 show ip route 10.1.31.0

DSW111#show ip route 10.1.31.0
Routing entry for 10.1.31.0/24
  Known via "ospf 1", distance 110, metric 3, type intra area
  Last update from 10.1.102.12 on Vlan102, 00:24:52 ago
  Routing Descriptor Blocks:
  * 10.1.102.12, from 10.1.0.5, 00:24:52 ago, via Vlan102
      Route metric is 3, traffic share count is 1
    10.1.101.11, from 10.1.0.5, 00:24:52 ago, via Vlan101
      Route metric is 3, traffic share count is 1

図 OSPFコストの例
図 OSPFコストの例

Step3:コスト計算式の変更

1Gbpsや10Gbpsのインタフェースが珍しくなくなってきている現在、デフォルトの計算式では高速なインタフェースをOSPFコストに反映できません。100Mbps以上のインタフェースに対応できるようにOSPFを動作させているすべてのルータで、コスト計算式を変更します。

すべてのOSPFルータ コスト計算式の変更

router ospf 1
 auto-cost reference-bandwidth 10000

Step4:OSPFコストの確認

コストの計算式を変更したあと、再度、OSPFコストを確認します。DSW111でshow ip ospf interfaceおよびshow ip route 10.1.31.0を確認します。

DSW111 show ip ospf interface/show ip route 10.1.31.0

DSW111#show ip ospf interface 
Loopback0 is up, line protocol is up 
  Internet Address 10.1.0.1/32, Area 1 
  Process ID 1, Router ID 10.1.0.1, Network Type LOOPBACK, Cost: 1
  Loopback interface is treated as a stub Host
Vlan11 is up, line protocol is up 
  Internet Address 10.1.11.1/24, Area 1 
  Process ID 1, Router ID 10.1.0.1, Network Type BROADCAST, Cost: 100
  Transmit Delay is 1 sec, State DR, Priority 1 
  Designated Router (ID) 10.1.0.1, Interface address 10.1.11.1
  No backup designated router on this network
-- omitted --
DSW111#show ip route 10.1.31.0
Routing entry for 10.1.31.0/24
  Known via "ospf 1", distance 110, metric 300, type intra area
  Last update from 10.1.102.12 on Vlan102, 00:01:50 ago
  Routing Descriptor Blocks:
    10.1.102.12, from 10.1.0.5, 00:01:50 ago, via Vlan102
      Route metric is 300, traffic share count is 1
  * 10.1.101.11, from 10.1.0.5, 00:01:50 ago, via Vlan101
      Route metric is 300, traffic share count is 1

Step5:等コストロードバランスの確認

各PCおよびSRVが接続されているVLANに対して、すべてのレイヤ3スイッチで通信経路が2つずつ確保されています。すべてのインタフェースのコストは同一のため、特別な設定を行わなくても等コストロードバランスの構成です。

DSW111およびBBSW1/BBSW2からSRVが接続されている10.1.31.0/24のルートを確認すると、次のようになります。

DSW111 show ip route 10.1.31.0

DSW111#show ip route 10.1.31.0
Routing entry for 10.1.31.0/24
  Known via "ospf 1", distance 110, metric 300, type intra area
  Last update from 10.1.102.12 on Vlan102, 00:01:50 ago
  Routing Descriptor Blocks:
    10.1.102.12, from 10.1.0.5, 00:01:50 ago, via Vlan102
      Route metric is 300, traffic share count is 1
  * 10.1.101.11, from 10.1.0.5, 00:01:50 ago, via Vlan101
      Route metric is 300, traffic share count is 1

BBSW1 show ip route 10.1.31.0

BBSW1#show ip route 10.1.31.0
Routing entry for 10.1.31.0/24
  Known via "ospf 1", distance 110, metric 200, type intra area
  Last update from 10.1.109.1 on Vlan109, 00:07:19 ago
  Routing Descriptor Blocks:
  * 10.1.111.2, from 10.1.0.6, 00:07:19 ago, via Vlan111
      Route metric is 200, traffic share count is 1
    10.1.109.1, from 10.1.0.5, 00:07:19 ago, via Vlan109
      Route metric is 200, traffic share count is 1

BBSW2 show ip route 10.1.31.0

BBSW2#show ip route 10.1.31.0
Routing entry for 10.1.31.0/24
  Known via "ospf 1", distance 110, metric 200, type intra area
  Last update from 10.1.110.1 on Vlan110, 00:08:02 ago
  Routing Descriptor Blocks:
  * 10.1.112.2, from 10.1.0.6, 00:08:02 ago, via Vlan112
      Route metric is 200, traffic share count is 1
    10.1.110.1, from 10.1.0.5, 00:08:02 ago, via Vlan110
      Route metric is 200, traffic share count is 1
図 10.1.31.0/24に対する等コストロードバランス
図 10.1.31.0/24に対する等コストロードバランス

Step6:DR/BDRの設定

ほとんどのサブネットは、レイヤ3スイッチが2台だけ接続されています。そのため、DR/BDRの選択は気にする必要は特にありません。ただし、広域イーサネットのサブネットは複数のOSPFルータが接続されているため、DR/BDRを考慮します。

広域イーサネット1のDRをWSW11、BDRをWSW12とします。また、広域イーサネット2のDRをWSW12、BDRをWSW11とします。

WSW11 DR/BDRの設定

interface Vlan100
 ip ospf priority 200
!
interface Vlan200
 ip ospf priority 150

WSW12 DR/BDRの設定

interface Vlan100
 ip ospf priority 150
!
interface Vlan200
 ip ospf priority 200

OSPFプライオリティを設定したあと、WSW11~WSW22でclear ip ospf processでOSPFプロセスを再起動します。

Step7:DR/BDRの確認

WSW11、WSW12でOSPFプライオリティを変更したあとの広域イーサネット1、広域イーサネット2上のDR/BDRを確認します。

WSW11 show ip ospf interface

WSW11#show ip ospf interface vlan 100
Vlan100 is up, line protocol is up 
  Internet Address 10.0.1.11/24, Area 0 
  Process ID 1, Router ID 10.1.0.11, Network Type BROADCAST, Cost: 100
  Transmit Delay is 1 sec, State DR, Priority 200 
  Designated Router (ID) 10.1.0.11, Interface address 10.0.1.11
  Backup Designated router (ID) 10.1.0.12, Interface address 10.0.1.12
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
-- omitted --
WSW11#show ip ospf interface vlan200
Vlan200 is up, line protocol is up 
  Internet Address 10.0.2.11/24, Area 0 
  Process ID 1, Router ID 10.1.0.11, Network Type BROADCAST, Cost: 100
  Transmit Delay is 1 sec, State BDR, Priority 150 
  Designated Router (ID) 10.1.0.12, Interface address 10.0.2.12
  Backup Designated router (ID) 10.1.0.11, Interface address 10.0.2.11
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
-- omitted --
図 DR/BDR
図 DR/BDR

Step8:集約の設定

エリア1(拠点1)のABRであるWSW11、WSW12で拠点1のルートを10.1.0.0/16に集約します。同様にエリア2(拠点2)のABRであるWSW21、WSW22で拠点2のルートを10.2.0.0/16に集約します。

WSW11/WSW12 集約の設定

router ospf 1
 area 1 range 10.1.0.0 255.255.0.0

WSW21/WSW22 集約の設定

router ospf 1
 area 2 range 10.2.0.0 255.255.0.0

Step9:集約の確認

ABRでルーティングテーブルを見て、正しく集約されていることを確認します。

WSW11 show ip route 10.2.0.0

WSW11#show ip route 10.2.0.0
Routing entry for 10.2.0.0/16
  Known via "ospf 1", distance 110, metric 101, type inter area
  Last update from 10.0.1.21 on Vlan100, 00:02:06 ago
  Routing Descriptor Blocks:
  * 10.0.2.22, from 10.2.0.22, 00:02:06 ago, via Vlan200
      Route metric is 101, traffic share count is 1
    10.0.2.21, from 10.2.11.21, 00:02:06 ago, via Vlan200
      Route metric is 101, traffic share count is 1
    10.0.1.22, from 10.2.0.22, 00:02:06 ago, via Vlan100
      Route metric is 101, traffic share count is 1
    10.0.1.21, from 10.2.11.21, 00:02:06 ago, via Vlan100
      Route metric is 101, traffic share count is 1

WSW21 show ip route 10.1.0.0

WSW21#show ip route 10.1.0.0
Routing entry for 10.1.0.0/16
  Known via "ospf 1", distance 110, metric 101, type inter area
  Last update from 10.0.1.12 on Vlan100, 00:04:23 ago
  Routing Descriptor Blocks:
    10.0.2.12, from 10.1.0.12, 00:04:23 ago, via Vlan200
      Route metric is 101, traffic share count is 1
  * 10.0.2.11, from 10.1.0.11, 00:04:23 ago, via Vlan200
      Route metric is 101, traffic share count is 1
    10.0.1.12, from 10.1.0.12, 00:04:23 ago, via Vlan100
      Route metric is 101, traffic share count is 1
    10.0.1.11, from 10.1.0.11, 00:04:23 ago, via Vlan100
      Route metric is 101, traffic share count is 1
図 OSPFのルート集約
図 OSPFのルート集約

関連記事

このページで設定した内容についてのそれぞれの詳細な解説です。

関連記事

OSPFの仕組み