|
直接上配置:
ip dhcp excluded-address 192.168.1.1 192.168.1.100
ip dhcp excluded-address 192.168.1.200 192.168.1.254
!
ip dhcp pool testpool
network 192.168.1.0 255.255.255.0
dns-server 202.96.134.133
default-router 192.168.1.254
!
ip dhcp pool client_cwnpcn
host 192.168.1.110 255.255.255.0
client-identifier 0100.1dd9.473a.f2 /********IP地址和主機的mac地址綁定,注意01為以太網網類型指示符號,后面的00.1d.d9.47.3a.f2是mac地址, 不同的cisco交換機這里設置的格式可能不同,有的交換機設置形式是0100.3334.3333.0a55,應該用哪個形式,可以先通過show ip dhcp binding來看。
在以上配置中,我們創建了一個192.168.1.0/24的地址池,同時完成了將地址192.168.1.110與 MAC進行了靜態綁定,值得注意的是client_cwnpcn的PC獲取到的網關地址和DNS地址是由地址池pooltest中所定義的。
關于DHCP靜態綁定的思科官方文檔網址:http://www.cisco.com/en/US/docs/ios/12_0t/12_0t1/feature/guide/Easyip2.html#wp23682
為了更清楚的說明問題,下面是個案例,分配了3臺電腦的案例:
switch 2 provision ws-c3750e-48pd
system mtu routing 1500
ip subnet-zero
ip dhcp excluded-address 192.168.1.1 192.168.1.100
ip dhcp excluded-address 192.168.1.200 192.168.1.254
!
ip dhcp pool testpool
network 192.168.1.0 255.255.255.0
dns-server 202.96.134.133
default-router 192.168.1.254
!
ip dhcp pool client_cwnpcn /*PC1
host 192.168.1.112 255.255.255.0
client-identifier 0100.1dd9.473a.f2
!
ip dhcp pool client_cwnpcnpc02 /*PC2
host 192.168.1.114 255.255.255.0
client-identifier 0100.1dd9.473a.f3
!
ip dhcp pool client_cwnpcnpc03 /*PC3
host 192.168.1.118 255.255.255.0
client-identifier 0100.1dd9.473a.f4
!
|
|