GNS3上で二つの異なるセグメントのネットワーク上で、DHCPリレーエージェントの検証を行いました。構成は以下になります。
①R1設定
R1#configure terminal
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)#end
R1#write memory
Warning: Attempting to overwrite an NVRAM configuration previously written
by a different version of the system image.
Overwrite the previous NVRAM configuration?[confirm]
Building configuration...
[OK]
②R2設定
R2#configure terminal
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)#end
R2#write memory
Warning: Attempting to overwrite an NVRAM configuration previously written
by a different version of the system image.
Overwrite the previous NVRAM configuration?[confirm]
Building configuration...
[OK]
③DHCPサーバーの構成
ホスト名:WIN2022dhcp
IP:192.168.1.100/24
GW:192.168.1.1
参考資料を元にDHCPサーバーの設定。
・参考資料
Windowsシステム構築ガイド - PRIMERGY 技術情報
『Windows Server 2016/2019/2022 DHCP、DNS構築・運用ガイド』10~17頁
(ドメイン名、WINSサーバーは設定せず)
スコープ構成は以下になります。
④DHCPリレーエージェントの構成
ホスト名:WIN2022RELAY
IP:192.168.2.100/24
GW:192.168.2.2
参考資料を元に以下のDHCPリレーエージェントの設定
・参考資料
前掲書 26~31頁
⑤Linuxのクライアントマシンを192.168.1.0/24のセグメントと、192.168.2.0/24領域にそれぞれ設置。
⑥192.168.1.0/24セグメントに設置したクライアントマシンが自動的にIPアドレスを取得していることを確認します。
ログでもdhcpによりIPが新しく得られたこと(renew)が確認出来ます。
⑦⑥と同じ方法で192.168.2.0/24セグメントに設置したクライアントマシンが自動的にIPアドレスを取得していることを確認します。
Wiresharkでパケットを確認すると、DISCOVER>OFFER>REQUEST>ACKの順でやりとりされていることを確認出来ます。そして、Relay agent192.168.2.100からYour (Client)192.168.2.101のIPが割り振られている事が確認出来ます。
なお、デフォルトで使用可能な仮想端末のVPCSではDHCPサーバーからIPアドレスが得られませんでした。
Wiresharkで確認したところ、DISCOVER>OFFER>REQUEST>ACKではなく、DISCOVER>OFFER>INFOM>ACKとなっていました。正常にREQUESTが行われていない為にIPアドレスが取得できないのかと思われます。
何故REQUESTではないのか不明ですが、VPCSではDHCPの検証が出来ないようなので、DHCPクライアントの検証を行うには、VMのクライアントマシンを準備する必要がある様です。