静态路由与默认路由的配置
的有关信息介绍如下:
1、 熟悉路由器的开机界面。
2、 掌握对路由器进行基本的设置。
3、 理解路由器的端口及其编号。
1、 网络拓扑图
1、 实验环境
1) 路由器R1的f0/0端口上接交换机S1,S1接主机PC1、PC2。
2) 路由器R3的f0/0端口上接主机PC3.
3) 路由器R4的f0/0端口上接主机PC4
各设备的IP地址等参数如下所示
1) 路由器R1配置
Router>enable
Router#config ter
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname r1
r1(config)#int s0/0/0
r1(config-if)#ip address 192.168.11.1 255.255.255.0
r1(config-if)#no shut
r1(config-if)#exit
r1(config)#interface f0/0
r1(config-if)#ip address 192.168.10.1 255.255.255.0
r1(config-if)#no shutdown
r1(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
r1(config-if)#exit
r1(config)#ip route 0.0.0.0 0.0.0.0 s0/0/0
r1(config)#exit
r1#
路由器R2配置:
Router#conf ter
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname r2
r2(config)#int s0/0/0
r2(config-if)#ip address 192.168.13.1 255.255.255.0
r2(config-if)#clock rate64000
r2(config-if)#no shut
r2(config)#int s0/0/1
r2(config-if)#ip address 192.168.12.1 255.255.255.0
r2(config-if)#clock rate64000
r2(config-if)#no shut
r2(config-if)#exit
r2(config)#int s0/2/0
r2(config-if)#ip address 192.168.11.2 255.255.255.0
r2(config-if)#clock rate64000
r2(config-if)#no shut
r2(config-if)#
%LINK-5-CHANGED: Interface Serial0/2/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/2/0, changed state to up
r2(config-if)#exit
r2(config)#ip route 192.168.10.0 255.255.255.0 s0/2/0
r2(config)#ip route 192.168.14.0 255.255.255.0 s0/0/1
r2(config)#ip route 192.168.15.0 255.255.255.0 s0/0/0
r2(config)#end
r2#
%SYS-5-CONFIG_I: Configured from console by console
路由器R3配置:
Router>ENABLE
Router#conf ter
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface s0/0/0
Router(config-if)#ip address 192.168.12.2 255.255.255.0
Router(config-if)#no shut
Router(config-if)#
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up
i
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up
Router(config-if)#int f0/0
Router(config-if)#ip address 192.168.14.5 255.255.255.0
Router(config-if)#no shut
Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
%IP-4-DUPADDR: Duplicate address 192.168.14.2 on FastEthernet0/0, sourced by 0060.2F8A.32AC
Router(config-if)#exit
Router#config ter
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#ip route 192.168.10.0 255.255.255.0 s0/0/0
Router(config)#ip route 192.168.15.0 255.255.255.0 s0/0/0
Router(config)#ip route 192.168.13.0 255.255.255.0 s0/0/0
Router(config)#ip route 192.168.11.0 255.255.255.0 s0/0/0
Router(config)#exit
Router#
路由器R4配置:
Router>enable
Router#config ter
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname r4
r4(config)#interface s0/0/0
r4(config-if)#ip address 192.168.13.2 255.255.255.0
r4(config-if)#no shut
r4(config-if)#
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up
r4(config-if)#i
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up
% Ambiguous command: "i"
r4(config-if)#int f0/0
r4(config-if)#ip address 192.168.15.3 255.255.255.0
r4(config-if)#no shut
r4(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
r4(config-if)#end
r4#
r4#config ter
Enter configuration commands, one per line. End with CNTL/Z.
r4(config)#ip route 192.168.10.0 255.255.255.0 s0/0/0
r4(config)#ip route 192.168.11.0 255.255.255.0 s0/0/0
r4(config)#ip route 192.168.12.0 255.255.255.0 s0/0/0
r4(config)#ip route 192.168.14.0 255.255.255.0 s0/0/0
r4(config)#exit
r4#
测试并验证网络



