PDA

View Full Version : Lab 4-5: OSPF TRÊN MẠNG NBMA DẠNG BROADCAST



admin
27-12-2004, 01:36 PM
Lab 4-5: OSPF TRÊN MẠNG NBMA DẠNG BROADCAST

http://vnpro.org/forum/files/labrouting/lab45/lab45.JPG

Mô tả

Khi cấu hình OSPF trong môi trường NBMA như Frame Relay, điều quan trọng là phải xác định được router nào sẽ là router chỉ định DR/BDR trong mạng. Router DR/BDR cần phải có kết nối (logical) đến tất cả các router khác trong mạng. Tuỳ vào việc sử dụng network type nào (broadcast, non-broadcast, point-to-point hay point-to-multipoint) mà cách cấu hình sẽ khác nhau.

Bài thực hành này mô tả mạng Frame Relay sử dụng giao thức định tuyến OSPF với network type là broadcast. Khi các cổng giao tiếp được cấu hình broadcast, nó sẽ xem như được nối trong mạng LAN. DR và BDR vẫn được chọn trong mạng, cần phải lưu ý là các DR/BDR được chọn có đường kết nối vật lý tới tất cả các router khác trong mạng.

RouterA, RouterB, RouterC kết nối vào Frame Relay Switch. Trên tất cả các router dùng câu lệnh ip ospf network broadcast. Các Serial cổng giao tiếp trên RouterA và RouterC được cấu hình OSPF priority là 0 để đảm bảo cho RouterB làm DR cho mạng.
Cấu hình

FrameRelaySwitch

!

hostname FrameSwitch

!

ip subnet-zero

!

frame-relay switching

!

!

interface Serial0/0

no ip address

encapsulation frame-relay

clockrate 64000

frame-relay intf-type dce

frame-relay route 100 interface Serial0/1 100

!

interface Serial0/1

no ip address

encapsulation frame-relay

clockrate 64000

frame-relay intf-type dce

frame-relay route 100 interface Serial0/0 100

frame-relay route 200 interface Serial0/2 200

!

interface Serial0/2

no ip address

encapsulation frame-relay

clockrate 64000

frame-relay intf-type dce

frame-relay route 200 interface Serial0/1 200

!

ip classless

!

!

line con 0

transport input none

line aux 0

line vty 0 4

!

end

RouterA

!

hostname RouterA

!

!

ip subnet-zero

!

!

interface Loopback0

ip address 1.1.1.1 255.255.255.0

!

interface Serial0/0

ip address 192.1.1.1 255.255.255.0

encapsulation frame-relay

ip ospf network broadcast

ip ospf priority 0

frame-relay map ip 192.1.1.2 100 broadcast

frame-relay map ip 192.1.1.3 100 broadcast

!

router ospf 64

network 1.1.1.1 0.0.0.0 area 0

network 192.1.1.0 0.0.0.255 area 0

!

ip classless

!

line con 0

line aux 0

line vty 0 4

login

!

end

RouterB

!

hostname RouterB

!

!

ip subnet-zero

!

interface Loopback0

ip address 2.2.2.2 255.255.255.0

!

interface Serial0/0

ip address 192.1.1.2 255.255.255.0

encapsulation frame-relay

ip ospf network broadcast

frame-relay map ip 192.1.1.1 100 broadcast

frame-relay map ip 192.1.1.3 200 broadcast

!

router ospf 64

network 2.2.2.2 0.0.0.0 area 0

network 192.1.1.0 0.0.0.255 area 0

!

ip classless

!

line con 0

line aux 0

line vty 0 4

login

!

end

RouterC

!

hostname RouterC

!

ip subnet-zero

!

!

interface Loopback0

ip address 3.3.3.3 255.255.255.0

!

interface Serial0/0

ip address 192.1.1.3 255.255.255.0

encapsulation frame-relay

ip ospf network broadcast

ip ospf priority 0

frame-relay map ip 192.1.1.1 200 broadcast

frame-relay map ip 192.1.1.2 200 broadcast

!

router ospf 64

network 3.3.3.3 0.0.0.0 area 0

network 192.1.1.0 0.0.0.255 area 0

!

ip classless

!

line con 0

line aux 0

line vty 0 4

login

!

end
Kiểm tra

Từ RouterA, xem trạng thái các cổng giao tiếp OSPF bằng lệnh show ip ospf interface s0/0. Chú ý cổng giao tiếp này là loại network type broadcast, nghĩa là phải chọn DR. Khi mạng dạng broadcast thì không cần định nghĩa quan hệ cận kề.

Độ ưu tiên (Priority) của cổng giao tiếp là 0, nghĩa là nó không thể được chọn là DR hay BDR của mạng.

RouterA#sh ip ospf interface s0/0

Serial0/0 is up, line protocol is up

Internet Address 192.1.1.1/24, Area 0

Process ID 64, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 64

Transmit Delay is 1 sec, State DROTHER, Priority 0

Designated Router (ID) 2.2.2.2, Interface address 192.1.1.2

No backup designated router on this network

Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5

Hello due in 00:00:05

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 (Designated Router)

Suppress hello for 0 neighbor(s)

Xem các quan hệ cận kề của RouterA. RouterA có quan hệ cận kề là RouterB (2.2.2.2) được chọn là DR.

RouterA#sh ip ospf neighbor



Neighbor ID Pri State Dead Time Address Interface

2.2.2.2 1 FULL/DR 00:00:35 192.1.1.2 Serial0/0

Trên RouterB xem các quan hệ cận kề, là RouterA và RouterC ở dạng DROTHER tức là chúng không là DR hay BDR của mạng.

RouterB#sh ip ospf neighbor



Neighbor ID Pri State Dead Time Address Interface

3.3.3.3 0 FULL/DROTHER 00:00:35 192.1.1.3 Serial0/0

1.1.1.1 0 FULL/DROTHER 00:00:37 192.1.1.1 Serial0/0

Xem điều gì xảy ra khi RouterA trở thành DR và RouterB trở thành BDR của mạng. Thay đổi giá trị OSPF priority trên RouterB bằng câu lệnh.

RouterB(config)#interface s0/0

RouterB(config-if)#ip ospf priority 1

Thay đổi OSPF priority trên RouterA thành 10.

RouterA(config)#interface s0/0

RouterA(config-if)#ip ospf priority 10

Lưu cấu hình vào NVRAM (lệnh write hay copy run start) và khởi động lại các router. Phải khởi động lại vì khi DR đã được chọn trong mạng, không có router nào có thể trở thành DR trừ khi DR ngưng hoạt động.

Từ RouterA, xem trạng thái OSPF interface, chú ý rằng RouterA bây giờ đã là DR và RouterB là BDR của mạng.

RouterA#sh ip ospf interface s0/0

Serial0/0 is up, line protocol is up

Internet Address 192.1.1.1/24, Area 0

Process ID 64, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 64

Transmit Delay is 1 sec, State DR, Priority 10

Designated Router (ID) 1.1.1.1, Interface address 192.1.1.1

Backup Designated router (ID) 2.2.2.2, Interface address 192.1.1.2

Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5

Hello due in 00:00:06

Index 2/2, flood queue length 0

Next 0x0(0)/0x0(0)

Last flood scan length is 2, maximum is 2

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 (Backup Designated Router)

Suppress hello for 0 neighbor(s)

Xem các quan hệ cận kề của RouterB. RouterB có các quan hệ cận kề là RouterA (1.1.1.1) và RouterC (3.3.3.3). RouterA là DR và RouterC là DROTHER.

RouterB#sh ip ospf neighbor



Neighbor ID Pri State Dead Time Address Interface

1.1.1.1 10 FULL/DR 00:00:35 192.1.1.1 Serial0/0

3.3.3.3 0 FULL/DROTHER 00:00:35 192.1.1.3 Serial0/0

Trên RouterC thực hiện lệnh show ip ospf neighbor, để xem các OSPF quan hệ cận kề của RouterC. Chú ý rằng, RouterC nghĩ rằng RouterB là DR của mạng bởi vì RouterC không có kết nối vật lý tới RouterA.

RouterC#sh ip ospf neighbor



Neighbor ID Pri State Dead Time Address Interface

2.2.2.2 1 FULL/DR 00:00:32 192.1.1.2 Serial0/0

Xem OSPF database trên RouterC bằng lệnh show ip ospf database. Lệnh này xem bảng các LSA router dùng làm dữ liệu để thực hiện thuật toán Dijkstra. RouterC có kết nối 1.1.1.1 và 2.2.2.2.

RouterC#sh ip ospf database

OSPF Router with ID (3.3.3.3) (Process ID 64)

Router Link States (Area 0)

Link ID ADV Router Age Seq# Checksum Link count

1.1.1.1 1.1.1.1 128 0x80000002 0xBF8E 2

2.2.2.2 2.2.2.2 127 0x80000002 0xD36D 2

3.3.3.3 3.3.3.3 127 0x80000002 0xF141 2



Net Link States (Area 0)



Link ID ADV Router Age Seq# Checksum

192.1.1.1 1.1.1.1 128 0x80000001 0x1D49

Xem bảng định tuyến trên RouterC, chú ý rằng không có route tới 1.1.1.1 hay 2.2.2.2

RouterC#sh ip route

Gateway of last resort is not set

3.0.0.0/24 is subnetted, 1 subnets

C 3.3.3.0 is directly connected, Loopback0

C 192.1.1.0/24 is directly connected, Serial0/0

Điều này do router quảng cáo là DR cho mạng broadcast (RouterA) không đến được (not-reachable), có thể xem bằng lệnh show ip ospf database router trên RouterC

RouterC#sh ip ospf database router

OSPF Router with ID (3.3.3.3) (Process ID 64)

Router Link States (Area 0)

Adv Router is not-reachable

LS age: 158

Options: (No TOS-capability, DC)

LS Type: Router Links

Link State ID: 1.1.1.1

Advertising Router: 1.1.1.1

LS Seq Number: 80000002

Checksum: 0xBF8E

Length: 48

Number of Links: 2
Link connected to: a Transit Network

(Link ID) Designated Router address: 192.1.1.1

(Link Data) Router Interface address: 192.1.1.1

Number of TOS metrics: 0

TOS 0 Metrics: 64



Link connected to: a Stub Network

(Link ID) Network/subnet number: 1.1.1.1

(Link Data) Network Mask: 255.255.255.255

Number of TOS metrics: 0

TOS 0 Metrics: 1