我在实验室环境中的 Juniper Netscreen SSG5 的“Untrust”区域和 Cisco 路由器之间设置 OSPF 时遇到问题。在 Netscreen 设备的接口置于“信任”区域之前,状态不会转换超过 EXSTART。以下配置与清除两台设备上的所有配置后输入的完全相同。
GNS3 使用 IOS 12.4(23) 模拟 Cisco 3640
configure terminal
interface fastethernet0/0
ip address 172.16.1.1 255.255.255.252
no shutdown
router ospf 1
network 172.16.1.1 0.0.0.0 area 1
default-info originate always
带有 ScreenOS 6.2.0r5.0 的瞻博网络 SSG5
set interface ethernet0/0 ip 172.16.1.2 255.255.255.252
set vrouter trust-vr protocol ospf
set vrouter trust-vr protocol ospf enable
set vrouter trust-vr protocol ospf area 1
set interface ethernet0/0 protocol ospf area 1
set interface ethernet0/0 protocol ospf enable
输入这些命令后,在 Netscreen 上发出此命令
get vrouter trust-vr protocol ospf neighbor
结果是
Neighbor(s) on interface ethernet0/0 (Area 0.0.0.1)
IpAddr/IfIndex RouterId Pri State Opt Up StateChg
------------------------------------------------------------------------------
172.16.1.1 172.16.1.1 1 ExStart E 00:01:26 (+4 -0)
在思科
show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
172.16.1.2 1 EXCHANGE/BDR 00:00:38 172.16.1.2 FastEthernet0/0
只要我在 Netscreen 上输入以下命令,状态就会转换为 FULL
set interface ethernet0/0 zone Trust
这是 Cisco 上的调试输出
debug ip ospf adj
*Mar 1 00:02:18.971: OSPF: 2 Way Communication to 172.16.1.2 on FastEthernet0/0, state 2WAY
*Mar 1 00:02:18.971: OSPF: Backup seen Event before WAIT timer on FastEthernet0/0
*Mar 1 00:02:18.971: OSPF: DR/BDR election on FastEthernet0/0
*Mar 1 00:02:18.971: OSPF: Elect BDR 172.16.1.1
*Mar 1 00:02:18.971: OSPF: Elect DR 172.16.1.2
*Mar 1 00:02:18.971: OSPF: Elect BDR 172.16.1.1
*Mar 1 00:02:18.971: OSPF: Elect DR 172.16.1.2
DR: 172.16.1.2 (Id) BDR: 172.16.1.1 (Id)
*Mar 1 00:02:18.971: OSPF: Send DBD to 172.16.1.2 on FastEthernet0/0 seq 0x2212 opt 0x52 flag 0x7 len 32
*Mar 1 00:02:23.971: OSPF: Send DBD to 172.16.1.2 on FastEthernet0/0 seq 0x2212 opt 0x52 flag 0x7 len 32
*Mar 1 00:02:23.971: OSPF: Retransmitting DBD to 172.16.1.2 on FastEthernet0/0 [1]
*Mar 1 00:02:24.003: OSPF: Rcv DBD from 172.16.1.2 on FastEthernet0/0 seq 0x436 opt 0x2 flag 0x7 len 32 mtu 1500 state EXSTART
*Mar 1 00:02:24.003: OSPF: NBR Negotiation Done. We are the SLAVE
*Mar 1 00:02:24.003: OSPF: Send DBD to 172.16.1.2 on FastEthernet0/0 seq 0x436 opt 0x52 flag 0x2 len 72
*Mar 1 00:02:24.003: OSPF: Rcv DBD from 172.16.1.2 on FastEthernet0/0 seq 0x436 opt 0x2 flag 0x7 len 32 mtu 1500 state EXCHANGE
(last two lines repeat indefinitely)
我不认为这是 MTU 不匹配,两个设备都设置为 1500。而且,就像我说的,一旦将 Netscreen 界面置于“信任”区域,它就可以工作。
在 Netscreen 上输入以下内容似乎没有任何改变。
set policy default-permit-all
unset policy 1
当 Netscreen 接口处于“不信任”区域时,Wireshark 捕获显示从 Netscreen 到 Cisco 的大量 ICMP TTL 超过数据包。
值得一提的是,iBGP 在“不信任”区域中工作。