キャンパスネットワークの設定

中規模程度の企業を想定してネットワークを組んでいきたいと思います。コア層、ディストリビューション層は分けません。例によってGNS3上でシミュレートします。

Campus_01_01

DSW1とDSW2が各VLANに属するクライアントへレイヤ2の接続性を提供します。クライアントから見ればDSWがデフォルトゲートウェイになります。DSWより上部はOSPFによりルーティングされてサーバファームへ接続されます。

[DSW1]

spanning-tree vlan 10 priority 4096
!
interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
interface FastEthernet2/0
switchport mode trunk
duplex full
speed 100
!
interface FastEthernet2/1
switchport mode trunk
duplex full
speed 100
!
interface FastEthernet2/2
no switchport
ip address 192.168.1.1 255.255.255.0
ip ospf cost 10
duplex full
speed 10
!
interface FastEthernet2/3
switchport mode trunk
duplex full
speed 100
!
interface Vlan1
no ip address
!
interface Vlan10
ip address 10.0.10.1 255.255.255.0
standby 1 ip 10.0.10.254
standby 1 priority 200
standby 1 preempt
standby 1 track FastEthernet2/2 150
!
interface Vlan20
ip address 10.0.20.1 255.255.255.0
standby 2 ip 10.0.20.254
!
router ospf 1
log-adjacency-changes
redistribute connected subnets :直接接続している経路をOSPFで再配信
passive-interface FastEthernet2/0
passive-interface FastEthernet2/1
passive-interface FastEthernet2/3
network 192.168.1.1 0.0.0.0 area 0

[DSW2]

spanning-tree vlan 20 priority 4096
!
interface Loopback0
ip address 1.1.1.2 255.255.255.255
!
interface FastEthernet2/0
switchport mode trunk
duplex full
speed 100
!
interface FastEthernet2/1
switchport mode trunk
duplex full
speed 100
!
interface FastEthernet2/2
no switchport
ip address 192.168.2.1 255.255.255.0
ip ospf cost 10
duplex full
speed 10
!
interface FastEthernet2/3
switchport mode trunk
duplex full
speed 100
!
interface Vlan1
no ip address
!
interface Vlan10
ip address 10.0.10.2 255.255.255.0
standby 1 ip 10.0.10.254
!
interface Vlan20
ip address 10.0.20.2 255.255.255.0
standby 2 ip 10.0.20.254
standby 2 priority 200
standby 2 preempt
standby 2 track FastEthernet2/2 150
!
router ospf 1
log-adjacency-changes
redistribute connected subnets  :直接接続している経路をOSPFで再配信
passive-interface FastEthernet2/0
passive-interface FastEthernet2/1
passive-interface FastEthernet2/3
network 192.168.2.1 0.0.0.0 area 0
!

[ASW3]

interface Loopback0
ip address 1.1.1.3 255.255.255.255
!
interface Ethernet0/0
ip address 192.168.1.2 255.255.255.0
full-duplex
!
interface Ethernet0/1
ip address 192.168.2.2 255.255.255.0
full-duplex
!
interface Ethernet0/2
ip address 192.168.3.2 255.255.255.0
half-duplex
!
router ospf 1
log-adjacency-changes
redistribute connected subnets  :直接接続している経路をOSPFで再配信
network 192.168.1.2 0.0.0.0 area 0
network 192.168.2.2 0.0.0.0 area 0
!

第一のポイントはHSRPとPVSTの設定です。

Campus_01_02

VLAN1用のゲートウェイはHSRPで構成しますが、VLAN10用のプライマリゲートウェイはDSW1に、VLAN20用のプライマリゲートウェイがDSW2に配置してトラフィックを分散させます。

設定ではプライオリティが高い方が優先されるので優先の方に200を割り当ててます。何も設定しなければデフォルトの100になります。同時にPVSTもHSRPのプライマリがルートブリッジになるように設定します。

ステータスを確認します。

[DSW1]

DSW1#sh standby brief
P indicates configured to preempt.
|
Interface Grp Pri P State Active Standby Virtual IP
Vl10 1 200 P Active local 10.0.10.2 10.0.10.254 :このルータがアクティブ
Vl20 2 100 Standby 10.0.20.2 local 10.0.20.254

[DSW2]

DSW2#sh standby brief
P indicates configured to preempt.
|
Interface Grp Pri P State Active Standby Virtual IP
Vl10 1 100 Standby 10.0.10.1 local 10.0.10.254
Vl20 2 200 P Active local 10.0.20.1 10.0.20.254 :このルータがアクティブ

[DSW1]

VLAN10
 Spanning tree enabled protocol ieee
 Root ID Priority 4096
 Address c203.1724.0001
 This bridge is the root
 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

 Bridge ID Priority 4096
 Address c203.1724.0001
 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
 Aging Time 300

Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet2/0 128.81 128 19 FWD 0 4096 c203.1724.0001 128.81
FastEthernet2/1 128.82 128 19 FWD 0 4096 c203.1724.0001 128.82
FastEthernet2/3 128.84 128 19 FWD 0 4096 c203.1724.0001 128.84


VLAN20
 Spanning tree enabled protocol ieee
 Root ID Priority 4096
 Address c204.17f4.0002
 Cost 19
 Port 84 (FastEthernet2/3)
 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

 Bridge ID Priority 32768
 Address c203.1724.0002
 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
 Aging Time 300

Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet2/0 128.81 128 19 FWD 19 32768 c203.1724.0002 128.81
FastEthernet2/1 128.82 128 19 BLK 19 32768 c202.1564.0001 128.82
FastEthernet2/3 128.84 128 19 FWD 0 4096 c204.17f4.0002 128.84

VLAN10ではDSW1がルートブリッジなのでパスコスト0のBPDUを送出しています。

VLAN20では、DSW2から送出されたBPDUを受け取ったDSW1のf2/1が自身のコスト19を加算して、f2/0から送出するのでコストは19、同じくf/21も19になります。

VLAN20のルートブリッジからBPDUを直接受けとったf2/3は0になっています。

DSW1とASW2間のリンクでみるとDSW1のf2/1も、ASW2のf2/1も同じコストのBPDUを送出するので最も小さいBPDUを送信しているポートを代表ポートに選ぶことができませんが、ブリッジIDの比較からASW2側のポートが代表ポートになっています。ブロッキングポートになったDSW1のf2/1はBPDUの受信だけを行ってBPDUの送信、フレームの送受信を停止します。

[DSW2]
VLAN10
 Spanning tree enabled protocol ieee
 Root ID Priority 4096
 Address c203.1724.0001
 Cost 19
 Port 84 (FastEthernet2/3)
 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

 Bridge ID Priority 32768
 Address c204.17f4.0001
 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
 Aging Time 300

Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet2/0 128.81 128 19 FWD 19 32768 c204.17f4.0001 128.81
FastEthernet2/1 128.82 128 19 BLK 19 32768 c201.0d08.0001 128.82
FastEthernet2/3 128.84 128 19 FWD 0 4096 c203.1724.0001 128.84


VLAN20
 Spanning tree enabled protocol ieee
 Root ID Priority 4096
 Address c204.17f4.0002
 This bridge is the root
 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

 Bridge ID Priority 4096
 Address c204.17f4.0002
 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
 Aging Time 300

Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet2/0 128.81 128 19 FWD 0 4096 c204.17f4.0002 128.81
FastEthernet2/1 128.82 128 19 FWD 0 4096 c204.17f4.0002 128.82
FastEthernet2/3 128.84 128 19 FWD 0 4096 c204.17f4.0002 128.84

各ルータのルーティングテーブルも確認します。

[DSW1]

DSW1#sh ip route
Gateway of last resort is not set

 1.0.0.0/32 is subnetted, 3 subnets
C 1.1.1.1 is directly connected, Loopback0
O E2 1.1.1.3 [110/20] via 192.168.1.2, 01:02:14, FastEthernet2/2
O E2 1.1.1.2 [110/20] via 192.168.1.2, 01:02:14, FastEthernet2/2
 10.0.0.0/24 is subnetted, 2 subnets
C 10.0.10.0 is directly connected, Vlan10
C 10.0.20.0 is directly connected, Vlan20
C 192.168.1.0/24 is directly connected, FastEthernet2/2
O 192.168.2.0/24 [110/20] via 192.168.1.2, 01:02:14, FastEthernet2/2
O E2 192.168.3.0/24 [110/20] via 192.168.1.2, 01:02:15, FastEthernet2/2

[DSW2]

DSW2#sh ip route
Gateway of last resort is not set

 1.0.0.0/32 is subnetted, 3 subnets
O E2 1.1.1.1 [110/20] via 192.168.2.2, 01:02:39, FastEthernet2/2
O E2 1.1.1.3 [110/20] via 192.168.2.2, 01:19:20, FastEthernet2/2
C 1.1.1.2 is directly connected, Loopback0
 10.0.0.0/24 is subnetted, 2 subnets
C 10.0.10.0 is directly connected, Vlan10
C 10.0.20.0 is directly connected, Vlan20
O 192.168.1.0/24 [110/20] via 192.168.2.2, 01:02:39, FastEthernet2/2
C 192.168.2.0/24 is directly connected, FastEthernet2/2
O E2 192.168.3.0/24 [110/20] via 192.168.2.2, 01:19:21, FastEthernet2/2

[ASW3]

ASW3#sh ip route
Gateway of last resort is not set

 1.0.0.0/32 is subnetted, 3 subnets
O E2 1.1.1.1 [110/20] via 192.168.1.1, 01:03:19, Ethernet0/0
C 1.1.1.3 is directly connected, Loopback0
O E2 1.1.1.2 [110/20] via 192.168.2.1, 01:03:19, Ethernet0/1
 10.0.0.0/24 is subnetted, 2 subnets
O E2 10.0.10.0 [110/20] via 192.168.2.1, 01:03:19, Ethernet0/1
        [110/20] via 192.168.1.1, 01:03:19, Ethernet0/0 :ロードバランス
O E2 10.0.20.0 [110/20] via 192.168.2.1, 01:03:19, Ethernet0/1
        [110/20] via 192.168.1.1, 01:03:19, Ethernet0/0 :ロードバランス
C 192.168.1.0/24 is directly connected, Ethernet0/0
C 192.168.2.0/24 is directly connected, Ethernet0/1
C 192.168.3.0/24 is directly connected, Ethernet0/2

次回「キャンパスネットワークの設定(2)」で障害時の動作確認をしてみます。

スポンサーリンク






シェアする

  • このエントリーをはてなブックマークに追加

フォローする