通过 ip unnumbered 配置命令,您可以在串行接口上启用 IP 处理,而无需为该接口分配明确的 IP 地址。无编号 IP 接口可以“借用”路由器上已配置的另一个接口的 IP 地址。这将节省网络和地址空间。有关 ip unnumbered 命令的详细信息,请参阅“了解和配置 ip unnumbered 命令”。本文描述由一个未编号的串行链路连接的两个开放式最短路径优先(OSPF)路由器。
本文档没有任何特定的要求。
本文档不限于特定的软件和硬件版本。
有关文档规则的详细信息,请参阅 Cisco 技术提示规则。
本部分提供有关如何配置本文档所述功能的信息。
注:要查找有关本文档中使用的命令的其他信息,请使用命令查找工具(仅注册客户)。
本文档使用此图中所示的网络设置:
本文档使用以下配置:
| 路由器 1.1.1.1 |
|---|
Current configuration: hostname r1.1.1.1 interface Loopback0 ip address 1.1.1.1 255.0.0.0 interface Ethernet2/0/0 ip address 4.0.0.1 255.0.0.0 interface Serial2/1/0 ip unnumbered Ethernet2/0/0 router ospf 1 network 4.0.0.0 0.255.255.255 area 0 end |
| 路由器 2.2.2.2 |
|---|
Current configuration: hostname r2.2.2.2 interface Loopback0 ip address 2.2.2.2 255.0.0.0 interface Ethernet0/0/4 ip address 6.0.0.2 255.0.0.0 interface Serial2/1/0 ip unnumbered Ethernet0/0/4 router ospf 2 network 6.0.0.0 0.255.255.255 area 0 end |
本部分提供信息以确认配置工作正常。
命令输出解释程序工具(仅限注册用户)支持某些 show 命令。 通过此工具可查看对 show 命令输出的分析。
show ip ospf database — 显示在链路状态数据库中的Link State Advertisement (LSA)列表。此列表仅显示 LSA 报头中的信息。
show ip ospf database [router] [link-state-id] -显示数据库中路由器LSA (类型1 LSA)的内容。路由器LSA是由每个路由器生成的。这些基本LSA列出所有路由器链路或者接口,以及链路的状态和流出开销。他们应只在产生的区内被泛洪。
要查看OSPF数据库的情况,在当前网络环境中,请查看show ip ospf database命令的输出。
r2.2.2.2#show ip ospf database
OSPF Router with ID (2.2.2.2) (Process ID 2)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 254 0x8000001A 0xA6FA 2
2.2.2.2 2.2.2.2 253 0x80000017 0x4858 2
r2.2.2.2#show ip ospf database router 1.1.1.1
OSPF Router with ID (2.2.2.2) (Process ID 2)
Router Link States (Area 0)
LS age: 279
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 1.1.1.1
!--- For router links, Link State Id is always the same as the !--- Advertising Router (next line).
Advertising Router: 1.1.1.1
!--- This is the router ID of the router which created !--- this LSA.
LS Seq Number: 8000001A
Checksum: 0xA6FA
Length: 48
Number of Links: 2
Link connected to: another Router (point-to-point)
!--- This line shows that this router (1.1.1.1) is a neighbor !--- with 2.2.2.2.
(Link ID) Neighboring Router ID: 2.2.2.2
(Link Data) Router Interface address: 0.0.0.12
!--- In the case of unnumbered link, use the MIB II IfIndex !--- value. This value usually starts with 0.
Number of TOS metrics: 0
TOS 0 Metrics: 64
!--- This is the OSPF cost of the link that connects !--- the two routers.
Link connected to: a Stub Network
!--- This entry represents the Ethernet segment 4.0.0.0/8.
(Link ID) Network/subnet number: 4.0.0.0
(Link Data) Network Mask: 255.0.0.0
Number of TOS metrics: 0
TOS 0 Metrics: 10
!--- This is the OSPF cost of the Ethernet segment.
r2.2.2.2#show ip ospf database router 2.2.2.2
OSPF Router with ID (2.2.2.2) (Process ID 2)
Router Link States (Area 0)
LS age: 295
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 2.2.2.2
Advertising Router: 2.2.2.2
LS Seq Number: 80000017
Checksum: 0x4858
Length: 48
Number of Links: 2
Link connected to: another Router (point-to-point)
(Link ID) Neighboring Router ID: 1.1.1.1
(Link Data) Router Interface address: 0.0.0.10
Number of TOS metrics: 0
TOS 0 Metrics: 64
Link connected to: a Stub Network
(Link ID) Network/subnet number: 6.0.0.0
(Link Data) Network Mask: 255.0.0.0
Number of TOS metrics: 0
TOS 0 Metrics: 10
此部分从Router2.2.2.2的角度计算最短路径树。
Router2.2.2.2在其自己的LSA中查找,发现Router1.1.1.1是邻居。然后查它看路由器1.1.1.1的 LSA,以验证1.1.1.1把2.2.2.2看作邻居。如果这两个路由器彼此视为邻居,则我们认为它们是可访问的。然后路由器安装他们邻居的LSA中列出的所有末端网络的路由。
在本例中,Router2.2.2.2安装4.0.0.0/8的一个路由在其路由表里,是因为Router1.1.1.1列出4.0.0.0/8作为在其LSA的一个末端网络。这可以通过show ip route ospf命令来实现。
r2.2.2.2#show ip route ospf O 4.0.0.0/8 [110/74] via 4.0.0.1, 00:06:01, Serial0/1/0 r1.1.1.1#show ip route ospf O 6.0.0.0/8 [110/74] via 6.0.0.2, 00:06:16, Serial2/1/0
目前没有针对此配置的故障排除信息。
| 版本 | 发布日期 | 备注 |
|---|---|---|
1.0 |
19-May-2005
|
初始版本 |