はじめに
仮想ルータを外部ネットワーク(インターネット)に接続する方法をまとめています。
環境
ブロードバンドルータはDHCP機能を搭載しており、PCにIPアドレスを自動で割り当てているものとします。
手順
GNS3を起動します。
プロジェクトを作成し、Cloudとルータをマッピングします。
ルータを設定します。
R1#conf t
R1(config)#int fa0/0
R1(config-if)#ip add dhcp
R1(config-if)#shut
R1(config-if)#no shut
R1(config-if)#end
DHCPの状態を確認します。
R1#sh dhcp lease
Temp IP addr: 192.168.100.106 for peer on Interface: FastEthernet0/0 ←IPアドレスが割り当てられました
Temp sub net mask: 255.255.255.0
DHCP Lease server: 192.168.100.10, state: 2 Requesting
DHCP transaction id: 770
Lease: 172800 secs, Renewal: 0 secs, Rebind: 0 secs
Next timer fires after: 00:00:00
Retry count: 1 Client-ID: cisco-c801.2dd4.0000-Fa0/0
Hostname: R1
動作確認
疎通テストを実施します。
R1#ping 8.8.8.8 ←Google Public DNSです。
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds:
!!!!! ←疎通OKです。
Success rate is 100 percent (5/5), round-trip min/avg/max = 40/367/1620 ms
これで仮想ルータはインターネットに接続できました。