LoginSignup
0
0

More than 3 years have passed since last update.

【勉強会資料】Packet Tracerでルータを用いたネットワークの構築 - 完全回答

Last updated at Posted at 2020-09-16

はじめに

この記事は、2019年9月5日に開催の サポーターズCoLab勉強会「ネットワーク基礎実験ハンズオン - ルータを用いたネットワークの構築」のための資料です。勉強目的での利用をしていただくことは構いませんが、内容についてはサポートできかねますのでご了承ください。

見方

前提として、「全体の流れ」記事 にある図の通り配線が完了している状態であり、PC側についてはGUIによるIPアドレス・サブネットマスクの設定が完了しているものとします。

また、同図の通り、左側にあるPCとルータをそれぞれPC1Router1、右側にあるものをPC2Router2と置くものとし、以下ではその名称で機器を指し示すこととし、各ポートも図に示す通りとします。

スタティックルーティングによるネットワーク構築

Router1のIPアドレスの設定

Router>enable
Router#conf t
Router(config)#int fa0/0
Router(config-if)#ip add 192.168.1.2 255.255.255.0
Router(config-if)#no shut
Router(config-if)#int fa0/1
Router(config-if)#ip add 192.168.2.1 255.255.255.0
Router(config-if)#no shut
Router(config-if)#

FastEthernet0/0192.168.1.2FastEthernet0/1192.168.2.1、を設定し、それぞれのポートのshutdown状態を解除しています。

Router2のIPアドレスの設定

Router>enable
Router#conf t
Router(config)#int fa0/0
Router(config-if)#ip add 192.168.3.2 255.255.255.0
Router(config-if)#no shut
Router(config-if)#int fa0/1
Router(config-if)#ip add 192.168.2.2 255.255.255.0
Router(config-if)#no shut
Router(config-if)#

FastEthernet0/0192.168.3.2FastEthernet0/1192.168.2.2、を設定し、それぞれのポートのshutdown状態を解除しています。

Router1のルーティングテーブルの設定

Router(config-if)#exit
Router(config)#ip route 192.168.3.0 255.255.255.0 192.168.2.2
Router(config)#

192.168.3.0のネットワークへ接続するためには、次に192.168.2.2(ネクストホップアドレス)に送れば良いとルータに教えます。

Router2のルーティングテーブルの設定

Router(config-if)#exit
Router(config)#ip route 192.168.1.0 255.255.255.0 192.168.2.1
Router(config)#

192.168.1.0のネットワークへ接続するためには、次に192.168.2.1(ネクストホップアドレス)に送れば良いとルータに教えます。

PC1からPC2への通信確認

C:\>ping 192.168.3.1

Pinging 192.168.3.1 with 32 bytes of data:

Reply from 192.168.3.1: bytes=32 time<1ms TTL=126
Reply from 192.168.3.1: bytes=32 time<1ms TTL=126
Reply from 192.168.3.1: bytes=32 time<1ms TTL=126
Reply from 192.168.3.1: bytes=32 time<1ms TTL=126

Ping statistics for 192.168.3.1:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

C:\>

※一番最初は何度かRequest timed out.と出る場合がありますがそのまま何度か実行してください。

192.168.3.1(PC2)と通信ができていることが確認できます。

PC2からPC1への通信確認

C:\>ping 192.168.1.1

Pinging 192.168.1.1 with 32 bytes of data:

Reply from 192.168.1.1: bytes=32 time<1ms TTL=126
Reply from 192.168.1.1: bytes=32 time<1ms TTL=126
Reply from 192.168.1.1: bytes=32 time<1ms TTL=126
Reply from 192.168.1.1: bytes=32 time<1ms TTL=126

Ping statistics for 192.168.1.1:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

C:\>

192.168.1.1(PC1)と通信ができていることが確認できます。

Router1のルーティングテーブルの確認

Router(config)#exit
Router#show ip route
Codes: C - connected, S - static, I - IGRP, 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

C    192.168.1.0/24 is directly connected, FastEthernet0/0
C    192.168.2.0/24 is directly connected, FastEthernet0/1
S    192.168.3.0/24 [1/0] via 192.168.2.2

Router#

192.168.1.0および192.168.2.0のネットワークは直接接続されており、192.168.3.0のネットワークへは192.168.2.2経由で接続するように設定されていることが確認できます。

Router2のルーティングテーブルの確認

Router(config)#exit
Router#show ip route
Codes: C - connected, S - static, I - IGRP, 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

S    192.168.1.0/24 [1/0] via 192.168.2.1
C    192.168.2.0/24 is directly connected, FastEthernet0/1
C    192.168.3.0/24 is directly connected, FastEthernet0/0

Router#

192.168.2.0および192.168.3.0のネットワークは直接接続されており、192.168.1.0のネットワークへは192.168.2.1経由で接続する

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0