ip dhcp excluded-address 10.0.0.0 10.0.0.99
ip dhcp excluded-address 10.0.0.200 10.0.0.255
!
ip dhcp pool DHCP-10.0.0.0_24
network 10.0.0.0 255.255.255.0
default-router 10.0.0.1
dns-server 8.8.8.8 8.8.4.4
lease 0 8
!
interface GigabitEthernet0/1
ip address 10.0.0.201 255.255.255.0
no shutdown
!
end
DHCP の割当て状態は show ip dhcp binding で確認出来ます。
123456789
IOSv# show ip dhcp binding
Bindings from all pools not associated with VRF:
IP address Client-ID/ Lease expiration Type
Hardware address/
User name
10.0.0.100 0063.6973.636f.2d66. Sep 03 2017 07:31 PM Automatic
6131.362e.3365.6363.
2e64.6535.342d.4769.
302f.31
[admin@MikroTik] > /ip dhcp-server lease print
Flags: X - disabled, R - radius, D - dynamic, B - blocked
# ADDRESS MAC-ADDRESS HOST-NAME SERVER RATE-LIMIT STATUS
0 D 10.0.0.199 FA:16:3E:CC:DE:54 Router DHCP-S... bound
set system root-authentication encrypted-password "$1$.XUnmGul$NIzsUzi.ytBlGuddwf.Ib0"
set system services dhcp-local-server group DhcpGroup interface em1.0
set interfaces em1 unit 0 family inet address 10.0.0.204/24
set access address-assignment pool DHCP-10_0_0_0_24 family inet network 10.0.0.0/24
set access address-assignment pool DHCP-10_0_0_0_24 family inet range PoolRange low 10.0.0.100
set access address-assignment pool DHCP-10_0_0_0_24 family inet range PoolRange high 10.0.0.199
set access address-assignment pool DHCP-10_0_0_0_24 family inet dhcp-attributes maximum-lease-time 28800
set access address-assignment pool DHCP-10_0_0_0_24 family inet dhcp-attributes name-server 8.8.8.8
set access address-assignment pool DHCP-10_0_0_0_24 family inet dhcp-attributes name-server 8.8.4.4
set access address-assignment pool DHCP-10_0_0_0_24 family inet dhcp-attributes router 10.0.0.204
commit and-quit
Pool は文字、数字、ダッシュ、アンダースコアしか使えないようで、例えば「ピリオド」は使えないようです。 ピリオドを使うと以下のようなエラーになりました。
12
error: name: 'DHCP-10.0.0.0_24': Must be a string beginning with a number or letter and consisting of no more than 63 total letters, numbers, dashes and underscores.
error: statement creation failed: pool
set system services dhcp-local-server が設定されていない場合は以下のエラーになります。
12
root@vmx-01> show dhcp server binding
warning: dhcp-service subsystem not running - not needed by configuration.
config system interface
edit "port2"
set ip 10.0.0.205 255.255.255.0
set allowaccess ping
next
end
config system dhcp server
edit 1
set lease-time 28800
set default-gateway 10.0.0.205
set netmask 255.255.255.0
set interface "port2"
config ip-range
edit 1
set start-ip 10.0.0.100
set end-ip 10.0.0.199
next
end
set timezone-option default
set dns-server2 8.8.4.4
set dns-server1 8.8.8.8
next
end
DHCP の割当て状態は execute dhcp lease-list で確認出来ます。
1234
FortiGate-VM64-KVM # execute dhcp lease-list
port2
IP MAC-Address Hostname VCI Expiry
10.0.0.100 fa:16:3e:17:b4:e7 Router ciscopnp Sun Sep 10 05:54:07 2017
Q. Can a Nexus 7000 be a DHCP server and can it relay DHCP requests to different DHCP servers per VLAN?
A. The Nexus 7000 does not support a DHCP server, but it does support DHCP relay. For relay, use the ip dhcp relay address x.x.x.x interface command.
See Cisco Nexus 7000 Series NX-OS Security Configuration Guide, Release 5.x for more information on Dynamic Host Configuration Protocol (DHCP) on a Cisco NX-OS device.