欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

路由协议实验:静态路由和默认路由的配置

程序员文章站 2022-03-01 15:51:08
...

路由协议实验:静态路由和默认路由的配置

1、实验拓扑结构

路由协议实验:静态路由和默认路由的配置

2、实验目的

掌握静态路由和默认路由的配置

3、静态路由的配置

1.配置R1A的F0/0接口的IP并启用接口
路由协议实验:静态路由和默认路由的配置
2.配置R1A两个回环口的IP

Router(config)#int l0

Router(config-if)#
%LINK-5-CHANGED: Interface Loopback0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up

Router(config-if)#ip address 192.168.3.1 255.255.255.0
Router(config-if)#exit
	
Router(config)#int l1

Router(config-if)#
%LINK-5-CHANGED: Interface Loopback1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1, changed state to up

Router(config-if)#ip add 192.168.4.1 255.255.255.0
Router(config-if)#exit

3、配置R1B的F0/0和F0/1接口并启用接口
路由协议实验:静态路由和默认路由的配置
路由协议实验:静态路由和默认路由的配置

4.配置R1C的F0/1接口和两个回环口
路由协议实验:静态路由和默认路由的配置

Router(config)#int l0

Router(config-if)#
%LINK-5-CHANGED: Interface Loopback0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up

Router(config-if)#ip add 88.88.88.88 255.255.255.0
Router(config-if)#exit
Router(config)#int l1

Router(config-if)#
%LINK-5-CHANGED: Interface Loopback1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1, changed state to up

Router(config-if)#ip add 22.22.22.22 255.255.255.0
Router(config-if)#exit

5.R1A配置静态路由

Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#ip route 10.1.1.0 255.255.255.0 192.168.1.2
Router(config)#ip route 88.88.88.0 255.255.255.0 192.168.1.2
Router(config)#ip route 22.22.22.0 255.255.255.0 192.168.1.2
Router(config)#

6.R1B配置静态路由

Router(config)#ip route 192.168.3.0 255.255.255.0 192.168.1.1
Router(config)#ip route 192.168.4.0 255.255.255.0 192.168.1.1
Router(config)#ip route 88.88.88.0 255.255.255.0 10.1.1.3
Router(config)#ip route 22.22.22.0 255.255.255.0 10.1.1.3

7、R1C配置静态路由

Router(config)#ip route 192.168.1.0 255.255.255.0 10.1.1.2
Router(config)#ip route 192.168.3.0 255.255.255.0 10.1.1.2
Router(config)#ip route 192.168.4.0 255.255.255.0 10.1.1.2

8、测试R1A ping 88.88.88.88 和22.22.22.22,能ping通

Router#ping 88.88.88.88

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 88.88.88.88, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/1 ms

Router#ping 22.22.22.22

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 22.22.22.22, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/1 ms

9、测试R1C ping 192.168.3.1,能ping通

Router#ping 192.168.3.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.3.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/1/3 ms

4、默认路由的配置

1、接上面已经配置好的静态路由
2、删除R1B通向88.88.88.0和22.22.22.0网段的静态路由

Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#no ip route 88.88.88.0 255.255.255.0 10.1.1.3
Router(config)#no ip route 22.22.22.0 255.255.255.0 10.1.1.3

3、删除R1C通向192.168.1.0网段的静态路由

Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#no ip route 192.168.1.0 255.255.255.0 10.1.1.2

4、配置R1B通向R1C的默认路由

Router(config)#ip route 0.0.0.0 0.0.0.0 10.1.1.3

5、配置R1C通向R1B的默认路由

Router(config)#ip route 0.0.0.0 0.0.0.0 10.1.1.2

6、测试R1A ping 88.88.88.88,能 ping 通

Router#ping 88.88.88.88

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 88.88.88.88, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/0 ms

7、测试R1C ping 192.168.3.1,能 ping 通

Router#ping 192.168.3.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.3.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/1 ms

赠人玫瑰,手留余香,如果这篇文章对你有帮助的话,请随手点个赞再走吧(づ ̄3 ̄)づ╭❤~