huangjun6920 发表于 2013-12-20 09:52:05

cisco dhcp为指定计算机分配固定IP,根据mac分配IP,给特定mac地址分配固定ip -

直接上配置:
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


轩少e 发表于 2014-2-13 16:31:14

{:6_267:}{:6_267:}{:6_267:}

vsop5207 发表于 2014-9-16 23:10:57

{:6_264:}{:6_264:}{:6_264:}   有无更简单的方法啊 ?

乐乐201104 发表于 2014-12-11 12:52:02

沙发~支持楼主太棒了,感谢楼主

zzqcomputer 发表于 2015-7-11 01:32:11

好好好
页: [1]
查看完整版本: cisco dhcp为指定计算机分配固定IP,根据mac分配IP,给特定mac地址分配固定ip -