OSPF Network Types
接口有默认网络类型。
1,Loopback,
默认网络类型为Loopback,特点,不管配置为多少位的掩码,都为32位。
2,Point-to-Point
Serial/BRI FR's P2Psub-if 通过组播更新,没有DR
3,Broadcast
Ethernet 组播更新,有DR。
4,NBMA
FR's Physical FR's MPsub-if 单播,有DR
5,P2MP --------------
6,P2MP NBMA -------------
试验
查看接口信息
loopback默认网络类型为 LOOPBACK
串口默认网络类型为POINT_TO_POINT
R1#show ip ospf interface
Loopback0 is up, line protocol is up
Internet Address 1.1.1.1/24, Area 0, Attached via Network Statement
Process ID 110, Router ID 1.1.1.1, Network Type LOOPBACK, Cost: 1
Topology-MTID Cost Disabled Shutdown Topology Name
0 1 no no Base
Loopback interface is treated as a stub Host
Serial2/0 is up, line protocol is up
Internet Address 12.1.1.1/24, Area 0, Attached via Network Statement
Process ID 110, Router ID 1.1.1.1, Network Type POINT_TO_POINT, Cost: 64
Topology-MTID Cost Disabled Shutdown Topology Name
0 64 no no Base
Transmit Delay is 1 sec, State POINT_TO_POINT
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:09
Supports Link-local Signaling (LLS)
Cisco NSF helper support enabled
IETF NSF helper support enabled
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 1, Adjacent neighbor count is 1
Adjacent with neighbor 2.2.2.2
Suppress hello for 0 neighbor(s)
在串口上选择DR
将串口的ospf网络类型必为broadcast类型
R1#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
2.2.2.2 1 FULL/DR 00:00:35 12.1.1.2 Serial2/0
NBMA
R1(config-if)#ip ospf network non-broadcast
R2(config-if)#ip ospf network non-broadcast
OSPF状态为WAITING。不组播更新。
R1#show ip ospf interface
Loopback0 is up, line protocol is up
Internet Address 1.1.1.1/24, Area 0, Attached via Network Statement
Process ID 110, Router ID 1.1.1.1, Network Type LOOPBACK, Cost: 1
Topology-MTID Cost Disabled Shutdown Topology Name
0 1 no no Base
Loopback interface is treated as a stub Host
Serial2/0 is up, line protocol is up
Internet Address 12.1.1.1/24, Area 0, Attached via Network Statement
Process ID 110, Router ID 1.1.1.1, Network Type NON_BROADCAST, Cost: 64
Topology-MTID Cost Disabled Shutdown Topology Name
0 64 no no Base
Transmit Delay is 1 sec, State WAITING, Priority 1
No designated router on this network
No backup designated router on this network
Timer intervals configured, Hello 30, Dead 120, Wait 120, Retransmit 5
oob-resync timeout 120
Hello due in 00:00:05
Wait time before Designated router selection 00:01:08
Supports Link-local Signaling (LLS)
Cisco NSF helper support enabled
IETF NSF helper support enabled
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 0, Adjacent neighbor count is 0
Suppress hello for 0 neighbor(s)
需要指定邻居
R1(config)#router ospf 110
R1(config-righbor 12.1.1.2outer)#ne
单边做就可以。
有DR
R1#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
2.2.2.2 1 FULL/DR 00:01:50 12.1.1.2 Serial2/0
P2MA
组播更新,不先DR,
R1(config-if)#ip ospf network point-to-multipoint
R2(config-if)#ip ospf network point-to-multipoint
R1#show ip ospf interface s2/0
Serial2/0 is up, line protocol is up
Internet Address 12.1.1.1/24, Area 0, Attached via Network Statement
Process ID 110, Router ID 1.1.1.1, Network Type POINT_TO_MULTIPOINT, Cost: 64
Topology-MTID Cost Disabled Shutdown Topology Name
0 64 no no Base
Transmit Delay is 1 sec, State POINT_TO_MULTIPOINT
Timer intervals configured, Hello 30, Dead 120, Wait 120, Retransmit 5
oob-resync timeout 120
Hello due in 00:00:25
Supports Link-local Signaling (LLS)
Cisco NSF helper support enabled
IETF NSF helper support enabled
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 1, Adjacent neighbor count is 1
Adjacent with neighbor 2.2.2.2
Suppress hello for 0 neighbor(s)
点到多点会产生一条到达对方直连接口32位主机路由
R2#show ip route ospf
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/65] via 12.1.1.1, 00:03:16, Serial2/1
12.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
O 12.1.1.1/32 [110/64] via 12.1.1.1, 00:03:16, Serial2/1
点到多点非广播
R1(config-if)#ip ospf network point-to-multipoint non-broadcast
R2(config-if)#ip ospf network point-to-multipoint non-broadcast
指定邻居:
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#router ospf 110
R1(config-router)#neighbor 12.1.1.2
有一条32位主机路由
R1#show ip route ospf
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/65] via 12.1.1.2, 00:14:59, Serial2/0
12.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
O 12.1.1.2/32 [110/64] via 12.1.1.2, 00:14:59, Serial2/0
R1 P2MP R2 P2P 修改Hello时间
R1(config-if)#ip osp network point-to-multipoint
R2(config-if)#ip ospf network point-to-point
邻居关系不能建立,修改hello时间,
R2(config-if)#ip ospf hello-interval 30
邻居成功建立
R1#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
2.2.2.2 0 FULL/ - 00:00:36 12.1.1.2 Serial2/0
Frame-Relay 特点;
1、二层网络技术
2、DLCI(本地意义)
3、PVC
4、有连接(面向连接)
5、LMI(Cisco/ANSI/q933a),主动发送信息,探测远程是否正常工作。
三种状态
Local Remote
Active OK OK
Inactive OK NO
Delete NO ?
6、MAP
自动(Dynamic)
手动(Static)
ARP IARP
Ethernet FR
IP对 IP对
MAC对 DLCI 本
模拟FR交换机
R2上的配置
104 401 PVC
S2/0配置
!
interface Serial2/0
no ip address
encapsulation frame-relay
serial restart-delay 0
frame-relay lmi-type cisco
frame-relay intf-type dce
frame-relay route 104 interface Serial2/1 401
!
S2/1配置
interface Serial2/1
no ip address
encapsulation frame-relay
serial restart-delay 0
frame-relay lmi-type ansi
frame-relay intf-type dce
frame-relay route 401 interface Serial2/0 104
105 501 PVC借助Tunnel
最终的Spoke
有两个PVC,104和105 但未使用 ,配置上IP就会到Local上。
R1#show frame-relay pvc
PVC Statistics for interface Serial2/0 (Frame Relay DTE)
Active Inactive Deleted Static
Local 0 0 0 0
Switched 0 0 0 0
Unused 2 0 0 0
DLCI = 104, DLCI USAGE = UNUSED, PVC STATUS = ACTIVE, INTERFACE = Serial2/0
input pkts 0 output pkts 0 in bytes 0
out bytes 0 dropped pkts 0 in pkts dropped 0
out pkts dropped 0 out bytes dropped 0
in FECN pkts 0 in BECN pkts 0 out FECN pkts 0
out BECN pkts 0 in DE pkts 0 out DE pkts 0
out bcast pkts 0 out bcast bytes 0
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
pvc create time 00:17:00, last time pvc status changed 00:17:00
DLCI = 105, DLCI USAGE = UNUSED, PVC STATUS = ACTIVE, INTERFACE = Serial2/0
input pkts 0 output pkts 0 in bytes 0
out bytes 0 dropped pkts 0 in pkts dropped 0
out pkts dropped 0 out bytes dropped 0
in FECN pkts 0 in BECN pkts 0 out FECN pkts 0
out BECN pkts 0 in DE pkts 0 out DE pkts 0
out bcast pkts 0 out bcast bytes 0
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
pvc create time 00:01:10, last time pvc status changed 00:01:10
iarp 正常工作
R1#ping 145.1.1.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 145.1.1.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 17/17/18 ms
R1#ping 145.1.1.5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 145.1.1.5, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 18/18/19 ms
学习到的map信息
broadcasst,伪广播(向每条map发送单播),支持某些路由协议发送广播或组播。
R1#show frame-relay map
Serial2/0 (up): ip 145.1.1.4 dlci 104(0x68,0x1880), dynamic,
broadcast,, status defined, active
Serial2/0 (up): ip 145.1.1.5 dlci 105(0x69,0x1890), dynamic,
broadcast,
CISCO, status defined, active
虽然在同一个网段,但就是ping不通,需要手工增加map
R4#show frame-relay map
Serial2/1 (up): ip 145.1.1.1 dlci 401(0x191,0x6410), dynamic,
broadcast,
CISCO, status defined, active
R4#ping 145.1.1.5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 145.1.1.5, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
手工配置map
R4(config-if)#frame-relay map ip 145.1.1.5 401 broadcast
类型为static
R4#show frame-relay map
Serial2/1 (up): ip 145.1.1.5 dlci 401(0x191,0x6410), static,
broadcast,
CISCO, status defined, active
Serial2/1 (up): ip 145.1.1.1 dlci 401(0x191,0x6410), dynamic,
broadcast,
CISCO, status defined, active
R5(config-if)#frame-relay map ip 145.1.1.4 501 broadcast
R5可以ping 通R4
R5#ping 145.1.1.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 145.1.1.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 37/38/39 ms
R1ping自己ip145.1.1.1不通
需要增加一条map
frame-relay map ip 145.1.1.1 104
增加完成后,可以ping通自己
R1#ping 145.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 145.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 18/19/20 ms
____________
OSPF
NBMA
手工指定邻居
R1配置
router ospf 110
router-id 1.1.1.1
network 1.1.1.0 0.0.0.255 area 0
network 145.1.1.0 0.0.0.255 area 0
neighbor 145.1.1.5
neighbor 145.1.1.4
指定DR(HUB)
更改R1的优先级为2,R4,和R5优先级为0,不参与DR选举,R1为DR,R4和R5都为DROTHER。
R1#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
4.4.4.4 0 FULL/DROTHER 00:01:34 145.1.1.4 Serial2/0
5.5.5.5 0 FULL/DROTHER 00:01:40 145.1.1.5 Serial2/0
路由信息,所有路由都可以学到
R1#show ip route ospf
4.0.0.0/32 is subnetted, 1 subnets
O 4.4.4.4 [110/65] via 145.1.1.4, 00:00:55, Serial2/0
5.0.0.0/32 is subnetted, 1 subnets
O 5.5.5.5 [110/65] via 145.1.1.5, 00:00:55, Serial2/0
R4#show ip route ospf
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/65] via 145.1.1.1, 00:01:21, Serial2/1
5.0.0.0/32 is subnetted, 1 subnets
O 5.5.5.5 [110/65] via 145.1.1.5, 00:01:21, Serial2/1
R5
R5#show ip route ospf
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/65] via 145.1.1.1, 00:01:49, Serial2/0
4.0.0.0/32 is subnetted, 1 subnets
O 4.4.4.4 [110/65] via 145.1.1.4, 00:01:39, Serial2/0
看能不能互相访问
R4的路由表和map表
R4#show ip route ospf
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/65] via 145.1.1.1, 00:00:22, Serial2/0
5.0.0.0/32 is subnetted, 1 subnets
O 5.5.5.5 [110/65] via 145.1.1.5, 00:00:22, Serial2/0
R4#show fram
R4#show frame-relay ma
R4#show frame-relay map
Serial2/0 (up): ip 145.1.1.1 dlci 401(0x191,0x6410), dynamic,
broadcast,, status defined, active
R4#
不能访问,没有发出去,没有145.1.1.5的map。
R4#ping 5.5.5.5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 5.5.5.5, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
需要手工写MAP
R4(config)#int s2/0
R4(config-if)#frame-relay map ip 145.1.1.5 401 broadcast
R4ping 5.5.5.5的源ip地址是多少?,从哪个发出去,就是哪个。
开启R5调试功能
R5#debug ip packet
IP packet debugging is on
R4 ping 5.5.5.5没有ping能但从R5上输出的调试信息可以看到源ip地址为145.1.1.4
R4#ping 5.5.5.5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 5.5.5.5, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
R5 调试信息,可以看出是R5没有到145.1.1.4的map,报文封装失败
*Apr 27 13:47:44.688: IP: s=145.1.1.4 (Serial2/0), d=5.5.5.5, len 100, rcvd 4
*Apr 27 13:47:44.688: IP: s=145.1.1.4 (Serial2/0), d=5.5.5.5, len 100, stop process pak for forus packet
*Apr 27 13:47:44.688: IP: s=5.5.5.5 (local), d=145.1.1.4 (Serial2/0), len 100, sending
*Apr 27 13:47:44.688: IP: s=5.5.5.5 (local), d=145.1.1.4 (Serial2/0), len 100, encapsulation failed
增加map映射
frame-relay map ip 145.1.1.4 501 broadcast
R4可以ping 通5.5.5.5
R4#ping 5.5.5.5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 5.5.5.5, timeout is 2 seconds:
!!!!!
R4下面的网络也可ping通 5.5.5.5
R4#ping 5.5.5.5 source 4.4.4.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 5.5.5.5, timeout is 2 seconds:
Packet sent with a source address of 4.4.4.4
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 17/18/20 ms
更改接口类型为broadcast
自动NEI,需要选DR,需要手工MAP
P2MP NBMA
点到多点非广播,不需要手工MAP,就可以访问5.5.5.5网络
点到多点会生成直连网段32位主机路由,R4到5.5.5.5的路由会通过HUB节点进行转发。
R4#show ip route
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/65] via 145.1.1.1, 00:01:39, Serial2/0
4.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 4.4.4.0/24 is directly connected, Loopback0
L 4.4.4.4/32 is directly connected, Loopback0
5.0.0.0/32 is subnetted, 1 subnets
O 5.5.5.5 [110/129] via 145.1.1.1, 00:01:29, Serial2/0
145.1.0.0/16 is variably subnetted, 4 subnets, 2 masks
C 145.1.1.0/24 is directly connected, Serial2/0
O 145.1.1.1/32 [110/64] via 145.1.1.1, 00:01:39, Serial2/0
L 145.1.1.4/32 is directly connected, Serial2/0
O 145.1.1.5/32 [110/128] via 145.1.1.1, 00:01:29, Serial2/0
R4#ping 5.5.5.5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 5.5.5.5, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 18/19/20 ms
P2MP
网络类型的作用
RIP EIGRP OSPF
P2P
通过子接口配置
需要不同的网段,需要确保双方的网络类型一致。