静态路由:R1 ip地址192.168.1.1,R2 ip地址192.168.1.2,R2回环接口2.2.2.2(一台路由器回环接口可以有多个)
R2#conf t
R2(config)#int s0/0
R2(config-if)#ip add 192.168.1.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#int loopback 0
R2(config-if)#ip add 2.2.2.2 255.255.255.0
R2(config-if)#no shut
R1#conf t
R1(config)#int s0/0
R1(config-if)#ip add 192.168.1.1 255.255.255.0
R1(config-if)#no shut
R1#ping 2.2.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
R1#ping 192.168.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 32/70/132 ms
R1(config)#ip route 2.2.2.0 255.255.255.0 s0/0(本路由器的出接口)
或者R1(config)#ip route 2.2.2.0(目的网段地址) 255.255.255.0(目的网段掩码)192.168.1.2(下一跳路由地址)
或者用默认路由R1(config)#ip route 0.0.0.0 0.0.0.0 192.168.1.2
R1(config)#end
R1#ping 2.2.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 56/88/128 ms
常用命令的使用
1、追踪两段中的每一跳
R1#traceroute 2.2.2.2
Type escape sequence to abort.
Tracing the route to 2.2.2.2
1 192.168.1.2 132 msec 96 msec 92 msec
2、显示路由表
R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
2.0.0.0/24 is subnetted, 1 subnets
S 2.2.2.0 [1/0] via 192.168.1.2
C 192.168.1.0/24 is directly connected, Serial0/0
3、接口消息摘要
R2#show ip int br
Interface IP-Address OK? Method Status Protocol
Serial0/0 192.168.1.2 YES manual up up
Serial0/1 unassigned YES unset administratively down down
Serial0/2 unassigned YES unset administratively down down
Serial0/3 unassigned YES unset administratively down down
Loopback0 2.2.2.2 YES manual up up
4、用于搜集毗邻信息
R1#show cdp neighbors detail
-------------------------
Device ID: R2
Entry address(es):
IP address: 192.168.1.2
Platform: Cisco 3640, Capabilities: Router Switch IGMP
Interface: Serial0/0, Port ID (outgoing port): Serial0/0
Holdtime : 171 sec
Version :
Cisco IOS Software, 3600 Software (C3640-JS-M), Version 12.4(10), RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2006 by Cisco Systems, Inc.
Compiled Wed 16-Aug-06 04:04 by prod_rel_team
advertisement version: 2
VTP Management Domain: ''
静态路由默认路由
最新推荐文章于 2023-06-23 01:28:18 发布