View Single Post
Tuổi 11-08-2009, 11:04 PM   #1
adminphuong
Administrator
 
Avatar của adminphuong
 
Gia nhập: Jul 2009
Trả Lời: 152
Cấu hình IGRP cơ bản
Cấu hình IGRP cơ bản


Mô tả & yêu cầu

–Router 1, router 2 sử dụng IGRP để quảng cáo thông tin định tuyến
–Router 1 hoạt động như DCE cung cấp xung clock cho router 2
–Các router cấu hình IGRP và quảng cáo tất cả các mạng nối trực tiếp.
–Từ router 1, router 2 ping được hết các địa chỉ trong mạng.

Cấu hình

Router R1

hostname R1
!
enable password cisco
!
ip subnet-zero
no ip domain-lookup
!
interface Loopback0
ip address 192.168.4.1 255.255.255.0
!
interface Loopback1
ip address 192.168.5.1 255.255.255.0
!
interface Loopback2
ip address 192.168.6.1 255.255.255.0
!
interface Ethernet0
ip address 192.168.1.1 255.255.255.0
!
interface Serial0
ip address 192.168.3.1 255.255.255.0
clock rate 64000
!
router igrp 234
network 192.168.1.0
network 192.168.3.0
network 192.168.4.0
network 192.168.5.0
network 192.168.6.0
!
end

Router R2
!
hostname R2
!
enable password cisco
!
ip subnet-zero
no ip domain-lookup
!
interface Loopback0
ip address 192.168.7.1 255.255.255.0
!
interface Loopback1
ip address 192.168.8.1 255.255.255.0
!
interface Loopback2
ip address 192.168.9.1 255.255.255.0
!
interface Ethernet0
ip address 192.168.2.1 255.255.255.0
!
interface Serial0
ip address 192.168.3.2 255.255.255.0
!
router igrp 234
network 192.168.2.0
network 192.168.3.0
network 192.168.7.0
network 192.168.8.0
network 192.168.9.0
!
end

Các bước thực hiện

1. Đặt hostname, cấu hình cho các cổng loopback, ethernet và serial trên router R1

Router> en
Router# conf t
Router(config)# hostname R1
R1(config)# no ip domain-lookup
R1(config)# int e0
R1(config-if)#ip addr 192.168.1.1 255.255.255.0
R1(config-if)#no keepalive ← cho phép cổng Ethernet vẫn up khi không kết nối với bên ngoài
R1(config-if)# no shut
%LINK-3-UPDOWN: Interface Ethernet0, changed state to up
%LINK-5-UPDOWN: Line protocol on Interface Ethernet0, changed state to up
R1(config-if)# exit

R1(config)# int lo0 ← Định nghĩa cổng ảo để làm điểm kiểm tra
R1(config-if)# ip addr 192.168.4.1 255.255.255.0
R1(config-if)# int lo1
R1(config-if)# ip addr 192.168.5.1 255.255.255.0
R1(config-if)# int lo2
R1(config-if)# ip addr 192.168.6.1 255.255.255.0
R1(config-if)# exit

R1(config-if)# int s0
R1(config-if)# ip addr 192.168.3.1 255.255.255.0
R1(config-if)# clock rate 64000 ← hoạt động như DCE cung cấp xung clock
R1(config-if)# no shut

2. Đặt hostname, cấu hình cho các cổng loopback, ethernet và serial trên router R2

Router> en
Router# conf t
Router(config)# hostname R2
R2(config)# no ip domain-lookup

R2(config)#int e0
R2(config-if)# ip addr 192.168.2.1 255.255.255.0
R2(config-if)# no shut
R2(config-if)# int lo0
R2(config-if)# ip addr 192.168.7.1 255.255.255.0
R2(config-if)# int lo1
R2(config-if)# ip addr 192.168.8.1 255.255.255.0
R2(config-if)# int lo2
R2(config-if)# ip addr 192.168.9.1 255.255.255.0

R2(config-if)# int s0
R2(config-if)# ip addr 192.168.3.2 255.255.255.0
R2(config-if)# no shut

3. Cấu hình giao thức định tuyến IGRP và sau đó lưu cấu hình vào NVRAM trên router R1

R1(config)# router igrp 234 ← kích hoạt quá trình định tuyến IGRP trên router
R1(config-router)# network 192.168.1.0 ← chỉ ra mạng sẽ quảng cáo và xác định cổng nào sẽ gởi và nhận thông tin định tuyến RIP
R1(config-router)# network 192.168.3.0
R1(config-router)# network 192.168.4.0
R1(config-router)# network 192.168.5.0
R1(config-router)# network 192.168.6.0
R1(config-router)# end
R1#copy run start

4. Cấu hình giao thức định tuyến IGRP và sau đó lưu cấu hình vào NVRAM trên router R2

R2(config)# router igrp 234
R2(config-router)# network 192.168.2.0
R2(config-router)# network 192.168.3.0
R2(config-router)# network 192.168.7.0
R2(config-router)# network 192.168.8.0
R2(config-router)# network 192.168.9.0
R2(config-rputer)# end
R2# copy run start

5. Kiểm tra và giải quyết sự cố

Dùng lệnh clear ip route * để xoá toàn bộ route từ bảng định tuyến.

R1# clear ip route *

Xem quá trình gửi nhận thông tin định tuyến IGRP bằng lệnh debug ip igrp events, debug ip igrp transactions.

R1# debug ip igrp events
IGRP event debugging is on
R1# debug ip igrp transactions
IGRP protocol debuging is on
R1#
IGRP: received update from 192.168.3.2 on R2
IGRP: Update contains 0 interior, 4 system, and 0 exterior routes.
IGRP: Total routes in update: 4

Tắt chế độ debug bằng lệnh undebug all.

R1# undebug all
All possible debugging has been turned off

Xem bảng định tuyến trên R1 và R2 bằng lệnh show ip route.

R1# show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
U - per-user static route, o - ODR
Gateway of last resort is not set

I 192.168.9.0/24 [100/8976] via 192.168.3.2, 00:00:46, Serial0
I 192.168.8.0/24 [100/8976] via 192.168.3.2, 00:00:46, Serial0
C 192.168.3.0/24 is directly connected, Serial0
I 192.168.2.0/24 [100/8576] via 192.168.3.2, 00:00:46, Serial0
C 192.168.1.0/24 is directly connected, Ethernet0
I 192.168.7.0/24 [100/8976] via 192.168.3.2, 00:00:47, Serial0
C 192.168.6.0/24 is directly connected, Loopback2
C 192.168.5.0/24 is directly connected, Loopback1
C 192.168.4.0/24 is directly connected, Loopback0

Từ R1, bạn có thể thấy có 4 route IGRP học từ next-hop 192.168.3.2 và đi qua cổng S0. Chú ý số AD trong trường hợp IGRP là 100(RIP là 120 và OSPF là 110). I có nghĩa là IGRP.

R2# show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
U - per-user static route, o - ODR
Gateway of last resort is not set
I 192.168.4.0/24 [100/8976] via 192.168.3.1, 00:00:46, Serial0
I 192.168.5.0/24 [100/8976] via 192.168.3.1, 00:00:46, Serial0
C 192.168.3.0/24 is directly connected, Serial0
I 192.168.1.0/24 [100/8576] via 192.168.3.1, 00:00:46, Serial0
C 192.168.2.0/24 is directly connected, Ethernet0
I 192.168.6.0/24 [100/8976] via 192.168.3.1, 00:00:47, Serial0
C 192.168.9.0/24 is directly connected, Loopback2
C 192.168.8.0/24 is directly connected, Loopback1
C 192.168.7.0/24 is directly connected, Loopback0
__________________
Theo: Viet Professionals Co. Ltd. VnPro ®

adminphuong vắng mặt   Trả lời ngay kèm theo trích dẫn này