Chinaunix首页 | 论坛 | 博客
  • 博客访问: 227578
  • 博文数量: 47
  • 博客积分: 776
  • 博客等级: 军士长
  • 技术积分: 514
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-18 12:04
文章分类

全部博文(47)

文章存档

2016年(1)

2015年(18)

2013年(28)

我的朋友

分类: 网络与安全

2013-08-05 15:06:34

在配置静态路由的时候可以配置为下一跳和出接口:

ip route 10.0.0.2 255.255.255.255 Serial0/0
ip route 10.0.0.2 255.255.255.255 10.0.1.6

1、配置为两种方式的时候在路由表中的显示是不同的
S       10.0.0.2/32 [1/0] via 10.0.1.6
                    is directly connected, Serial0/0

2、如果是点到点接口处理方式没什么不同。如果是点到多点接口,下一跳方式要解析到下一跳的封装(发出下一跳的ARP报文);出接口方式需要针对IP包的目标地址发出ARP查询(占用大量的ARP表,ARP表中已知的无需重复查询)。

3、出接口和下一跳之间可以形成等价路由,因此也不存在管理距离是0还是1的问题,只是显示方式不同。

r1# traceroute 10.0.0.2 source 10.0.0.1


Type escape sequence to abort.
Tracing the route to 10.0.0.2


  1 10.0.1.2 28 msec
    10.0.1.6 64 msec * 
r1#



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 0.0.0.0 to network 0.0.0.0


     10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C       10.0.1.0/30 is directly connected, Ethernet1/0
C       10.0.0.1/32 is directly connected, Loopback0
S*   0.0.0.0/0 is directly connected, Ethernet1/0
r1# show arp 
Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  10.0.0.2                0   cc00.0954.0010  ARPA   Ethernet1/0
Internet  10.0.0.3                0   cc00.0954.0010  ARPA   Ethernet1/0
Internet  10.0.1.1                -   cc00.0f10.0010  ARPA   Ethernet1/0
Internet  10.0.0.4                0   Incomplete      ARPA   
r1#



还可以配置静态路由的时候同时指定下一跳和出接口,如果出接口失效,即使下一跳通过路由迭代仍然可达,该路由条目也会失效。同时指定下一跳和出接口的路由条目,在路由表中同时显示下一跳和出接口。


阅读(2321) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~