ルータ・スイッチ 基礎教育

Download Report

Transcript ルータ・スイッチ 基礎教育

ルータ・スイッチ 基礎教育
(ルータ編)
1
Agenda
•
•
•
•
•
•
•
~ルータ編~
ルーティングテーブル
スタティックルートの設定
ルーティングプロトコルの設定
アクセスリストの設定
HSRPの設定
NATの設定
SNMPの設定
• 設定練習
2
ルーティングの基礎
経路情報
アドミニストレーティブディスタンス値
直接接続の経路
0
スタティックルート
1
EIGRPサマリ
5
外部BGP
20
EIGRP内部ルート
90
IGRP
100
OSPF
110
IS-IS
115
RIP
120
EGP
140
EIGRP外部ルート
170
内部BGP
200
不明(Unkown)
255
ある宛先に対して複数のルーティングプロトコルが経路を提供している場合に、
アドミニストレーティブディスタンス値がより小さいものが優先される。
3
ルーティングテーブル
Router# show ip route
← ルーティングテーブル確認コマンド
4
スタティックルートの設定
Rotuer_Bに以下の設定を入れます。
Router_B(config)# ip route 172.16.1.0 255.255.255.0 172.16.2.1
Router_B(config)# ip route 172.16.4.0 255.255.255.0 172.16.3.2
↑
宛先ネットワーク
↑
ネクストホップ
5
EIGRPの特徴
・Cisco社独自のルーティングプロトコル
・高速なコンバージェンスが可能
・使用する帯域が小さい
・IP,IPX,AppleTalkといった複数のプロトコルをサポートする
・ループフリーのアルゴリズム(DUAL)を採用
・経路情報の変更分のみを送信する
・VLSM,不連続サブネット,クラスレスルーティングに対応
・IGRPと互換性を持つ
・Varianceコマンドによって、不均等パスで負荷分散が可能。(最大6つ)
・メトリックとして、「帯域幅」「遅延」「負荷」「信頼性」「MTU」の5つを使用
参考:
メトリック=[K1×帯域幅 + (K2 × 帯域幅) ÷ (256 - 負荷) + (K3 × 遅延)] × [K5 ÷ (信頼度 + K4)]
係数であるK1~K5のデフォルト値は
K1=1,K2=0,K3=1,K4=0,K5=0
6
EIGRPの設定①
AS番号
← EIGRPを動作させ,設定モードに入る
Router_A(config)# router eigrp 1
Router_A(config-router)# network 172.16.0.0
Router_A(config-router)# network 172.17.0.0
Router_B(config)# router eigrp 1
Router_B(config-router)# network 172.17.0.0
Router_B(config-router)# network 172.18.0.0
7
EIGRPの設定②
Router_Aのルーティングテーブル
C 172.16.0.0/16 is directly connected, Ethernet0
C 172.17.0.0/16 is directly connected, Serial0
D 172.18.0.0/16 [90/2195456] via 172.17.0.2, 00:01:33, Serial0
Router_Bのルーティングテーブル
D 172.16.0.0/16 [90/2195456] via 172.17.0.1, 00:00:02, Serial0
C 172.17.0.0/16 is directly connected, Serial0
C 172.18.0.0/16 is directly connected, Ethernet0
8
EIGRPの確認コマンド
Router_A# show ip protocols
← 稼動しているルーティングプロトコルを確認
Router_A# show ip eigrp topology
Router_A# show ip eigrp neighbors
← EIGRPのトポロジーテーブルを表示
← EIGRPのネイバーテーブルを表示
Router_A# show
ip protocols
Router_A#
show
ip eigrp neighbors
topology
Routing Protocol is "eigrp 1"
IP-EIGRP
Topology
neighborsTable
for process
for process
1
1
Outgoing update filter list for all interfaces is not set
HIncoming
Address
update filter list for Interface
all interfaces isHold
not setUptime SRTT RTO Q Seq
Default networks
flagged in
updates
Codes:
P - Passive,
Aoutgoing
- Active,
(sec)
U - Update,
(ms) Q Cnt
- Query,
Num R - Reply,
incoming updates
0Default
172.17.0.2
Se0
11 01:59:19 24 200 0 2
r -networks
Reply accepted
status from
EIGRP metric weight K1=1, K2=0, K3=1, K4=0, K5=0
EIGRP maximum hopcount 100
maximum metric
variance 1
PEIGRP
172.16.0.0/16,
1 successors,
FD is 281600
Redistributing: eigrp 1
via Connected, Ethernet0
Automatic network summarization is in effect
PAutomatic
172.17.0.0/16,
1 successors, FD is 2169856
address summarization:
172.17.0.0/16
Ethernet0
viaforConnected,
Serial0
172.16.0.0/16 for Serial0
PRouting
172.18.0.0/16,
1 successors, FD is 2195456
for Networks:
172.16.0.0 via 172.17.0.2 (2195456/281600), Serial0
172.17.0.0
Routing Information Sources:
Gateway
Distance
Last Update
172.17.0.2
90
01:31:47
Distance: internal 90 external 170
9
OSPFの特徴
・マルチベンダー対応
・リンクステート型ルーティングプロトコル
・効率よいルーティングのための「エリア」の概念
・クラスレスルーティングプロトコル
・ルーティングテーブルのコンバージェンス時間が短い
・ループが発生する可能性が極めて小さい
・メトリックとして「コスト」を採用
・コンバージェンス時は、Helloプロトコルによる定期的なキープアライブ
・ネットワークの変更があったときだけルーティング情報を送信
・マルチキャストによる通信
・認証機能のサポート
・CPU、メモリの使用率が高い
・きちんとしたアドレス設計が必要
10
OSPFの設定①
プロセス番号
Router_A(config)# router ospf 1
← OSPFを動作させ,設定モードに入る
Router_A(config-router)# network 192.168.1.0 0.0.0.255 area 0
Router_A(config-router)# network 172.16.0.0 0.0.0.3 area 0
Router_B(config)# router ospf 1
Router_B(config-router)# network 192.168.3.0 0.0.0.255 area 0
Router_B(config-router)# network 172.16.0.0 0.0.0.3 area 0
Router(config)# interface serial 0
Router(config-if)# bandwidth 64
← 適切な帯域幅を設定
11
OSPFの設定②
Router_Aのルーティングテーブル
C 192.168.1.0/24 is directly connected, Ethernet0
O 192.168.3.0/24 [110/1572] via 172.16.0.2, 00:01:27, Serial0
172.16.0.0/30 is subnetted, 1 subnets
C
172.16.0.0 is directly connected, Serial0
Router_Bのルーティングテーブル
O 192.168.1.0/24 [110/1572] via 172.16.0.1, 00:00:06, Serial0
C 192.168.3.0/24 is directly connected, Ethernet0
172.16.0.0/30 is subnetted, 1 subnets
C
172.16.0.0 is directly connected, Serial0
12
OSPFの確認コマンド
Router_A# show ip protocols
← 稼動しているルーティングプロトコルを確認
← Helloパケットの送信間隔、Dead間隔、エリア情報、
隣接関係、ROUTERID、ネットワークタイプを確認
Router_A# show ip ospf neighbor ← OSPFネットワークの隣接関係、プライオリティ、
Stateに関する情報を確認
Router_A# show ip ospf interface
Router_A#
show ip ospf
interface
Router_A#show
neighbor
Router_A#
showipipospf
protocols
Ethernet0 is up, line protocol is up
Routing
Protocol
is "ospf 1"
Internet Address
192.168.1.1/24,
Area 0
Neighbor
ID
Pri
State
Dead
Time
Address
Process
ID 1,
Router IDevery
192.168.1.1,
Network
Type
BROADCAST,
Cost: 10 Interface
Sending
updates
0 seconds
Transmit Delay is 1 sec,
DR, -Priority 00:00:32
1
192.168.3.1
1 State
FULL/
Serial0
Invalid
after
0
seconds,
hold
down
0, flushed172.16.0.2
after 0
Designated Router (ID) 192.168.1.1, Interface address 192.168.1.1
Outgoing
update router
filter on
listthis
fornetwork
all interfaces is not set
No
backup designated
Timer
intervals
configured,
Hello
Dead
Wait 40, Retransmit
5
Incoming
update
filter
list10,for
all 40,
interfaces
is not set
Hello due in 00:00:03
Redistributing:
ospf 1
Neighbor Count is 0, Adjacent neighbor count is 0
Routing
Serial0
is up,for
line Networks:
protocol is up
Internet
Address
192.168.1.0172.16.0.1/30, Area 0
Process ID 1, Router ID 192.168.1.1, Network Type POINT_TO_POINT, Cost: 1562
172.16.0.0/30
Transmit Delay is 1 sec, State POINT_TO_POINT,
Routing
Information
Sources:
Timer
intervals
configured, Hello
10, Dead 40, Wait 40, Retransmit 5
Hello
due in 00:00:02Distance
Gateway
Last Update
Neighbor Count is 1, Adjacent neighbor count is 1
192.168.3.1
110
00:11:15
Adjacent with neighbor 192.168.3.1
Distance:
(default is
110)
Serial1
is administratively
down,
line protocol is down
OSPF not enabled on this interface
13
アクセスリストの設定
Ciscoルータでセキュリティを実装するには、
ACL(アクセスリスト)と呼ばれるパケットフィルタリングを定義します。
ACLを定義することで、以下のようなフィルタリング条件を定義することができます。
・送信元IPアドレス
・宛先IPアドレス
・TCP、UDP、ICMPなどのプロトコル
・WWW、FTPなどのアプリケーションサービスへの接続
種類
番号の範囲
標準IPアクセスリスト
1~99
拡張IPアクセスリスト
100~199 ※IOS12.0以降では、2,000~2699も使用可能
AppleTalk
600~699
標準IPX
800~899
拡張IPX
900~999
Novel SAP
1,000~1,099
※IOS12.0以降では、1,300~1999も使用可能
14
標準アクセスリストの設定
Router(config)#access-list {番号} {permit | deny} {送信元IP} {ワイルドカードマスク}
Router(config-if)#ip access-group {番号} {in | out}
設定例)
PCが所属する「192.168.1.0/24」から、
Router_Bへのアクセスを禁止する標準IPアクセスリストを作成します。
Router_B(config)# access-list 1 deny 192.168.1.0 0.0.0.255
Router_B(config)# access-list 1 permit any
Router_B(config)# int s0
Router_B(config-if)# ip access-group 1 in
15
拡張アクセスリストの設定
Router(config)#access-list {番号} {permit | deny} {プロトコル} {送信元IP}
{送信元ワイルドカードマスク} {宛先IP} {宛先ワイルドカードマスク} [オプション]
Router(config-if)#ip access-group {番号} {in | out}
設定例)
PCが所属する「192.168.1.0/24」から、
Router_BのHTTPサービスへ接続できないようにする拡張IPアクセスリストを作成します。
Router_B(config)# access-list 100 deny tcp 192.168.1.0 0.0.0.255 host 192.168.2.2 eq www
Router_B(config)# access-list 100 permit ip any any
Router_B(config)# int s0
Router_B(config-if)# ip access-group 100 in
16
HSRPの設定
設定例)
RouterA(config)# interface ethernet 0
RouterA(config-if)# standby 1 ip 192.168.1.254
RouterA(config-if)# standby 1 priority 255
← 仮想IPアドレスを設定
← プライオリティをあげる
RouterB(config)# interface ethernet 0
RouterB(config-if)# standby 1 ip 192.168.1.254
← 仮想IPアドレスを設定
17
HSRPの確認コマンド
異常時
通常時
RotuerA# show standby
Ethernet0 - Group 1
State is Active
Init (interface down)
5 state changes, last state change 00:00:46
3
00:01:05
Virtual IP address is 192.168.1.254
Active virtual MAC address is unknown
0000.0c07.ac01
Local virtual MAC address is
0000.0c07.ac01
(default)
Local virtual MAC
address is
0000.0c07.ac01
(bia)
Hello time 3 sec,
hold time 10 sec
Hello time 3 disabled
Preemption
sec, hold time 10 sec
Active
Next router
hello sent
is unknown
in 0.276 secs
Preemption
Standby
router
disabled
is unknown
Active router
Priority
255 (configured
is local
255)
Standby
IP
redundancy
router name
is 192.168.1.2,
is "hsrp-Et0-1"
priority
(default)
100
(expires in 8.264 sec)
Priority 255 (configured 255)
IP redundancy name is "hsrp-Et0-1" (default)
RouterB# show standby
Ethernet0 - Group 1
State is Active
Standby
4 state changes, last state change 00:01:02
2
00:01:18
Virtual IP address is 192.168.1.254
Active virtual MAC address is 0000.0c07.ac01
Local virtual MAC address is
0000.0c07.ac01 (bia)
(default)
Hello time 3 sec, hold time 10 sec
Next hello sent in 0.416
2.344 secs
Preemption disabled
Active router is local
192.168.1.1, priority 255
(expires
inrouter
8.348 is
sec)
Standby
unknown
Standby100
Priority
router
(default
is local
100)
Priority
IP
redundancy
100 (default
name is
100)
“hsrp-Et0-1” (default)
IP redundancy name is "hsrp-Et0-1" (default)
18
NATの設定
設定例)
RouterA(config)# interface Ethernet0
RouterA(config-if)# ip address 10.1.1.2 255.255.255.0
RouterA(config-if)# ip nat inside
← NATの内側インタフェースに指定する
RouterA(config)# interface Serial0
RouterA(config-if)# ip address 192.168.1.2 255.255.255.0
RouterA(config-if)# ip nat outside
← NATの外側インタフェースに指定する
RouterA(config)# ip nat inside source static 10.1.1.1 192.168.1.1
↑
内側(LAN側)の送信元アドレスを10.1.1.1から192.168.1.1に静的に変換
19
NATの確認コマンド
RouterA# show ip nat translations
Pro Inside global Inside local Outside local Outside global
--- 192.168.1.1 10.1.1.1
----↑
10.1.1.1が192.168.1.1に対応付けられているのが確認できる
NATは他に、ダイナミックNATとPATがあります。
20
SNMPの設定
Router(config)# snmp-server community public RO
↑
SNMPマネージャがSNMPエージェントのMIB情報を取得可能にする
Router(config)# snmp-server host 192.168.0.1 public ← Trapメッセージの送付先を指定
Router(config)# snmp-server enable traps
← Trapメッセージを投げるようになる
21
設定練習
192.168.2.1
RouterA
192.168.1.100
192.168.1.1
192.168.1.0/24
192.168.3.1
RouterB
192.168.2.2
192.168.2.0/24
192.168.4.1
RouterC
192.168.3.2
192.168.3.0/24
192.168.4.100
192.168.4.0/24
1. スタティックルートで全ての疎通が通るよう設定
2. スタティックルートの設定を全て削除
3. EIGRP(AS番号:10)を利用し、全ての疎通が通るよう設定
22