|
|
直接上配置:
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地址和主機(jī)的mac地址綁定,注意01為以太網(wǎng)網(wǎng)類型指示符號(hào),后面的00.1d.d9.47.3a.f2是mac地址, 不同的cisco交換機(jī)這里設(shè)置的格式可能不同,有的交換機(jī)設(shè)置形式是0100.3334.3333.0a55,應(yīng)該用哪個(gè)形式,可以先通過(guò)show ip dhcp binding來(lái)看。
在以上配置中,我們創(chuàng)建了一個(gè)192.168.1.0/24的地址池,同時(shí)完成了將地址192.168.1.110與 MAC進(jìn)行了靜態(tài)綁定,值得注意的是client_cwnpcn的PC獲取到的網(wǎng)關(guān)地址和DNS地址是由地址池pooltest中所定義的。
關(guān)于DHCP靜態(tài)綁定的思科官方文檔網(wǎng)址:http://www.cisco.com/en/US/docs/ios/12_0t/12_0t1/feature/guide/Easyip2.html#wp23682
為了更清楚的說(shuō)明問(wèn)題,下面是個(gè)案例,分配了3臺(tái)電腦的案例:
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
!
|
|