Hi,大家好,愚人节快乐,今天我给大家带来的是“Cisco静态路由+默认路由实现全网互通”
一、实验拓补
二、实验环境
三个Cisco路由器(R1,R2,R3), 每台路由器启用Loopback虚拟接口用于扮演PC机
三、实验目的
实现全网互通,每台路由器都能ping通所有接口(包括虚拟接口)
四、配置步骤
R1上配置
R1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#interface serial 1/0
R1(config-if)#clock rate 64000
R1(config-if)#ip address 1.1.1.1 255.255.255.0
R1(config-if)#no shutdown
*Mar 1 00:02:23.743: %LINK-3-UPDOWN: Interface Serial1/0, changed state to up
*Mar 1 00:02:24.747: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial
R1(config-if)#exit
R1(config)#interface loopback 0
*Mar 1 00:03:35.187: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
R1(config-if)#ip address 10.10.10.10 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R2上配置
R2#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#interface serial 1/0
R2(config-if)#ip address 1.1.1.254 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
*Mar 1 00:03:36.279: %LINK-3-UPDOWN: Interface Serial1/0, changed state to up
*Mar 1 00:03:37.283: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0, changed state to up
R2(config)#interface serial 1/1
R2(config-if)#clock rate 64000
R2(config-if)#ip address 2.2.2.1 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
*Mar 1 00:05:43.735: %LINK-3-UPDOWN: Interface Serial1/1, changed state to up
*Mar 1 00:05:44.739: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/1, changed state to up
R2(config)#interface loopback 0
*Mar 1 00:07:18.683: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
R2(config-if)#ip address 20.20.20.20 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R3上配置
R3#configure terminal
R3(config)#interface serial 1/0
R3(config-if)#ip address 2.2.2.254 255.255.255.0
R3(config-if)#no shutdown
*Mar 1 00:06:26.323: %LINK-3-UPDOWN: Interface Serial1/0, changed state to up
*Mar 1 00:06:27.327: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0, changed state to up
R3(config-if)#exit
R3(config)#interface loopback 0
*Mar 1 00:07:12.331: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
R3(config-if)#ip address 30.30.30.30 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exit
配置路由条目
R1(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.254
R2(config)#ip route 10.10.10.0 255.255.255.0 1.1.1.1
R2(config)#ip route 30.30.30.0 255.255.255.0 2.2.2.254
R3(config)#ip route 0.0.0.0 0.0.0.0 2.2.2.1
各个节点测试连通性
R1测试
R1#ping 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/30/80 ms
R1#
R1#ping 1.1.1.254
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/10/12 ms
R1#
R1#ping 10.10.10.10
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.10, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
R1#
R1#ping 2.2.2.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/10/16 ms
R1#
R1#ping 20.20.20.20
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 20.20.20.20, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/14/32 ms
R1#
R1#ping 2.2.2.254
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/28/36 ms
R2测试
R2#ping 1.1.1.254
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 32/40/44 ms
R2#
R2#ping 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/9/20 ms
R2#
R2#ping 10.10.10.10
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.10, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/10/12 ms
R2#
R2#ping 2.2.2.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 36/40/44 ms
R2#
R2#ping 2.2.2.254
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/18/20 ms
R2#
R2#ping 30.30.30.30
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 30.30.30.30, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/10/12 ms
R2#
R2#ping 20.20.20.20
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 20.20.20.20, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
R3测试
R3#ping 30.30.30.30
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 30.30.30.30, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
R3#
R3#ping 2.2.2.254
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/21/32 ms
R3#
R3#ping 2.2.2.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/11/16 ms
R3#
R3#ping 20.20.20.20
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 20.20.20.20, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/11/20 ms
R3#
R3#ping 1.1.1.254
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/12/20 ms
R3#
R3#ping 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/20/24 ms
R3#
R3#ping 10.10.10.10
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.10, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/20/28 ms
五、实验结果
从上述步骤可以看出,已实现全网互通功能