本稿では前稿で作成したルーター及びイーサネットスイッチルーターの設定を行っていきます。イーサネットスイッチ及びルーターの配置は以下の画像を参考にしてください。
◇本稿の構成
〇EtherSwitch1
・hostname ESW1
・interface FastEthernet1/0
switchport access vlan 100
・interface FastEthernet1/1
switchport access vlan 100
・vlan name web
〇Router1
・hostname R1
・interface FastEthernet0/0
ip address 192.168.1.1 255.255.255.0
・interface FastEthernet0/1
ip address 10.10.10.1 255.255.255.0
・router rip
version 2
network 10.0.0.0
network 192.168.1.0
no auto-summary
〇Router2
・hostname R2
・interface FastEthernet0/0
ip address 192.168.2.2 255.255.255.0
・interface FastEthernet0/1
ip address 10.10.10.2 255.255.255.0
・router rip
version 2
network 10.0.0.0
network 192.168.2.0
no auto-summary
◇ワークスペースへの設置
先ずは以下の手順で画面中央のワークスペースにルーター及びスイッチを設置します。
①左側のGNS3ツールバーから一番上のルーターアイコンをクリックします。
②左側リスト(ノードドッグ)からEtherSwitch routerをドラッグアンドドロップします。
③左側リスト(ノードドッグ)からRouter(本稿例:c3725)を二つドラッグアンドドロップします。
④左側のGNS3ツールバーから一番下のLANケーブルアイコンをクリックします。
⑤EtherSwitch1とRouter1の間に以下の結線を行います。
EtherSwitch1のFastEthernet 1/0 ⇔ Router1のFastEthernet 0/0
⑥EtherSwitch1とRouter2の間に以下の結線を行います。
EtherSwitch1のFastEthernet 1/1 ⇔ Router2のFastEthernet 0/0
◇ESW(イーサネットスイッチ)の設定
ワークスペース上のEtherSwitch1を右クリックし、「Console」をクリックし、コンソール画面を起動し、以下のコマンドを入力してください。
EtherSwitch1#configure terminal
EtherSwitch1(config)#hostname ESW1
ESW1(config)#vlan 100
ESW1(config-vlan)#name Web
ESW1(config-vlan)#exit
ESW1(config)#interface range FastEthernet 1/0 - 1
ESW1(config-if-range)#switchport mode access
ESW1(config-if-range)#switchport access vlan 100
ESW1(config-if-range)#no shutdown
ESW1(config-if-range)#exit
ESW1(config)#exit
ESW1#write memory
なお、作業後のwrite memoryを忘れると電源を切った時に設定が消えてしまうので忘れないようにしてください。
普段サーバーしかやっていないと結構忘れやすいかと思うので、注意してください。自分も忘れた事があり、作業終了後電源を切ってしまい、数時間分の作業を無駄にした事があります……。
◇R1の設定
ワークスペース上のRouter1を右クリックし、「Console」をクリックし、コンソール画面を起動し、以下のコマンドを入力してください。
Router1#configure terminal
Router1(config)#hostname R1
R1(config)#interface fastEthernet 0/0
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface FastEthernet 0/1
R1(config-if)#ip address 10.10.10.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#no auto-summary
R1(config-router)#network 192.168.1.0
R1(config-router)#network 10.0.0.0
R1(config-router)#exit
R1(config)#exit
R1#write memory
◇R2の設定
ワークスペース上のRouter2を右クリックし、「Console」をクリックし、コンソール画面を起動し、以下のコマンドを入力してください。
Router2#configure terminal
Router2(config)#hostname R2
R2(config)#interface FastEthernet 0/0
R2(config-if)#ip address 192.168.2.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface FastEthernet 0/1
R2(config-if)#ip address 10.10.10.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#router rip
R2(config-router)#version 2
R2(config-router)#no auto-summary
R2(config-router)#network 192.168.2.0
R2(config-router)#network 10.0.0.0
R2(config-router)#exit
R2(config)#exit
R2#write memory
◇ネットワークの接続確認
①R1のコンソールからpingでネットワークの接続を確認します。
R1#ping 192.168.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 92/110/140 ms
②R2のコンソールからもpingでネットワークの接続を確認します。
R2#ping 192.168.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 76/84/100 ms
pingが通らない場合は設定の誤りが無いか見直して下さい。
以上でネットワークの接続の設定が終了です。
続いて次稿では仮想マシンの設定を行います。