CẤU HÌNH GIAO THỨC ĐỊNH TUYẾN RIPV1 VÀ RIPV2

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 18

CẤU HÌNH GIAO THỨC ĐỊNH TUYẾN RIPV1 VÀ RIPV2

I. Mô hình

II. Mục tiêu


Đặt địa chỉ IP cho các interface trên các Router R1, R2, R3, R4. Cấu hình “static
route” để các router này có thể liên lạc được với nhau.
1. Cấu hình khởi tạo cho các thiết bị mạng, cấu hình các interface của router.
 Đặt tên thiết bị.
 Cấu hình banner motd
 Cấu hình password cho console, telnet, Privileged, enable password, mã hóa
mật khẩu file cấu hình.
 Cấu hình địa chỉ IP
 Cấu hình description
 Cấu hình enable các interface
2. Ping qua lại giữa các interface được kết nối trực tiếp với nhau.
3. Thiết lập giao thức định tuyến RIPv1 và RIPv2 như mô hình trên
4. Xem bảng định tuyến (routing table).
5. Kiểm tra các router có thể ping qua lại lẫn nhau.

BKAP-CMM @BKAP 2021 Page 1 / 18


III. Cấu hình chi tiết
1. Cấu hình khởi tạo cho các thiết bị mạng, cấu hình các interface của router.
 Cấu hình trên R1
- Cấu hình đặt tên thiết bị
Router>enable
Router#configure terminal
Router(config)#hostname R1
R1(config)#
- Cấu hình Banner motd
R1(config)#banner motd "BACHKHOA-APTECH"
- Cấu hình console
R1(config)#line console 0
R1(config-line)#password cisco
R1(config-line)#loggin synchronous
R1(config-line)#exit
- Cấu hình telnet
R1(config)#line vty 0 4
R1(config-line)#password cisco
R1(config-line)#login
R1(config-line)#exit
- Cấu hình password privileged
R1(config)#enable secret bachkhoa-aptech
- Cấu hình enable password
R1(config)#enable password cisco123
- Cấu hình mã hóa mật khẩu trong file cấu hình

BKAP-CMM @BKAP 2021 Page 2 / 18


R1(config)#service password-encryption

- Cấu hình các interface của route


R1(config)#interface serial 0/1
R1(config-if)#ip address 192.168.3.6 255.255.255.252
R1(config-if)#description "R1 Connection to R2"
R1(config-if)#no shut
R1(config-if)#clock rate 64000
R1(config-if)#exit

R1(config)#interface loopback 0
R1(config-if)#ip address 192.168.2.1 255.255.255.0
R1(config-if)#end
R1#

 Cấu hình trên R2


- Cấu hình đặt tên thiết bị
Router>enable
Router#configure terminal
Router(config)#hostname R2
R2(config)#
- Cấu hình Banner motd
R2(config)#banner motd "BACHKHOA-APTECH"
- Cấu hình console
R2(config)#line console 0
R2(config-line)#password cisco
R2(config-line)#loggin synchronous

BKAP-CMM @BKAP 2021 Page 3 / 18


R2(config-line)#exit

- Cấu hình telnet


R2(config)#line vty 0 4
R2(config-line)#password cisco
R2(config-line)#login
R2(config-line)#exit
- Cấu hình password privileged
R2(config)#enable secret bachkhoa-aptech
- Cấu hình enable password
R2(config)#enable password cisco123
- Cấu hình mã hóa mật khẩu trong file cấu hình
R2(config)#service password-encryption
- Cấu hình các interface của route
R2(config)#interface serial 0/0
R2(config-if)#ip address 192.168.3.5 255.255.255.0
R2(config-if)#description "R2 Connection to R1"
R2(config-if)#no shut
R2(config-if)#exit

R2(config)#interface fastEthernet 0/0


R2(config-if)#ip address 192.168.1.1 255.255.255.0
R2(config-if)#description "R2 Connection to SW1"
R2(config-if)#no shut
R2(config-if)#end
R2#

BKAP-CMM @BKAP 2021 Page 4 / 18


 Cấu hình trên R3
- Cấu hình đặt tên thiết bị
Router>enable
Router#configure terminal
Router(config)#hostname R3
R3(config)#
- Cấu hình Banner motd
R3(config)#banner motd "BACHKHOA-APTECH"
- Cấu hình console
R3(config)#line console 0
R3(config-line)#password cisco
R3(config-line)#loggin synchronous
R3(config-line)#exit
- Cấu hình telnet
R3(config)#line vty 0 4
R3(config-line)#password cisco
R3(config-line)#login
R3(config-line)#exit
- Cấu hình password privileged
R3(config)#enable secret bachkhoa-aptech
- Cấu hình enable password
R3(config)#enable password cisco123
- Cấu hình mã hóa mật khẩu trong file cấu hình
R3(config)#service password-encryption

BKAP-CMM @BKAP 2021 Page 5 / 18


- Cấu hình các interface của route
R3(config)#interface fastEthernet 0/0
R3(config-if)#ip address 192.168.1.2 255.255.255.0
R3(config-if)#description "R3 Connection SW1"
R3(config-if)#no shut
R3(config-if)#exit

R3(config)#interface loopback 0
R3(config-if)#ip address 192.168.0.1 255.255.255.0
R3(config-if)#end
R3#

 Cấu hình trên R4


- Cấu hình đặt tên thiết bị
Router>enable
Router#configure terminal
Router(config)#hostname R4
R4(config)#
- Cấu hình Banner motd
R4(config)#banner motd "BACHKHOA-APTECH"
- Cấu hình console
R4(config)#line console 0
R4(config-line)#password cisco
R4(config-line)#loggin synchronous
R4(config-line)#exit

BKAP-CMM @BKAP 2021 Page 6 / 18


- Cấu hình telnet
R4(config)#line vty 0 4
R4(config-line)#password cisco
R4(config-line)#login
R4(config-line)#exit
- Cấu hình password privileged
R4(config)#enable secret bachkhoa-aptech
- Cấu hình enable password
R4(config)#enable password cisco123
- Cấu hình mã hóa mật khẩu trong file cấu hình
R4(config)#service password-encryption
- Cấu hình các interface của route
R4(config)#interface fastEthernet 0/0
R4(config-if)#ip address 192.168.1.3 255.255.255.0
R4(config-if)#description "R4 Connection SW1"
R4(config-if)#no shut
R4(config-if)#exit

R4(config)#interface loopback 0
R4(config-if)#ip address 192.168.4.1 255.255.255.0
R4(config-if)#end
R4#

BKAP-CMM @BKAP 2021 Page 7 / 18


2. Ping qua lại giữa các interface được kết nối trực tiếp với nhau.
 Đứng trên R1:
R1#ping 192.168.3.5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.3.5, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/28/80 ms
R1#
 Đứng trên R2:
R2#ping 192.168.3.6
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.3.6, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/22/72 ms
R2#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 = 20/48/84 ms
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 100 percent (5/5), round-trip min/avg/max = 16/33/76 ms
R2#

BKAP-CMM @BKAP 2021 Page 8 / 18


 Đứng trên R3:
R3#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:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/31/48 ms
R3#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 100 percent (5/5), round-trip min/avg/max = 16/34/80 ms
R3#
 Đứng trên R4:
R4#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:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/37/76 ms
R4#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 = 20/36/64 ms
R4#

BKAP-CMM @BKAP 2021 Page 9 / 18


3. Thiết lập giao thức định tuyến RIP trên các router.
 Đứng trên R1:
R1#configure terminal
R1(config)#router rip
R1(config-router)#version 1
R1(config-router)#network 192.168.2.0
R1(config-router)#network 192.168.3.0
R1(config)#end
R1#
 Đứng trên R2:
R2#configure terminal
R2(config)#router rip
R2(config-router)#version 1
R2(config-router)#network 192.168.3.0
R2(config-router)#exit
R2(config)#

R2(config)#router rip
R2(config-router)#version 2
R2(config-router)#network 192.168.1.0
R2(config-router)#no auto-summary
R2(config-router)#exit
R2(config)#

BKAP-CMM @BKAP 2021 Page 10 / 18


R2(config)#interface serial 0/0
R2(config-if)#ip rip send version 1
R2(config-if)#ip rip receive version 1
R2(config-if)#exit
R2(config)#

R2(config)#interface fastEthernet 0/0


R2(config-if)#ip rip send version 1 2
R2(config-if)#ip rip receive version 1 2
R2(config-if)#end
R2#

 Đứng trên R3:


R3#configure terminal
R3(config)#router rip
R3(config-router)#version 1
R3(config-router)#network 192.168.1.0
R3(config-router)#network 192.168.0.0
R3(config-router)#end
R3#

BKAP-CMM @BKAP 2021 Page 11 / 18


 Đứng trên R4:
R4#configure terminal
R4(config)#router rip
R4(config-router)#version 2
R4(config-router)#network 192.168.1.0
R4(config-router)#network 192.168.4.0
R4(config-router)#exit
R4(config)#

R4(config)#interface fastEthernet 0/0


R4(config-if)#ip rip send version 1 2
R4(config-if)#ip rip receive version 1 2
R4(config-if)#end
R4#

4. Xem bảng định tuyến (routing table).


 Đứng trên R1:
R1#show 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

BKAP-CMM @BKAP 2021 Page 12 / 18


Gateway of last resort is not set
R 192.168.4.0/24 [120/2] via 192.168.3.5, 00:00:07, Serial0/1
R 192.168.0.0/24 [120/2] via 192.168.3.5, 00:00:07, Serial0/1
R 192.168.1.0/24 [120/1] via 192.168.3.5, 00:00:07, Serial0/1
C 192.168.2.0/24 is directly connected, Loopback0
192.168.3.0/30 is subnetted, 1 subnets
C 192.168.3.4 is directly connected, Serial0/1
R1#
 Đứng trên R2:
R2#show 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
R 192.168.4.0/24 [120/1] via 192.168.1.3, 00:00:25, FastEthernet0/0
R 192.168.0.0/24 [120/1] via 192.168.1.2, 00:00:26, FastEthernet0/0
C 192.168.1.0/24 is directly connected, FastEthernet0/0
R 192.168.2.0/24 [120/1] via 192.168.3.6, 00:00:01, Serial0/0
192.168.3.0/30 is subnetted, 1 subnets
C 192.168.3.4 is directly connected, Serial0/0
R2#

BKAP-CMM @BKAP 2021 Page 13 / 18


 Đứng trên R3:
R3#show 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
R 192.168.4.0/24 [120/1] via 192.168.1.3, 00:00:19, FastEthernet0/0
C 192.168.0.0/24 is directly connected, Loopback0
C 192.168.1.0/24 is directly connected, FastEthernet0/0
R 192.168.2.0/24 [120/2] via 192.168.1.1, 00:00:17, FastEthernet0/0
R 192.168.3.0/24 [120/1] via 192.168.1.1, 00:00:17, FastEthernet0/0
R3#

 Đứng trên R4:


R4#show 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

BKAP-CMM @BKAP 2021 Page 14 / 18


o - ODR, P - periodic downloaded static route

Gateway of last resort is not set


C 192.168.4.0/24 is directly connected, Loopback0
R 192.168.0.0/24 [120/1] via 192.168.1.2, 00:00:20, FastEthernet0/0
C 192.168.1.0/24 is directly connected, FastEthernet0/0
R 192.168.2.0/24 [120/2] via 192.168.1.1, 00:00:11, FastEthernet0/0
192.168.3.0/24 is variably subnetted, 2 subnets, 2 masks
R 192.168.3.0/24 [120/1] via 192.168.1.1, 00:00:11, FastEthernet0/0
R 192.168.3.4/30 [120/1] via 192.168.1.1, 00:00:11, FastEthernet0/0
R4#

5. Kiểm tra các router có thể ping qua lại lẫn nhau.
 Đứng trên R1:
R1#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:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/24/56 ms
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 = 16/31/52 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:

BKAP-CMM @BKAP 2021 Page 15 / 18


!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/41/76 ms
R1#ping 192.168.0.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/44/108 ms
R1#ping 192.168.4.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.4.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/31/56 ms
R1#
 Đứng trên R2:
R2#ping 192.168.2.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/19/40 ms
R2#ping 192.168.0.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/31/52 ms
R2#ping 192.168.4.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.4.1, timeout is 2 seconds:

BKAP-CMM @BKAP 2021 Page 16 / 18


!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/25/40 ms
 Đứng trên R3:
R3#ping 192.168.2.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 28/44/76 ms
R3#ping 192.168.3.6
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.3.6, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 36/58/92 ms
R3#ping 192.168.3.5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.3.5, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/40/68 ms
R3#ping 192.168.4.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.4.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/29/48 ms
R3#

BKAP-CMM @BKAP 2021 Page 17 / 18


 Đứng trên R4:
R4#ping 192.168.2.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/30/68 ms
R4#ping 192.168.3.6
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.3.6, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/33/84 ms
R4#ping 192.168.3.5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.3.5, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/38/92 ms
R4#ping 192.168.0.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/40/88 ms
R4#

BKAP-CMM @BKAP 2021 Page 18 / 18

You might also like