Router(config)#conf t
%Invalid hex value
Router(config)#interface fastethernet 0/0
Router(config-if)#ip address 192.168.1.1 255.255.255.0
Router(config-if)#no sh
Router(config-if)#no shutdown
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface fastethernet 0/1
Router(config-if)#ip address 192.168.2.1 255.255.255.0
Router(config-if)#no shut
Router(config-if)#no shutdown
设置DHCP服务器
1.0网段的自动分配
Router(config)#server dhcp //开启服务、默认是开启的。
Router(config)#ip dhcp conflict logging //禁掉重叠日志产生、
Router(config)#ip dhcp pool global //配置一个根地址池,global是地址池名称、可以任意取。
Router(dhcp-config)#network 192.168.1.0 255.255.255.0 //动态分配的地址段
Router(dhcp-config)#dns-
Router(dhcp-config)#dns-server 192.168.1.1 //为客户端配置DNS服务器
Router(dhcp-config)#de
Router(dhcp-config)#default-router 192.168.1.1 //配置网关
Router(dhcp-config)#end
Router#sh ip int brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 192.168.1.1 YES manual up up
FastEthernet0/1 192.168.2.1 YES manual up up
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#ip dhcp excluded-address 192.168.1.1 192.168.1.10 //从1到10在自动分配地址池里边已排除掉、
Router(config)#
2.0网段
Router(config)#ip dhcp pool test1
Router(dhcp-config)#netw
Router(dhcp-config)#network 192.168.2.0 255.255.255.0
Router(dhcp-config)#dns-
Router(dhcp-config)#dns-server 192.168.1.1
Router(dhcp-config)#de
Router(dhcp-config)#default-router 192.168.2.1
Router(dhcp-config)#end
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#ip
Router(config)#ip dhcp e
Router(config)#ip dhcp excluded-address 192.168.2.1 //ip地址192.168.2.1为固定地址以被路由器占用、不能再用于自动分配。
Router(config)#
转载于:https://blog.51cto.com/ydministrator/419060