FortigateをDHCPサーバーにして、PC端末を接続したときにサーバーからCatalystを通ってIPアドレスを取得出来る構成にします。
環境
- Fortigate60D v6.0.7
- Cisco WS-C3560CG-8PC-S 12.2(55)EX3
- PC端末 windows11
イメージ図
DHCP_Snooping
FortigateをDHCPサーバーに
Catalystとtrunkモードで通信したいので、internal1にVLANを紐付け。
なお、スイッチがaccessモードでもdhpcパケットを通信可能。その場合は、物理I/FにDHCPの設定をする。

VLAN番号とI/FとなるIp/ネットワークマスクを入力。
DHCPサーバをチェックを入れて、接続した端末に付与するIPアドレスを入力。

Catalyst設定
DHCPスヌーピングを有効化
(config)# ip dhcp snooping
DHCPスヌーピングを有効化するVLANを指定。
(config)# ip dhcp snooping vlan vlan-id
正規のDHCPサーバからDHCPOFFERが送られるポートを以下の設定にする。それ以外のポートは、デフォルトではuntrastになる。その結果、不正なDHCPサーバが接続されたとしても、そのDHCPサーバから送信されるDHCPOFFERをブロックする。
※PCからDHCPサーバーへと送信されるDHCPDISCOVERやDHCPREQUESTは、信頼しないポートであってもブロックの対象とはならないため、PCと接続しているポートも信頼しないポートに設定。
(config)# interface interface gi0/9
(config-if) ip dhcp snooping trust
サーバーを繋ぐI/Fはtrunkモード、端末を繋ぐI/Fにはaccessモードで設定。
Building configuration...
ip dhcp snooping vlan 150
no ip dhcp snooping information option
ip dhcp snooping
!
interface GigabitEthernet0/8
switchport access vlan 150
switchport mode access
!
interface GigabitEthernet0/9
switchport access vlan 150
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 150
switchport mode trunk
ip dhcp snooping trust
!
interface Vlan150
ip address 192.168.0.2 255.255.255.0
!
gi0/9を信頼している条件で、Catalystに接続したPC端末がDHCPによってIPアドレス(192.168.0.5)を取得出来た時のパケットキャプチャ。
gi0/9を信頼しない条件で、再検証するとPCはIPアドレスを取得出来ず、期待した動作になった。

showコマンドで確認
DHCPスヌーピングバインディングテーブルの表示
MacAddress IpAddress Lease(sec) Type VLAN Interface
------------------ --------------- ---------- ------------- ---- --------------------
68:45:F1:17:66:5B 192.168.0.5 604267 dhcp-snooping 150 GigabitEthernet0/8
Total number of binding: 1
DHCPスヌーピング設定情報表示
Switch DHCP snooping is enabled
DHCP snooping is configured on following VLANs:
150
DHCP snooping is operational on following VLANs:
150
DHCP snooping is configured on the following L3 Interfaces:
Insertion of option 82 is disabled
circuit-id default format: vlan-mod-port
remote-id: 34a8.4eda.1680 (MAC)
Option 82 on untrusted port is not allowed
Verification of hwaddr field is enabled
Verification of giaddr field is enabled
DHCP snooping trust/rate is configured on the following Interfaces:
Interface Trusted Allow option Rate limit (pps)
----------------------- ------- ------------ ----------------
GigabitEthernet0/9 yes yes unlimited
Custom circuit-ids:
DHCPスヌーピング統計情報表示
Packets Forwarded = 110
Packets Dropped = 0
Packets Dropped From untrusted ports = 0
IP Sourceguard
上記の構成を利用してIP Sourceguardを検証します。
untrastのgi0/8にソースガードの設定
(config)#interface gi0/8
(config-if-range)#ip verify source
gi0/8に接続した端末からの送信元IPアドレスがバインディングテーブルに掲載されていない場合は通信を破棄する。
interface GigabitEthernet0/8
switchport access vlan 150
switchport mode access
ip verify source
!
interface GigabitEthernet0/9
switchport access vlan 150
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 150
switchport mode trunk
ip dhcp snooping trust
!
interface Vlan150 ip address 192.168.0.2 255.255.255.0
動的IPの設定がされたPCを接続して、IPソースバインディングテーブルの表示。
MacAddress IpAddress Lease(sec) Type VLAN Interface
------------------ --------------- ---------- ------------- ---- --------------------
68:45:F1:17:66:5B 192.168.0.10 604794 dhcp-snooping 150 GigabitEthernet0/8
Total number of bindings: 1
IPソースガードの設定情報とバインディング情報を確認。
Interface Filter-type Filter-mode IP-address Mac-address Vlan
--------- ----------- ----------- --------------- ----------------- ----
Gi0/8 ip active 192.168.0.10 150
上の状態で接続をしたまま、動的IPから静的IP(192.168.0.10)に変更すると、同じセグメントであっても通信が破棄される。
(HTTP/HTTPSの通信は破棄されたが、ICMPは自分が行った検証では破棄されなかった。)
Interface Filter-type Filter-mode IP-address Mac-address Vlan
--------- ----------- ----------- --------------- ----------------- ----
Gi0/3 ip inactive-no-snooping-vlan
Gi0/8 ip active deny-all 150