实验报告8图1 (4)配置每台计算机的IP地址。
图2 配置PC0的IP地址图3 配置PC1的IP地址图4 配置PC2的IP地址图5 配置PC3的IP地址图6 配置PC4的IP地址(5)配置路由器每个端口的IP地址。
(6)设置路由器中的路由表。
路由表设置要求网络中每个子网之间都可以连通,不考虑总结路由。
【BRANCH1的配置】下面是配置BRANCH1的IP地址的过程,其它两个路由器的配置自行完成(1)进入命令行(2)进行以下操作(蓝色文字是需要输入的命令,红色文字是说明):Continue with configuration dialog? [yes/no]: noPress RETURN to get started!进入控制台模式Router>en进入全局配置模式Router#conf tEnter configuration commands, one per line. End with CNTL/Z.修改路由器名称Router(config)#hostname BRANCH1配置Fa0/0的IP地址BRANCH1(config)#int f0/0BRANCH1(config-if)#ip addr 192.168.9.33 255.255.255.240BRANCH1(config-if)#no shutdown图7 按此方法配置其它两个路由器,此时可以测试各个子网和网关的连通情况。
(3)添加路由表。
这里没有使用路由总结。
BRANCH1#conf tEnter configuration commands, one per line. End with CNTL/Z.BRANCH1(config)#ip route 192.168.9.32 255.255.255.240 f0/0BRANCH1(config)#ip route 192.168.9.48 255.255.255.240 f0/1BRANCH1(config)#ip route 192.168.9.0 255.255.255.224 192.168.9.130BRANCH1(config)#ip route 192.168.9.64 255.255.255.240 192.168.9.130BRANCH1(config)#ip route 192.168.9.80 255.255.255.240 192.168.9.130返回控制台BRANCH1(config)#^Z%SYS-5-CONFIG_I: Configured from console by console查看路由表BRANCH1#show ip route(抓图如下图8)图8【HQ的配置】(1)进入命令行。
(2)进行以下操作(红色文字是说明):Continue with configuration dialog? [yes/no]: nPress RETURN to get started!Router>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#hostname HQ配置IP地址HQ(config)#int f0/1HQ(config-if)#ip addr 192.168.9.1 255.255.255.224HQ(config-if)#no shutdown%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up HQ(config-if)#int s0/0HQ(config-if)#ip addr 192.168.9.130 255.255.255.252HQ(config-if)#no shutdown%LINK-5-CHANGED: Interface Serial0/0, changed state to upHQ(config-if)#clock rate 64000%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to upHQ(config-if)#int s0/1HQ(config-if)#ip addr 192.168.9.134 255.255.255.252HQ(config-if)#no shutdown配置DCE设备的时钟频率。
HQ是HQ和BRANCH2之间的DCE设备。
%LINK-5-CHANGED: Interface Serial0/1, changed state to upHQ(config-if)#clock rate 64000HQ(config-if)#%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1, changed state to upHQ(config-if)#^Z%SYS-5-CONFIG_I: Configured from console by console查看IP地址配置情况HQ#show ip int bri(抓图如下图9)图9 添加路由表。
这里使用了路由总结,路由表从5条减少到3条。
HQ#conf tEnter configuration commands, one per line. End with CNTL/Z.HQ(config)#ip route 192.168.9.0 255.255.255.224 f0/1HQ(config)#ip route 192.168.9.32 255.255.255.224 192.168.9.129HQ(config)#ip route 192.168.9.64 255.255.255.224 192.168.9.133HQ(config)#^Z%SYS-5-CONFIG_I: Configured from console by consoleHQ#show ip route(抓图如下图10)图10【BRANCH2的配置】(1)进入命令行。
(2)进行以下操作(红色文字是说明)Continue with configuration dialog? [yes/no]: nPress RETURN to get started!Router>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#hostname BRANCH2配置每个端口的IP地址BRANCH2(config)#int f0/0BRANCH2(config-if)#ip addr 192.168.9.65 255.255.255.240BRANCH2(config-if)#no shutdown%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up BRANCH2(config-if)#int f0/1BRANCH2(config-if)#ip addr 192.168.9.81 255.255.255.240BRANCH2(config-if)#no shutdown%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up BRANCH2(config-if)#int s0/1BRANCH2(config-if)#ip addr 192.168.9.133 255.255.255.252BRANCH2(config-if)#no shutdown%LINK-5-CHANGED: Interface Serial0/1, changed state to upBRANCH2(config-if)#%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1, changed state to up BRANCH2(config-if)#^Z%SYS-5-CONFIG_I: Configured from console by consoleBRANCH2#show ip int bri (抓图如下图11)图11 添加路由表BRANCH2#conf tEnter configuration commands, one per line. End with CNTL/Z.BRANCH2(config)#ip route 192.168.9.64 255.255.255.240 f0/0BRANCH2(config)#ip route 192.168.9.80 255.255.255.240 f0/1BRANCH2(config)#ip route 192.168.9.0 255.255.255.192 192.168.9.134BRANCH2(config)#^Z%SYS-5-CONFIG_I: Configured from console by consoleBRANCH2#show ip route(抓图如下图12)图12 (7)实验结果。
如下图13.1/2/3/4图13.1 PC1 ping PC2图13.2 PC1 ping PC0图13.3 PC1 ping PC3图13.4 PC1 ping PC4当所有操作都结束后,面板里的各设备间的红点都变成了绿点,如下图14图14。