2020/10/21 ネットワーク(EIGRP, HSRP, STP)
https://gyazo.com/15e9ff5d10843cceaca9549d724b7638
今回の構成はこれ。
Cisco Router × 3
Cisco L2Switch × 3
PC × 3
要件
table:interfaces
R1
G0/0 192.168.255.5 255.255.255.252
G0/2 192.168.1.252 255.255.255.0
Lo1 192.168.9.0 255.255.255.0
Lo2 192.168.10.0 255.255.255.0
Lo3 192.168.11.0 255.255.255.0
R2
G0/0 192.168.255.6 255.255.255.252
G0/1 192.168.255.1 255.255.255.252
Lo1(Internet) 10.10.10.10 255.255.255.255
R3
G0/1 192.168.255.2 255.255.255.252
G0/2 192.168.1.253 255.255.255.0
Lo1 192.168.12.0 255.255.255.0
Lo2 192.168.13.0 255.255.255.0
Lo3 192.168.14.0 255.255.255.0
S1
Vlan 1 192.168.1.249 255.255.255.0
S2
Vlan 1 192.168.1.250 255.255.255.0
S3
Vlan 1 192.168.1.251 255.255.255.0
PC-A
192.168.1.1 255.255.255.0 192.168.1.254
PC-B
192.168.1.2 255.255.255.0 192.168.1.254
PC-C
192.168.1.3 255.255.255.0 192.168.1.254
EIGRP
ルーティングプロトコル
MD5を利用した認証を利用(キーチェーン)
STP
各スイッチ間は2本のケーブルを利用
STPを利用してループを防止。
収束の高速化のためにRapid-PVSTモード
HSRP
デフォルトゲートウェイの冗長化。
VIPをデフォルトゲートウェイとして設定できる。
PAgP
リンクアグリゲーション(LAG)のプロトコル。
Cisco限定。汎用性のあるプロトコルはLACP。
インターフェースをグループ化して高速化+冗長性を確保できる。
構築
まずは基本設定を行う。
code:R1
en
conf t
no ip domain-lookup
enable secret ***
line con 0
password ***
login
line vty 0 4
password cisco
login
exec-timeout 0
exit
service password-encryption
hostname R1
IPアドレスの設定
code:R1
int g0/0
ip add 192.168.255.5 255.255.255.252
no shut
int g0/2
ip add 192.168.1.252 255.255.255.0
no shut
int lo1
ip add 192.168.9.1 255.255.255.0
no shut
int lo2
ip add 192.168.10.1 255.255.255.0
no shut
int lo1
ip add 192.168.11.1 255.255.255.0
no shut
同様にR2, R3, S1, S2, S3も設定。
Trunk
各スイッチのポートをトランクに設定。
int range <interface>
switchport trunk encapsulation dot1q
switchport mode trunk
switchport trunk native vlan 1
DTPを無効化する。
switchport nonegotiate
STP
STPのモードを変更
spanning-tree mode rapid-vpst
S1をルートブリッジにする。
spanning-tree vlan 1 root primary
S3をセカンダリブリッジにする。
spanning-tree vlan1 root secondary
BPDU GUARDとPort fastを有効にする
int <interface>
spanning-tree portfast edge
spanning-tree bpduguard enable
PAgP
まずは設定するポートに入る
int range <interfaces>
PAgPの設定(active)
channel-group 1 mode active
PAgPの設定(passive)
channel-group 1 mode passive
HSRP
HSRPを有効化する。
アクティブルータのR1
int <interface>
standby 1 ip <VIP>
standby 1 priority 255
standby 1 preempt
スタンバイルータのR3
int <interface>
standby 1 ip
EIGRP
router eigrp 1
eigrp router-id <router-id>
所属するネットワークを入力
network <network> <wild-mask>
送信させないインターフェースを選択
passive-interface <interface>
自動集約しない
no auto-summary
デフォルトルートを伝搬させる
redistribute static
手動で集約させる
集約させるインターフェースを選んで集約させるアドレスを選んで新たなアドレスを選ぶ
int <interface>
ip summary-address eigrp 1 <summary-ip> <mask>
ホールドタイムとHelloタイムを選ぶ
ip hello-interval eigrp 1 <time/s>
ip hold-time eigrp 1 <time/s>
EIGRPで使う最大の帯域を選択
ip bandwidth-percent eigrp 1 <%>
キーの作成(特権モード)
key chain <name>
key 1
key-string cisco
EIGRPにキーを適用
int <interface>
ip authentication key-chain eigrp 1 <name>
ip authentication mode eigrp 1 md5