新ネットワークスペシャリスト道

ネットワーク、セキュリティ、何の話?

書籍「ネットワーク超入門(著 GENE) 」演習⑤ ルーティング

3

ネットワーク技術力向上のために購入した書籍「ネットワーク超入門」内の演習をCisco Packet Tracer で実際に構築してみました。

今回の演習で扱ったルーティングはネットワークの基本的かつ非常に重要な概念です。

ルーティングがなければ、異なるネットワーク間でデータを適切に転送することができません。

特に複雑なネットワーク環境において、ルーティングは効率的かつ安定的なデータ通信のために必要不可欠な仕組みとなります。

ルーティングには大きく分けて「静的ルーティング」と「動的ルーティング」がありますが、「静的ルーティング」を実際に構築してみます。

演習

演習概要

演習タイトル:ルーティング(スタティックルート)

掲載ページ:P.185-200

演習概要:3台のルータを間に挟んだPC2台を通信させる。各ルータには静的ルーティングを設定する。

各機器の配置と配線

【ネットワーク図】

 

【PC1】から【PC4】

【Router1】から【Router3】

【ネットワークIPアドレス表】

ネットワーク設定

各機器のネットワーク設定を行っていきます。PCの設定はGUIで行いました。ルータに関しては、CCNA勉強のため、CLIからコマンドにて設定しています。

PC1とPC2に関しては、別セグメント(10.3.3.0/24、192.168.10.0/24、192.168.20.0/24)への通信が必要なため、デフォルトゲートウェイの設定が必要です。

【PC1】

IPアドレス 10.1.1.100

サブネットマスク 255.255.255.0

デフォルトゲートウェイ 10.1.1.1

【PC1】

IPアドレス 10.1.1.100

サブネットマスク 255.255.255.0

デフォルトゲートウェイ 10.3.3.1

【Router1】

Router(config)#hostname Router1

Router1(config)#interface fastEthernet 0/0
Router1(config-if)#ip address 10.1.1.1 255.255.255.0
Router1(config-if)#no shutdown 
Router1(config-if)#exit
Router1(config)#interface fastEthernet 0/1
Router1(config-if)#ip address 192.168.10.1 255.255.255.0
Router1(config-if)#no shutdown
Router1(config-if)#exit

#スタティックルートの設定
Router1(config)#ip route 10.3.3.0 255.255.255.0 192.168.10.2

【Router2】

Router(config)#hostname Router2
Router2(config)#interface fastEthernet 0/0
Router2(config-if)#ip address 192.168.10.2 255.255.255.0
Router2(config-if)#no shutdown 
Router2(config-if)#exit
Router2(config)#interface fastEthernet 0/1
Router2(config-if)#ip address 192.168.20.1 255.255.255.0
Router2(config-if)#no shutdown
Router2(config-if)#exit

#スタティックルートの設定
Router2(config)#ip route 10.1.1.0 255.255.255.0 192.168.10.1
Router2(config)#ip route 10.3.3.0 255.255.255.0 192.168.20.2

【Router3】

Router(config)#hostname Router3
Router3(config)#interface fastEthernet 0/0
Router3(config-if)#ip address 192.168.20.2 255.255.255.0
Router3(config-if)#no shutdown 
Router3(config-if)#exit
Router3(config)#interface fastEthernet 0/1
Router3(config-if)#ip address 10.3.3.1 255.255.255.0
Router3(config-if)#no shutdown
Router3(config-if)#exit

#スタティックルートの設定
Router3(config)#ip route 10.1.1.0 255.255.255.0 192.168.20.1

 

ルータ設定確認

ルータの設定がどうなっているかの確認を各ルータでコマンドを実行して確認します。

【Router1】

Router1#show ip route
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, E - EGP
       i - IS-IS, 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

Gateway of last resort is not set

     10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
C       10.1.1.0/24 is directly connected, FastEthernet0/0
L       10.1.1.1/32 is directly connected, FastEthernet0/0
S       10.3.3.0/24 [1/0] via 192.168.10.2
     192.168.10.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.10.0/24 is directly connected, FastEthernet0/1
L       192.168.10.1/32 is directly connected, FastEthernet0/1

Router1#show ip interface brief

Interface IP-Address OK? Method Status Protocol

FastEthernet0/0 10.1.1.1 YES manual up up

FastEthernet0/1 192.168.10.1 YES manual up up

Vlan1 unassigned YES unset administratively down down

【Router2】

Router2#show ip route

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, E - EGP

i - IS-IS, 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

 

Gateway of last resort is not set

 

10.0.0.0/24 is subnetted, 2 subnets

S 10.1.1.0/24 [1/0] via 192.168.10.1

S 10.3.3.0/24 [1/0] via 192.168.20.2

192.168.10.0/24 is variably subnetted, 2 subnets, 2 masks

C 192.168.10.0/24 is directly connected, FastEthernet0/0

L 192.168.10.2/32 is directly connected, FastEthernet0/0

192.168.20.0/24 is variably subnetted, 2 subnets, 2 masks

C 192.168.20.0/24 is directly connected, FastEthernet0/1

L 192.168.20.1/32 is directly connected, FastEthernet0/1

Router2#show ip interface brief

Interface IP-Address OK? Method Status Protocol

FastEthernet0/0 192.168.10.2 YES manual up up

FastEthernet0/1 192.168.20.1 YES manual up up

Vlan1 unassigned YES unset administratively down down

 

【Router3】

Router3#show ip route
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, E - EGP
       i - IS-IS, 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

Gateway of last resort is not set

     10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
S       10.1.1.0/24 [1/0] via 192.168.20.1
C       10.3.3.0/24 is directly connected, FastEthernet0/1
L       10.3.3.1/32 is directly connected, FastEthernet0/1
     192.168.20.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.20.0/24 is directly connected, FastEthernet0/0
L       192.168.20.2/32 is directly connected, FastEthernet0/0

Router3#show ip interface brief 
Interface              IP-Address      OK? Method Status                Protocol 
FastEthernet0/0        192.168.20.2    YES manual up                    up 
FastEthernet0/1        10.3.3.1        YES manual up                    up 
Vlan1                  unassigned      YES unset  administratively down down

疎通確認

PC1からPC2へPING疎通を確認します。

PC1からPC2へTracertコマンドを確認します。

参考書籍

書籍名:ネットワーク超入門 手を動かしながら学ぶIPネットワーク 
著者:GENE 
出版社:技術評論社