root
Well-Known Member
- Joined
- Dec 31, 2012
- Messages
- 1,153
- Reaction score
- 71
- Points
- 48
I. Yêu cầu
- Mô hình
- Yêu cầu:
1. Cấu hình IP cho các Router
- Thực hiện cấu hình IP như hình vẽ
[TABLE="class: outer_border, width: 700"]
[TR]
[TD]//Router 1
R1(config)#interface loopback 1
R1(config-if)#description Engineering Department
R1(config-if)#ip add 10.1.1.1 255.255.255.0
R1(config-if)#int f0/0
R1(config-if)#ip add 10.1.200.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#int s1/0
R1(config-if)#ip add 10.1.100.1 255.255.255.0
R1(config-if)#no shut
//Router 2
R2(config-if)#interface loopback 2
R2(config-if)#description Marketing Department
R2(config-if)#ip add 10.1.2.1 255.255.255.0
R2(config-if)#int f0/0
R2(config-if)#ip add 10.1.200.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#int s1/0
R2(config-if)#ip add 10.1.100.2 255.255.255.0
R2(config-if)#no shut
//Router 3
R3(config-if)#interface loopback 3
R3(config-if)#description Accounting Department
R3(config-if)#ip add 10.1.3.1 255.255.255.0
R3(config-if)#int f0/0
R3(config-if)#ip add 10.1.200.3 255.255.255.0
R3(config-if)#no shut[/TD]
[/TR]
[/TABLE]
- Cấu hình định tuyến OSPF trên các Router
2. Kiểm tra với các lệnh SHOW
- Thứ kiểm tra định tuyến trên Router 1 ta thấy
- Lệnh "show ip ospf" cho các bạn biết thêm được nhiều các thông số khác
- Lệnh "show ip ospf neighbor" cho ta biết các Neighbor của Router R1. Như dưới đây ta có thể thấy R1 có 3 Neighbor trao đổi thông tin định tuyến với nó qua các interface F0/0 và S1/0
- Riêng Neighbor 10.1.2.1 được học 2 lần
- Theo bảng Neighbor interface f0/0 của R1 ta thấy
- Lệnh "show ip ospf interface" Lệnh này cho chúng ta biết
- Lệnh "show ip ospf database" để hiện thị bảng cơ sở dữ liệu trạng thái đường liên kết trên Router (LSDB - Link state Database)
3. Cho phép interface loopback tham gia OSPF
- cấu hình Router để interface loopback được tham gia vào định tuyến OSPF
[TABLE="class: outer_border, width: 600"]
[TR]
[TD]//Router 1
R1(config)#router ospf 1
R1(config-router)#network 10.1.1.0 0.0.0.255 area 0
//Router 2
R2(config)#router ospf 1
R2(config-router)#network 10.1.2.0 0.0.0.255 area 0
//Router 3
R3(config)#router ospf 1
R3(config-router)#network 10.1.3.0 0.0.0.255 area 0[/TD]
[/TR]
[/TABLE]
- Kiểm tra lại bảng định tuyến sau khi config
- Chúng ta để ý nhé. Subnet trang các Loopback lúc nào cũng được OSPF quảng bá đi với Prefix-length là /32.
- Để thay đổi điều này, các bạn vào Loopback và lệnh sau
[TABLE="class: outer_border, width: 600"]
[TR]
[TD]//Router 1
R1(config)#interface loopback 1
R1(config-if)#ip ospf network point-to-point
//Router 2
R2(config)#interface loopback 2
R2(config-if)#ip ospf network point-to-point
//Router 3
R3(config)#interface loopback 3
R3(config-if)#ip ospf network point-to-point[/TD]
[/TR]
[/TABLE]
- Kiểm tra lại bảng định tuyến
- Mô hình
- Yêu cầu:
- Cấu hình IP theo sơ đồ
- cấu hình định tuyến OSPF trên các Router và cấu hình cho phép các interface Loopback được tham gia định tuyến OSPF
- Kiểm tra lại các cấu hình bằng lệnh Show
- Cấu hình chỉnh sửa COST
- Hiệu chỉnh Priority để: R1 làm DR, R2 làm BDR và R3 làm DROTHER
1. Cấu hình IP cho các Router
- Thực hiện cấu hình IP như hình vẽ
[TABLE="class: outer_border, width: 700"]
[TR]
[TD]//Router 1
R1(config)#interface loopback 1
R1(config-if)#description Engineering Department
R1(config-if)#ip add 10.1.1.1 255.255.255.0
R1(config-if)#int f0/0
R1(config-if)#ip add 10.1.200.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#int s1/0
R1(config-if)#ip add 10.1.100.1 255.255.255.0
R1(config-if)#no shut
//Router 2
R2(config-if)#interface loopback 2
R2(config-if)#description Marketing Department
R2(config-if)#ip add 10.1.2.1 255.255.255.0
R2(config-if)#int f0/0
R2(config-if)#ip add 10.1.200.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#int s1/0
R2(config-if)#ip add 10.1.100.2 255.255.255.0
R2(config-if)#no shut
//Router 3
R3(config-if)#interface loopback 3
R3(config-if)#description Accounting Department
R3(config-if)#ip add 10.1.3.1 255.255.255.0
R3(config-if)#int f0/0
R3(config-if)#ip add 10.1.200.3 255.255.255.0
R3(config-if)#no shut[/TD]
[/TR]
[/TABLE]
[TABLE="class: outer_border, width: 600"]
[TR]
[TD]//Router 1
R1(config)#router ospf 1
R1(config-router)#network 10.1.100.0 0.0.0.255 area 0
R1(config-router)#network 10.1.200.0 0.0.0.255 area 0
//Router 2
R2(config)#router ospf 1
R2(config-router)#network 10.1.100.0 0.0.0.255 area 0
R2(config-router)#network 10.1.200.0 0.0.0.255 area 0
//Router 3
R3(config)#router ospf 1
R3(config-router)#network 10.1.200.0 0.0.0.255 area 0[/TD]
[/TR]
[/TABLE]
- Sau khi cấu hình định tuyến xong các bạn sẽ thấy các thông báo Neighbor trong OSPF[TR]
[TD]//Router 1
R1(config)#router ospf 1
R1(config-router)#network 10.1.100.0 0.0.0.255 area 0
R1(config-router)#network 10.1.200.0 0.0.0.255 area 0
//Router 2
R2(config)#router ospf 1
R2(config-router)#network 10.1.100.0 0.0.0.255 area 0
R2(config-router)#network 10.1.200.0 0.0.0.255 area 0
//Router 3
R3(config)#router ospf 1
R3(config-router)#network 10.1.200.0 0.0.0.255 area 0[/TD]
[/TR]
[/TABLE]
Code:
R1(config-router)#
*Mar 1 00:11:08.175: %OSPF-5-ADJCHG: Process 1, Nbr 10.1.2.1 on Serial1/0 from LOADING to FULL, Loading Done
R1(config-router)#
*Mar 1 00:11:17.287: %OSPF-5-ADJCHG: Process 1, Nbr 10.1.2.1 on FastEthernet0/0 from LOADING to FULL, Loading Done
R1(config-router)#
*Mar 1 00:11:27.287: %OSPF-5-ADJCHG: Process 1, Nbr 10.1.3.1 on FastEthernet0/0 from LOADING to FULL, Loading Done
2. Kiểm tra với các lệnh SHOW
- Thứ kiểm tra định tuyến trên Router 1 ta thấy
- Router-ID của R1 là: 10.1.1.1
- R1 đã thực hiện định tuyến OSPF với các mạng 10.1.100.0/24 và 10.1.200.0/24
Code:
R1#[COLOR=#ff0000][B]sh ip protocols[/B][/COLOR]
[COLOR=#ff0000]Routing Protocol is "ospf 1"[/COLOR]
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
[COLOR=#ff0000] Router ID 10.1.1.1[/COLOR]
Number of areas in this router is 1. 1 normal 0 stub 0 nssa
Maximum path: 4
Routing for Networks:
[COLOR=#ff0000] 10.1.100.0 0.0.0.255 area 0[/COLOR]
[COLOR=#ff0000] 10.1.200.0 0.0.0.255 area 0[/COLOR]
Reference bandwidth unit is 100 mbps
Routing Information Sources:
Gateway Distance Last Update
Distance: (default is 110)
- Process-ID = 1
- Router-ID = 10.1.1.1
Code:
R1#[COLOR=#ff0000][B]sh ip ospf[/B][/COLOR]
[COLOR=#ff0000] Routing Process "ospf 1" with ID 10.1.1.1[/COLOR]
Start time: 00:09:34.632, Time elapsed: 00:15:57.400
Supports only single TOS(TOS0) routes
Supports opaque LSA
Supports Link-local Signaling (LLS)
Supports area transit capability
Router is not originating router-LSAs with maximum metric
Initial SPF schedule delay 5000 msecs
Minimum hold time between two consecutive SPFs 10000 msecs
Maximum wait time between two consecutive SPFs 10000 msecs
Incremental-SPF disabled
Minimum LSA interval 5 secs
Minimum LSA arrival 1000 msecs
LSA group pacing timer 240 secs
Interface flood pacing timer 33 msecs
Retransmission pacing timer 66 msecs
Number of external LSA 0. Checksum Sum 0x000000
Number of opaque AS LSA 0. Checksum Sum 0x000000
Number of DCbitless external and opaque AS LSA 0
Number of DoNotAge external and opaque AS LSA 0
Number of areas in this router is 1. 1 normal 0 stub 0 nssa
Number of areas transit capable is 0
External flood list length 0
IETF NSF helper support enabled
Cisco NSF helper support enabled
Area BACKBONE(0)
Number of interfaces in this area is 2
Area has no authentication
SPF algorithm last executed 00:14:00.696 ago
SPF algorithm executed 5 times
Area ranges are
Number of LSA 4. Checksum Sum 0x02F53D
Number of opaque link LSA 0. Checksum Sum 0x000000
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Flood list length 0
- Riêng Neighbor 10.1.2.1 được học 2 lần
- 1 lần qua interface f0/0
- 1 lần qua interface s1/0
- Theo bảng Neighbor interface f0/0 của R1 ta thấy
- R1 đang trao đổi thông tin với 1 Router có chức năng DR
- R1 cũng đang trao đổi thông tin với 1 Router DROTHER
Code:
R1#[COLOR=#ff0000][B]sh ip ospf neighbor[/B][/COLOR]
Neighbor ID Pri State Dead Time Address Interface
10.1.2.1 1 FULL/[COLOR=#ff0000]BDR[/COLOR] 00:00:38 10.1.200.2 FastEthernet0/0
10.1.3.1 1 FULL/[COLOR=#ff0000]DROTHER[/COLOR] 00:00:34 10.1.200.3 FastEthernet0/0
10.1.2.1 0 FULL/ - 00:00:32 10.1.100.2 Serial1/0
- Các interface tham gia vào định tuyến OSPF
- Các thông số của Interface tham gia đinh tuyến như: Network type, helo-timer, dead-timer...
Code:
R1#[COLOR=#ff0000][B]sh ip ospf interface[/B][/COLOR]
FastEthernet0/0 is up, line protocol is up
Internet Address 10.1.200.1/24, Area 0
Process ID 1, Router ID 10.1.1.1,[COLOR=#ff0000] Network Type BROADCAST[/COLOR], Cost: 10
Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 10.1.1.1, Interface address 10.1.200.1
Backup Designated router (ID) 10.1.2.1, Interface address 10.1.200.2
Timer intervals configured, [COLOR=#ff0000]Hello 10, Dead 40, Wait 40, Retransmit 5[/COLOR]
oob-resync timeout 40
Hello due in 00:00:00
Supports Link-local Signaling (LLS)
Cisco NSF helper support enabled
IETF NSF helper support enabled
Index 2/2, 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 2, Adjacent neighbor count is 2
Adjacent with neighbor 10.1.2.1 (Backup Designated Router)
Adjacent with neighbor 10.1.3.1
Suppress hello for 0 neighbor(s)
Serial1/0 is up, line protocol is up
Internet Address 10.1.100.1/24, Area 0
Process ID 1, Router ID 10.1.1.1, Network Type POINT_TO_POINT, Cost: 64
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:03
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 10.1.2.1
Suppress hello for 0 neighbor(s)
Code:
R1#[COLOR=#ff0000][B]sh ip ospf database[/B][/COLOR]
OSPF Router with ID (10.1.1.1) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
10.1.1.1 10.1.1.1 1765 0x80000004 0x00B81E 3
10.1.2.1 10.1.2.1 1766 0x80000002 0x00BD18 3
10.1.3.1 10.1.3.1 1751 0x80000002 0x0093CB 1
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
10.1.200.1 10.1.1.1 1755 0x80000002 0x00EC3C
3. Cho phép interface loopback tham gia OSPF
- cấu hình Router để interface loopback được tham gia vào định tuyến OSPF
[TABLE="class: outer_border, width: 600"]
[TR]
[TD]//Router 1
R1(config)#router ospf 1
R1(config-router)#network 10.1.1.0 0.0.0.255 area 0
//Router 2
R2(config)#router ospf 1
R2(config-router)#network 10.1.2.0 0.0.0.255 area 0
//Router 3
R3(config)#router ospf 1
R3(config-router)#network 10.1.3.0 0.0.0.255 area 0[/TD]
[/TR]
[/TABLE]
Code:
R1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
[COLOR=#ff0000]O 10.1.2.1/32 [110/11] via 10.1.200.2, 00:01:17, FastEthernet0/0[/COLOR]
[COLOR=#ff0000]O 10.1.3.1/32 [110/11] via 10.1.200.3, 00:00:51, FastEthernet0/0[/COLOR]
C 10.1.1.0/24 is directly connected, Loopback1
C 10.1.100.0/24 is directly connected, Serial1/0
C 10.1.200.0/24 is directly connected, FastEthernet0/0
- Chúng ta để ý nhé. Subnet trang các Loopback lúc nào cũng được OSPF quảng bá đi với Prefix-length là /32.
- Để thay đổi điều này, các bạn vào Loopback và lệnh sau
[TABLE="class: outer_border, width: 600"]
[TR]
[TD]//Router 1
R1(config)#interface loopback 1
R1(config-if)#ip ospf network point-to-point
//Router 2
R2(config)#interface loopback 2
R2(config-if)#ip ospf network point-to-point
//Router 3
R3(config)#interface loopback 3
R3(config-if)#ip ospf network point-to-point[/TD]
[/TR]
[/TABLE]
Code:
R1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
10.0.0.0/24 is subnetted, 5 subnets
[COLOR=#ff0000]O 10.1.3.0 [110/11] via 10.1.200.3, 00:01:09, FastEthernet0/0[/COLOR]
[COLOR=#ff0000]O 10.1.2.0 [110/11] via 10.1.200.2, 00:01:52, FastEthernet0/0[/COLOR]
C 10.1.1.0 is directly connected, Loopback1
C 10.1.100.0 is directly connected, Serial1/0
C 10.1.200.0 is directly connected, FastEthernet0/0