!
hostname R1
!
no ip domain lookup
!
interface Loopback0
 ip address 1.1.1.1 255.255.255.255
router ospf 1
 network 0.0.0.0 255.255.255.255 area 0
在这里可以看到,在R1上可以动态获得到达R1,R2的DLCI号,因为在帧中继交换机上配置了PVC:
R1#show frame-relay map
Serial1/0 (up): ip 192.168.1.2 dlci 100(0x64,0x1840), static,
              broadcast,
              CISCO, status defined, active
Serial1/0 (up): ip 192.168.1.3 dlci 200(0xC8,0x3080), dynamic,
              broadcast,, status defined, active
R1#show ip route
Gateway of last resort is not set
     1.0.0.0/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback0
     2.0.0.0/32 is subnetted, 1 subnets
O       2.2.2.2 [110/65] via 192.168.1.2, 00:02:19, Serial1/0
     3.0.0.0/32 is subnetted, 1 subnets
O       3.3.3.3 [110/65] via 192.168.1.3, 00:02:19, Serial1/0
C    192.168.1.0/24 is directly connected, Serial1/0
R1#show ip ospf neig
Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.2           0   FULL/DROTHER    00:00:37    192.168.1.2     Serial1/0
3.3.3.3           0   FULL/DROTHER    00:00:32    192.168.1.3     Serial1/0

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 = 168/262/472 ms
R1#ping 192.168.1.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.3, timeout is 2 seconds:
!!!!!
 

!
hostname R2
!
interface Loopback0
 ip address 2.2.2.2 255.255.255.255
!
interface Serial1/0
 ip address 192.168.1.2 255.255.255.0
 encapsulation frame-relay
//将NBMA设置成广播类型的网络
 ip ospf network broadcast
 ip ospf priority 0
!
router ospf 1
 log-adjacency-changes
 network 0.0.0.0 255.255.255.255 area 0

R2#ping 192.168.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
Serial1/0 (up): ip 0.0.0.0 dlci 100(0x64,0x1840)
              broadcast,
              CISCO, status defined, active
Serial1/0 (up): ip 192.168.1.1 dlci 100(0x64,0x1840), dynamic,
              broadcast,, status defined, active
R2#show ip route
Gateway of last resort is not set
     1.0.0.0/32 is subnetted, 1 subnets
O       1.1.1.1 [110/65] via 192.168.1.1, 00:10:54, Serial1/0
     2.0.0.0/32 is subnetted, 1 subnets
C       2.2.2.2 is directly connected, Loopback0
     3.0.0.0/32 is subnetted, 1 subnets
O       3.3.3.3 [110/65] via 192.168.1.3, 00:10:54, Serial1/0
C    192.168.1.0/24 is directly connected, Serial1/0
R2#show ip ospf neig
Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1           1   FULL/DR         00:00:33    192.168.1.1     Serial1/0
//可以在路由表中看到R3的RID号,但是,在R2上却PING不通R2的接口IP
//这是因为在R2中没有到达R3接口DLCI号,没有办法封装
R2#ping 192.168.1.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.3, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
但是在R2的接口inter s 1/0配置了Frame-relay map ip 后:
R2(config)#inte s 1/0
R2(config-if)#frame-relay map ip 192.168.1.3 100 broadcast //这个 broadcast 必须指定,因为该网络为NBMA广播
//可以从下面看到已经PING得通了
R2#ping 192.168.1.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.3, timeout is 2 seconds:
!!!!!
!
hostname R3
!
interface Loopback0
 ip address 3.3.3.3 255.255.255.255
interface Serial1/0
 ip address 192.168.1.3 255.255.255.0
 encapsulation frame-relay
 ip ospf network broadcast
 ip ospf priority 0
 serial restart-delay 0
 frame-relay map ip 192.168.1.1 200 broadcast
 frame-relay map ip 192.168.1.2 200 broadcast   //必须指定
!
router ospf 1
 network 0.0.0.0 255.255.255.255 area 0
R3#show ip ospf neig
Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1           1   FULL/DR         00:00:37    192.168.1.1     Serial1/0

R3#show ip route
Gateway of last resort is not set
     1.0.0.0/32 is subnetted, 1 subnets
O       1.1.1.1 [110/65] via 192.168.1.1, 00:04:36, Serial1/0
     2.0.0.0/32 is subnetted, 1 subnets
O       2.2.2.2 [110/65] via 192.168.1.2, 00:04:36, Serial1/0
     3.0.0.0/32 is subnetted, 1 subnets
C       3.3.3.3 is directly connected, Loopback0
C    192.168.1.0/24 is directly connected, Serial1/0
R3#show frame-relay map
Serial1/0 (up): ip 192.168.1.1 dlci 200(0xC8,0x3080), static,
              broadcast,
              CISCO, status defined, active
Serial1/0 (up): ip 192.168.1.2 dlci 200(0xC8,0x3080), static,
              broadcast,
              CISCO, status defined, active
R3#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:
!!!!!