dhcp

dhcp_第1张图片

ip dhcp pool 地址池名

ip dhcp pool vlan10
network 192.168.10.0 /24
default-router 192.168.10.254  网关
dns-server 202.103.96.85  定义分配给pc的dns
ip dhcp excluded-address 192.168.10.254 --地址池中排除某地址

pc:
int f0/0
no ip add
ip add dhcp
shutdown
no shutdown

路由器:
int f0/0.10
ip helper-address 192.168.200.1  ---pc的广播包被路由器拦截,此命令是转成单播传给ip为200.1的dhcp服务器

show ip dhcp pool --查看dhcp地址池
show ip dhcp binding  ---查看绑定pc的ip


例:
R1(config)#ip dhcp pool v1
R1(dhcp-config)#network 192.168.10.0 /24
R1(dhcp-config)#default-router 192.168.10.254
R1(dhcp-config)#dns-server 202.96.209.5
R1(config)#int f0/0
R1(config-if)#ip add 192.168.10.254 255.255.255.0   ----dhcp server网关必须和地址池中的地址在一个网段
R1(config-if)#no shut

R2(config)#int f0/0
R2(config-if)#ip add dhcp
R2(config-if)#shutdown
R2(config-if)#no shutdown
R2#show ip int br
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            192.168.10.1    YES DHCP   up                    up


你可能感兴趣的:(网络-思科)