7. 【Cisco】ラボ#7 ルータの設定1
FO
R
S
E
7
手順1
ルータは起動に時間がかかります
セットアップモードが起動したら、noと入力、もしくはcttl+c
手順2 メッセージが表示され、Enterキーを押します。Router>のプロンプトが表示されます
手順3 特権モードに移行します。Router#のプロンプトが表示されます
手順4 グローバルコンフィグレーションモードに移行し,ホスト名を変更します。Router(config)#が表
示されます
手順5telnetで他のルータにログイン出来るようにする
ユーザ、パスワードを設定しないとリモートログインできない為。
手順6 4ページの構成図を参考に結線する
--- System Configuration Dialog ---
Would you like to enter the initial configuration dialog? [yes/no]:no
Press RETURN to get started!
Router>
Router>enable
Router#
Router#configure terminal
Router(config)#hostname RT-1
RT-1(config)#no ip domain lookup
RT-1(config)#line console 0 ←0しかない
RT-1(config-line)#logging synchronous
RT-1(config-line)#end
RT-1 #configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
RT-1(config)#line vty 0 4
RT-1(config-line)#password cisco
RT-1(config-line)#transport input telnet
RT-1(config-line)#login
RT-1(config-line)#exit
RT-1(config)#enable password cisco
RT-1(config)#end
RT-1#
11. 【Cisco】ラボ#7 ルータの確認 (RT-1,2,3)
FO
R
S
E
11
手順8 検証する 手順9 疎通確認する
・PC(コマンドプロンプト) RT-1→「192.168.10.150」
RT-2→「192.168.20.150」
RT-3→「192.168.30.150」
・ルーター(Tera Term) RT-1→「172.16.50.40」 「172.16.60.50」
RT-2→「172.17.70.50」 「172.16.80.60」
RT-3→「172.16.90.60」 「172.16.70.40」
手順9.5 telnetで入れることを確認する
Password:cisco
RT-1#show vlan-switch
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Gi1, Gi2, Gi3, Gi4, Gi5, Gi6
Gi7
10 VLAN0010 active Gi0
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup
RT-1#show ip interface brief
Interface IP-Address OK? Method Status Protocol
Async3 unassigned YES unset down down
BRI0 unassigned YES unset administratively down down
BRI0:1 unassigned YES unset administratively down down
BRI0:2 unassigned YES unset administratively down down
FastEthernet0 172.16.60.10 YES manual up up
GigabitEthernet0 unassigned YES unset up up
GigabitEthernet1 unassigned YES unset down down
GigabitEthernet2 unassigned YES unset down down
GigabitEthernet3 unassigned YES unset down down
GigabitEthernet4 unassigned YES unset down down
GigabitEthernet5 unassigned YES unset down down
GigabitEthernet6 unassigned YES unset down down
GigabitEthernet7 unassigned YES unset down down
GigabitEthernet8 172.16.50.10 YES manual up up
Vlan1 unassigned YES unset down down
Vlan10 192.168.10.150 YES manual up up
RT-1#telnet 172.16.50.40
RT-2→172.17.70.50
RT-3→172.16.90.60
12. 【Cisco】ラボ#7 ルータの確認 (RT-4,5,6)
FO
R
S
E
12
手順8 検証する
手順9 疎通確認する
・ルーター(Tera Term) RT-4→「172.16.70.30」 「172.16.50.10」
「172.16.100.60」 「172.17.90.50」
RT-5→「172.16.60.10」 「172.17.70.20」
「172.17.90.40」 「172.16.110.60」
RT-6→「172.16.80.20」 「172.16.90.30」
「172.16.110.50」 「172.16.100.40」
手順9.5 telnetで入れることを確認する
Password:cisco
RT-5→172.16.60.10
RT-6→172.16.80.20
RT-4#show ip interface brief
Interface IP-Address OK? Method Status Protocol
Embedded-Service-Engine0/0 unassigned YES unset administratively down down
GigabitEthernet0/0 172.16.70.40 YES manual up up
GigabitEthernet0/1 172.16.50.40 YES manual up up
FastEthernet0/0/0 172.16.100.40 YES manual up up
FastEthernet0/0/1 172.17.90.40 YES manual up up
RT-4#
RT-4#telnet 172.16.70.30
13. 【Cisco】ラボ#7 OSPFの設定 (RT-1,2,3)
FO
R
S
E
13
手順11 ハロー間隔とコスト値を設定する (RT-1,2,3共通)手順10 OSPFを有効化する、インターフェースとエリアを設定する (RT-1)
手順10 (RT-2)
手順10 (RT-3)
RT-1#
RT-1#configure terminal
RT-1(config)#interface gigabitEthernet 8
RT-1(config-if)#ip ospf hello-interval 10
RT-1(config-if)#ip ospf cost 10
RT-1(config-if)#exit
RT-1(config)#interface fastEthernet 0
RT-1(config-if)# ip ospf hello-interval 10
RT-1(config-if)# ip ospf cost 20
RT-1(config-if)#exit
RT-1(config)#router ospf 1
RT-1(config-router)#router-id 1.1.1.1
RT-1(config-router)#network 192.168.10.0 0.0.0.255 area 0
RT-1(config-router)#network 172.16.50.0 0.0.0.255 area 0
RT-1(config-router)#network 172.16.60.0 0.0.0.255 area 0
RT-1(config-router)#passive-interface gigabitEthernet 0
RT-1(config-router)#end
RT-2(config)#router ospf 1
RT-2(config-router)#router-id 2.2.2.2
RT-2(config-router)#network 192.168.20.0 0.0.0.255 area 0
RT-2(config-router)#network 172.17.70.0 0.0.0.255 area 0
RT-2(config-router)#network 172.16.80.0 0.0.0.255 area 0
RT-2(config-router)#passive-interface gigabitEthernet 0
RT-2(config-router)#end
RT-3(config)#router ospf 1
RT-3(config-router)#router-id 3.3.3.3
RT-3(config-router)#network 192.168.30.0 0.0.0.255 area 0
RT-3(config-router)#network 172.16.70.0 0.0.0.255 area 0
RT-3(config-router)#network 172.16.90.0 0.0.0.255 area 0
RT-3(config-router)#passive-interface gigabitEthernet 0
RT-3(config-router)#end
説明
router ospf 1 OSPFのプロセスを起動させます
router-id 1.1.1.1 必須ではありません。判り易さ。loopbackでもOK
未指定の場合は、IPアドレスの最大
network xxxx OSPFを有効にするネットワークアドレス
passive-interface ルーティングプロトコルを流さない
PCがある事が判っている
hello-interval 10秒毎に交換
14. 【Cisco】ラボ#7 OSPFの設定 (RT-4,5,6)
FO
R
S
E
14
手順11 ハロー間隔とコスト値を設定する (RT-4,5,6共通)手順10 OSPFを有効化するインターフェースとエリアを設定する (RT-4)
手順10 (RT-5)
手順10 (RT-6)
RT-4#
RT-4#configure terminal
RT-4(config)#interface gigabitEthernet 0/0
RT-4(config-if)#ip ospf hello-interval 10
RT-4(config-if)#ip ospf cost 20
RT-4(config-if)#exit
RT-4(config)#interface gigabitEthernet 0/1
RT-4(config-if)#ip ospf hello-interval 10
RT-4(config-if)#ip ospf cost 10
RT-4(config-if)#exit
RT-4(config)#interface fastEthernet 0/0/0
RT-4(config-if)# ip ospf hello-interval 10
RT-4(config-if)# ip ospf cost 20
RT-4(config-if)#exit
RT-4(config)#interface fastEthernet 0/0/1
RT-4(config-if)# ip ospf hello-interval 10
RT-4(config-if)# ip ospf cost 20
RT-4(config-if)#exit
RT-4(config)#router ospf 1
RT-4(config-router)#router-id 4.4.4.4
RT-4(config-router)#network 172.16.70.0 0.0.0.255 area 0
RT-4(config-router)#network 172.16.50.0 0.0.0.255 area 0
RT-4(config-router)#network 172.16.100.0 0.0.0.255 area 0
RT-4(config-router)#network 172.17.90.0 0.0.0.255 area 0
RT-4(config-router)#end
RT-5(config)#router ospf 1
RT-5(config-router)#router-id 5.5.5.5
RT-5(config-router)#network 172.16.60.0 0.0.0.255 area 0
RT-5(config-router)#network 172.17.70.0 0.0.0.255 area 0
RT-5(config-router)#network 172.17.90.0 0.0.0.255 area 0
RT-5(config-router)#network 172.16.110.0 0.0.0.255 area 0
RT-5(config-router)#end
RT-6(config)#router ospf 1
RT-6(config-router)#router-id 6.6.6.6
RT-6(config-router)#network 172.16.80.0 0.0.0.255 area 0
RT-6(config-router)#network 172.16.90.0 0.0.0.255 area 0
RT-6(config-router)#network 172.16.110.0 0.0.0.255 area 0
RT-6(config-router)#network 172.16.100.0 0.0.0.255 area 0
RT-6(config-router)#end
15. 【Cisco】ラボ#7 OSPFの確認(1)
SE 15
手順12 ルーターID、ネットワーク、passiveインターフェース (RT-1,2,3はgi0、RT-4,5,6は無し)、
エリアを確認する
手順13 コスト値、ハロー間隔の値を確認する
RT-1#show ip ospf interface brief
Interface PID Area IP Address/Mask Cost State Nbrs F/C
Fa0 1 0 172.16.60.10/24 20 DR 1/1
Gi8 1 0 172.16.50.10/24 10 DOWN 0/0
Vl10 1 0 192.168.10.150/24 1 DR 0/0
RT-1#show run | section router
router ospf 1
router-id 1.1.1.1
passive-interface GigabitEthernet0
network 172.16.50.0 0.0.0.255 area 0
network 172.16.60.0 0.0.0.255 area 0
network 192.168.10.0 0.0.0.255 area 0
RT-1#
RT-1#show ip ospf interface | include Hello
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:06
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:03
FOR
手順14 ネイバーリストを確認する (隣のルーターが認識されているか)
RT-1#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
5.5.5.5 1 FULL/DR 00:00:36 172.16.60.50 FastEthernet0
4.4.4.4 1 FULL/DR 00:00:36 172.16.50.40 GigabitEthernet8
RT-1#
16. 【Cisco】ラボ#7 OSPFの確認(2)
S
E
16
手順16 ルートが増えていることを確認する (Oの列を確認)
どのルートを通っているかを確認
RT-1#show ip route ospf
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override
Gateway of last resort is not set
172.16.0.0/16 is variably subnetted, 9 subnets, 2 masks
O 172.16.70.0/24 [110/30] via 172.16.50.40, 01:41:18, GigabitEthernet8
O 172.16.80.0/24 [110/50] via 172.16.60.50, 01:19:12, FastEthernet0
[110/50] via 172.16.50.40, 01:18:04, GigabitEthernet8
O 172.16.90.0/24 [110/40] via 172.16.50.40, 01:19:02, GigabitEthernet8
O 172.16.100.0/24 [110/30] via 172.16.50.40, 01:18:04, GigabitEthernet8
O 172.16.110.0/24 [110/40] via 172.16.60.50, 01:18:20, FastEthernet0
172.17.0.0/24 is subnetted, 2 subnets
O 172.17.70.0 [110/30] via 172.16.60.50, 01:19:12, FastEthernet0
O 172.17.90.0 [110/30] via 172.16.50.40, 01:19:02, GigabitEthernet8
O 192.168.20.0/24 [110/31] via 172.16.60.50, 01:19:12, FastEthernet0
O 192.168.30.0/24 [110/31] via 172.16.50.40, 00:21:25, GigabitEthernet8
RT-1#
手順15 プロトコルを交換していることを確かめる
RT-1#show ip protocols
*** IP Routing is NSF aware ***
Routing Protocol is "application"
Sending updates every 0 seconds
Invalid after 0 seconds, hold down 0, flushed after 0
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Maximum path: 32
Routing for Networks:
Routing Information Sources:
Gateway Distance Last Update
Distance: (default is 4)
Routing Protocol is "ospf 1"
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Router ID 1.1.1.1
Number of areas in this router is 1. 1 normal 0 stub 0 nssa
Maximum path: 4
Routing for Networks:
172.16.50.0 0.0.0.255 area 0
172.16.60.0 0.0.0.255 area 0
192.168.10.0 0.0.0.255 area 0
Routing Information Sources:
Gateway Distance Last Update
4.4.4.4 110 01:23:02
5.5.5.5 110 01:18:38
6.6.6.6 110 01:17:40
3.3.3.3 110 00:21:00
2.2.2.2 110 01:18:48
172.17.90.40 110 02:08:58
192.168.30.150 110 02:13:55
172.16.110.60 110 02:13:55
Distance: (default is 110)