This is a copy paste from my Cisco 2851 router running-configuration file. I have used it to allocate fixed IP addresses to the devices within my network.
If the MAC address of an device has not been manually added to the static-bindings file stored on compact flash then the DHCP server would allocate an IP address from 192.168.0.0/24 range.
ip dhcp pool static-dhcp-chm #friendly name for static IP address pool origin file flash:static-bindings #here we indicate where to look for static mappings default-router 192.168.0.254 # provide this IP address as default gateway domain-name chm.ro dns-server 208.67.222.222 208.67.220.220 # provide these DNS servers to the clients ip dhcp pool dhcp-pool-chm # friendly name for dynamic IP address pool import all network 192.168.0.0 255.255.255.0 default-router 192.168.0.254 domain-name chm.ro dns-server 208.67.222.222 208.67.220.220
The content of static-bindings file stored on compact flash should be as follows:
*time* Jan 21 2005 03:52 PM *version* 2 !IP address Type Hardware address Lease expiration 192.168.0.100 /24 id 0194.ffff.5101.1f Infinite 192.168.0.110 /24 id 01e8.ffff.e257.0f Infinite 192.168.0.150 /24 id 01e0.ffff.8184.cc Infinite 192.168.0.121 /24 1 be34.eb42.7fcb Infinite 192.168.0.10 /24 1 0800.2720.e1af Infinite 192.168.0.15 /24 1 0800.276a.5bfa Infinite 192.168.0.120 /24 1 801f.027c.9eda Infinite *end*
In case the assignment is not working, pay attention to Type field, change it between “id” and “1”