当前位置: 首页 >  资讯 > 正文

静态路由配置命令_静态路由配置

2023-05-08 16:08:34 来源:互联网

1、配置计算机PC1:

2、IP: 192.168.1.2


【资料图】

3、Submask: 255.255.255.0

4、Gateway: 192.168.1.1

5、配置计算机PC2:

6、IP:192.168.2.2

7、Submask:255.255.255.0

8、Gateway:192.168.2.1

9、测试连通性PC1 ping PC2

10、Ping 192.168.2.2

11、配置路由器R1。

12、Routeren

13、Router#conf t

14、Router(config)#hostname R1

15、R1(config)#int fa1/0

16、R1(config-if)#no shut

17、R1(config-if)#

18、R1(config-if)#ip address 192.168.1.1 255.255.255.0

19、R1(config-if)#exit

20、R1(config)#int s2/0

21、R1(config-if)#ip address 192.168.3.1 255.255.255.0

22、R1(config-if)#clock rate 64000

23、R1(config-if)#no shut

24、R1(config-if)#end

25、R1#

26、时钟速率64000(必须为通信配置时钟)

27、配置路由器R2。

28、R2en

29、R2#conf t

30、R2(config)#hostname R2

31、R2(config)#int fa1/0

32、R2(config-if)#ip address 192.168.2.1 255.255.255.0

33、R2(config-if)#no shut

34、R2(config-if)#

35、R2(config-if)#exit

36、R2(config)#int s2/0

37、R2(config-if)#ip address 192.168.3.2 255.255.255.0

38、R2(config-if)#no shut

39、R2(config-if)#

40、R2(config-if)#clock rate 64000

41、This command applies only to DCE interfaces

42、R2(config-if)#

43、R2(config-if)#end

44、R2#

45、配置R1路由:

46、R1en

47、R1#conf t

48、R1(config)#ip route 192.168.2.0 255.255.255.0 192.168.3.2

49、R1(config)#end

50、R1#

51、R1#show ip route

52、Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

53、D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

54、N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

55、E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

56、i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

57、* - candidate default, U - per-user static route, o - ODR

58、P - periodic downloaded static route

59、Gateway of last resort is not set

60、C 192.168.1.0/24 is directly connected, FastEthernet1/0

61、S 192.168.2.0/24 [1/0] via 192.168.3.2

62、C 192.168.3.0/24 is directly connected, Serial2/0

63、R1#

64、配置路由R2

65、R2en

66、R2#conf t

67、Enter configuration commands, one per line. End with CNTL/Z.

68、R2(config)#ip route 192.168.1.0 255.255.255.0 192.168.3.1

69、R2(config)#end

70、R2#

71、R2#show ip route

72、Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

73、 D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

74、 N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

75、 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

76、 i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

77、 * - candidate default, U - per-user static route, o - ODR

78、 P - periodic downloaded static route

79、Gateway of last resort is not set

80、S 192.168.1.0/24 [1/0] via 192.168.3.1

81、C 192.168.2.0/24 is directly connected, FastEthernet1/0

82、C 192.168.3.0/24 is directly connected, Serial2/0

83、测试连通性:PC1Ping PC2

84、Ping 192.168.2.2

以上就是静态路由配置这篇文章的一些介绍,希望对大家有所帮助。

标签:

<  上一篇

智绘天津丨共话智能创造未来 主题征集活动火爆进行中_环球聚看点

下一篇 >

最后一页