Yêu cầu :
- Cấu hình cơ bản cho các Router.
- Cấu hình định tuyến OSPF.
- Kiểm tra hoạt động của OSPF sau khi cấu hình định
tuyến.
-
Cấu hình xác thực OSPF với Plain-text giữa Router1 và Router2; MD5 giữa Router2 và Router3.
- Kiểm tra cấu hình xác thực.
Hướng dẫn :
Công việc 1 : Cấu hình
cơ bản cho các Router.
Công việc 2 : Cấu hình
định tuyến OSPF.
Router1(config)#router
ospf 1
Router1(config)#network
10.1.12.0 0.0.0.255 area 0
Router1(config)#network
10.1.1.0 0.0.0.255 area 0
Router2(config)#router
ospf 1
Router2(config)#network
10.1.12.0 0.0.0.255 area 0
Router2(config)#network
10.2.2.0 0.0.0.255 area 0
Router2(config)#network
10.1.23.0 0.0.0.255 area 0
Router3(config)#router
ospf 1
Router3(config)#network
10.1.23.0 0.0.0.255 area 0
Router3(config)#network
10.3.3.0 0.0.0.255 area 0
Công việc 3 : Kiểm tra
hoạt động của OSPF sau khi cấu hình định tuyến.
Router2#show ip ospf neighbor
Neighbor
ID Pri State
Dead Time
Address Interface
10.1.1.1 1 FULL/- 00:00:38 10.1.12.1 Serial0/1/0
10.3.3.3 1 FULL/- 00:00:39 10.1.23.3
Serial0/1/1
Router1#show ip route
10.0.0.0/8 is variably subnetted, 5
subnets, 2 masks
C 10.1.1.0/24 is directly connected,
Loopback1
C 10.1.12.0/24 is directly connected,
Serial0/0/0
O 10.1.23.0/24 [110/128] via 10.1.12.2, 00:37:31,
Serial0/0/0
O 10.2.2.2/32 [110/65] via 10.1.12.2, 00:37:31, Serial0/0/0
O 10.3.3.3/32 [110/129]
via 10.1.12.2, 00:37:31,
Serial0/0/0
Router2#show ip route
10.0.0.0/8 is variably subnetted, 5
subnets, 2 masks
O 10.1.1.1/32 [110/65] via 10.1.12.1, 00:35:40,
Serial0/1/0
C 10.1.12.0/24 is directly connected,
Serial0/1/0
C 10.1.23.0/24 is directly connected,
Serial0/1/1
C 10.2.2.0/24 is directly connected,
Loopback2
O 10.3.3.3/32 [110/65] via 10.1.23.3, 00:35:40,
Serial0/1/1
Router3#show ip route
10.0.0.0/8 is variably subnetted, 5
subnets, 2 masks
O 10.1.1.1/32 [110/129]
via 10.1.23.2, 00:39:47,
Serial0/2/0
O 10.1.12.0/24 [110/128] via 10.1.23.2, 00:39:47,
Serial0/2/0
C 10.1.23.0/24 is directly connected,
Serial0/2/0
O 10.2.2.2/32 [110/65]
via 10.1.23.2, 00:39:47,
Serial0/2/0
C 10.3.3.0/24 is directly connected,
Loopback3
Công việc 4 : Cấu hình
xác thực OSPF
Cấu
hình xác thực cho phép Router xem xét nguồn gốc của các thông tin định tuyến nhận
được. Khoá được trao đổi giữa các router, nếu khoá không trùng nhau thì thông
tin định tuyến không được chấp nhận. Cisco có hai loại xác thực cho các Router OSPF
láng giềng là Plain-text và MD5 (Message Digest Algorithm Version 5). Xác thực
Plain-text gởi khoá trên đường truyền, khoá ở dạng text nên có thể đọc được
trong quá trình truyền. Xác thực MD5 gửi bản tin đã được mã hoá. Thuật toán MD5
được dùng để thực hiện băm khoá (hashing) thành chuỗi 128 bit và sau đó gửi đi.
ð Cấu hình xác thực Plain text giữa Router1 và Router2
Router1(config)#int s0/0/0
Router1(config-if)#ip ospf
authentication
Router1(config-if)#ip ospf
authentication-key cisco
Router2(config)#int s0/1/0
Router2(config-if)#ip ospf
authentication
Router2(config-if)#ip ospf
authentication-key cisco
Router2(config-if)#
00:41:41: %OSPF-5-ADJCHG: Process 1, Nbr 10.1.1.1 on
Serial0/1/0 from EXCHANGE to FULL, Exchange Done
Lưu ý : Khi ta cấu hình
xác thực cho Router1 trước và trong lúc này Router2 chưa cấu hình xác thực thì
quan hệ láng giềng giữa 2 router này sẽ bị mất (down). Sau khi router2 cấu hình
xác thực xong, quan hệ láng giềng sẽ được thiết lập lại và ta thấy thông báo như
bên trên :
00:41:41: %OSPF-5-ADJCHG: Process 1, Nbr 10.1.1.1 on
Serial0/1/0 from EXCHANGE to FULL, Exchange Done
ð Cấu hình xác thực MD5 giữa Router2 và Router3
Router2(config)#int s0/1/1
Router2(config-if)#ip ospf
authentication message-digest
Router2(config-if)#ip ospf
message-digest-key ?
<1-255>
Key ID
Router2(config-if)#ip ospf
message-digest-key 1 ?
md5
Use MD5 algorithm
Router2(config-if)#ip ospf
message-digest-key 1 md5 ?
LINE
The OSPF password (key) (maximum 16 characters)
Router2(config-if)#ip ospf
message-digest-key 1 md5 cisco
Router3(config)#int s0/2/0
Router3(config-if)#ip ospf
authentication message-digest
Router3(config-if)#ip ospf
message-digest-key 1 md5 cisco
Router3(config-if)#
00:54:30: %OSPF-5-ADJCHG: Process 1, Nbr 10.2.2.2 on Serial0/2/0 from EXCHANGE
to FULL, Exchange Done
Lưu ý : Ngoài password giữa 2 router phải giống nhau
thì Key ID cũng phải giống nhau (trong trường hợp ở trên ta dùng Key ID=1).
Công việc 5 : Kiểm tra cấu hình xác thực.
Router1#show ip ospf interface serial 0/0/0
Serial0/0/0 is up, line
protocol is up
Internet address is 10.1.12.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
Neighbor Count is 1 , Adjacent neighbor count
is 1
Adjacent with neighbor 10.1.12.2
Suppress hello for 0 neighbor(s)
Simple
password authentication enabled ß xác thực plain
text
Router2#show ip ospf interface serial 0/1/0
Serial0/1/0 is up, line
protocol is up
Internet address is 10.1.12.2/24, Area 0
Process ID 1, Router ID 10.2.2.2, 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
Hello due in 00:00:04
Index 3/3, flood queue length 0
Next 0x0(0)/0x0(0)
Neighbor Count is 1 , Adjacent neighbor count
is 1
Adjacent with neighbor 10.1.12.1
Suppress hello for 0 neighbor(s)
Simple
password authentication enabled ß xác thực plain
text
Router2#show ip ospf interface serial 0/1/1
Serial0/1/1 is up, line
protocol is up
Internet address is 10.1.23.2/24, Area 0
Process ID 1, Router ID 10.2.2.2, 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
Hello due in 00:00:06
Index 2/2, flood queue length 0
Next 0x0(0)/0x0(0)
Neighbor Count is 1 , Adjacent neighbor count
is 1
Adjacent with neighbor 10.1.23.3
Suppress hello for 0 neighbor(s)
Message
digest authentication enabled ß xác thực MD5 với
KeyID=1
Youngest key
id is 1
Router3#show ip ospf interface serial 0/2/0
Serial0/2/0 is up, line
protocol is up
Internet address is 10.1.23.3/24, Area 0
Process ID 1, Router ID 10.3.3.3, 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
Hello due in 00:00:05
Index 2/2, flood queue length 0
Next 0x0(0)/0x0(0)
Neighbor Count is 1 , Adjacent neighbor count
is 1
Adjacent with neighbor 10.1.23.2
Suppress hello for 0 neighbor(s)
Message digest
authentication enabled ß xác thực MD5 với
KeyID=1
Youngest key
id is 1