今天下午没课,自己做了一个实验项目。
1.连接DHCP拓扑图:
2.设置服务器Server0的配置及DHCPP中继配置,如下:服务器本机IP :192.168.2.1;子网掩码:255.255.255.0;网关:192.168.2.254;域名解析服务:192.168.2.1。
3.配置DHCP服务器。开启DHCP服务,设置serverPool,默认网关:192.168.2.254;DNS:192.168.2.1;起始IP:192.168.2.10;最大分配用户100,点击save保存。
添加一个serverPool-1,默认网关:192.168.1.254;DNS:192.168.1.1;起始IP:192.168.1.10;最大分配用户100,点击add添加新地址池。
4.配置路由器信息,根据拓扑图路由器Router0连接带192.168.1.0网段。
(1)点击路由器,进入physical,关闭路由器电源,点击HWIC-2T给路由器添加一块HWIC-2T模块,接通路由器电源。如图:
(2)Router1配置如下:
--- System Configuration Dialog ---
Continue with configuration dialog? [yes ]: no
Press RETURN to get started!
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int f0/0 //配置端口
Router(config-if)#ip add 192.168.2.254 255.255.255.0 //设置端口IP
Router(config-if)#no shut //开启端口
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Router(config-if)#int se0/1/0 //配置串行口
Router(config-if)#ip add 10.1.1.2 255.255.255.0 //设置端口IP
Router(config-if)#no shut //开启端口
%LINK-5-CHANGED: Interface Serial0/1/0, changed state to down
Router(config-if)#exit //退出当前配置
Router(config)#ip route 192.168.1.0 255.255.255.0 10.1.1.1 //192.168.1.0网段的数据包交给10.1.1.1端口处理。或者是说要找192.168.1.0网段去10.1.1.1端口找。
(3)Router0配置如下:
--- System Configuration Dialog ---
Continue with configuration dialog? [yes ]: no
Press RETURN to get started!
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int f0/0 //配置端口
Router(config-if)#ip add 192.168.1.254 255.255.255.0 //设置端口IP
Router(config-if)#ip helper-address 192.168.2.1 //把端口fa0/0的DHCP服务申请交给192.168.2.1服务器处理。
Router(config-if)#no shut //开启端口
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Router(config)#int se0/1/0 // 配置串行口
Router(config-if)#ip add 10.1.1.1 255.255.255.0 //设置端口IP
Router(config-if)#no shut //开启端口
%LINK-5-CHANGED: Interface Serial0/1/0, changed state to up
Router(config-if)#exit
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1/0, changed state to up
Router(config)#ip route 192.168.2.0 255.255.255.0 10.1.1.2 //192.168.2.0网段的数据包交给10.1.1.2端口处理。或者是说要找192.168.2.0网段去10.1.1.2端口找。
5.测试PC自动获取IP。
在拓扑图的基础上要再加一个192.168.3.0网段如下图应该怎么设置呢?
1.之前的配置不变。在服务器DHCP服务中再添加一个新的地址池,如下图:
2.配置路由器信息。
(1)Router1配置如下:
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#ip route 192.168.3.0 255.255.255.0 10.1.1.1 //192.168.3.0网段的数据包交给10.1.1.1端口处理。或者是说要找192.168.3.0网段去10.1.1.1端口找。
Router(config)#
(2)Router0配置如下:
Router(config)#
Router(config)#int f0/1 //设置端口
Router(config-if)#ip add 192.168.3.254 255.255.255.0 //设置端口IP
Router(config-if)#ip helper-address 192.168.2.1 //把端口fa0/1的DHCP服务申请交给192.168.2.1服务器处理。
Router(config-if)#no shut // 开启端口
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
Router(config-if)#
3.测试PC 自动获取IP。
其他的连接方式跟以上类似。