Giáo Trình Định Tuyến Chuyển Mạch

100 105 0
Giáo Trình Định Tuyến Chuyển Mạch

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

1 MỤC LỤC Phần – TỔNG QUAN OSI MODEL CABLE LỆNH CISCO CĂN BẢN CISCO DISCOVERY PROTOCOL 21 TELNET 26 CRACK PASSWORD 30 BACKUP VÀ RESTORE 35 Phần – ĐỊNH TUYẾN STATIC ROUTE 40 DYNAMIC ROUTING PROTOCOL RIP 48 DYNAMIC ROUTING PROTOCOL IGRP 53 DYNAMIC ROUTING PROTOCOL EIGRP 60 DYNAMIC ROUTING PROTOCOL OSPF 69 Phần – ACCESS-LIST STANDARD IP ACCESS-LIST 75 EXTENDED IP ACCESS-LIST 80 Phần – NAT 84 NAT Overload Dynamic NAT Static NAT Phần – WAN PPP 90 FRAME-RELAY 95 ISDN Phần - SWITCH SWITCH (BASIC CONFIGURE) VLAN CuuDuongThanCong.com https://fb.com/tailieudientucntt OSI MODEL: OSI Model chuẩn hóa cho chức Network Làm cho tính phức tạp network trở nên đơn giản hơn, cho phép nhà phát triển modul hóa việc thiết kế Phương pháp cho phép nhiều nhà phát triển làm việc độc lập để tạo chức riêng biệt mà hòa hợp thành thể thống cách dễ dàng (plug-and-play) Mơ hình OSI Application Giao diện người dùng Presentation Chuẩn hóa liệu Session Thiết lập, quản lý kết thúc phiên giao dịch ứng dụng Transport Cung cấp việc vận tải đảm bảo không đảm bảo Network Cung cấp việc đánh địa luận lý – định tuyến gói liệu TCP UDP SPX IP IPX Datalink Tạo frames từ bits liệu Dùng địa MAC Detect lỗi, không sửa lỗi 802.2 802.3 HDLC Physical Tín hiệu số, xung điện – truyền connectors, cable EIA/TIA V.35 Telnet HTTP ASCII JPEG Operating systems Scheduling Protocol Data Unit (PDU) sử dụng để giao tiếp lớp Encapsulation phương pháp thêm header (phần đầu) trailer (phần đuôi) data di chuyển qua lớp Phía thiết bị nhận, tiến hành gở header qua lớp (De-encapsulation) Tóm lược Mơ hình OSI:    OSI Model có lớp, chia làm phần Application (5,6,7) Data flow (1,2,34) Encapsulation trình đóng gói: liệu dịch chuyển qua lớp thêm header trailers Phía thiết bị nhận, tiến hành de-encapstulation Collision domain: Broadcast domain: CuuDuongThanCong.com 1 4 https://fb.com/tailieudientucntt 4 CABLE: Cáp xoắn đôi: Là cáp thông tin chuẩn STP/UTP Cat-5, gồm có sợi xoắn với thành đôi theo mã màu: Cam-Trắng Cam; Lục-Trắng Lục; Dương-Trắng Dương; Nâu-Trắng Nâu Hai đầu cáp nối với Jack cắm RJ-45 Tùy theo chuẩn màu đầu Jack RJ-45 mà ta phân biệt thành loại sau: STT Đôi 3 1 4 Màu sắc Chức STT Trắng Lá Lá Trắng Cam Dương Trắng Dương Cam Trắng Nâu Nâu Phát Phát Thu Chưa dùng Chưa dùng Thu Chưa dùng Chưa dùng Đôi Màu sắc Chức 3 1 4 Trắng Cam Cam Trắng Lá Dương Trắng Dương Lá Trắng Nâu Nâu Phát Phát Thu Chưa dùng Chưa dùng Thu Chưa dùng Chưa dùng Cáp thẳng (Straight-Through Cable): Hai đầu sử dụng chuẩn T568B (hoặc T568A) Sơ đồ nối dây cáp thẳng sau : Cáp chéo (Crossover Cable): Có đầu sử dụng chuẩn T568A, đầu sử dụng chuẩn T568B Sơ đồ nối dây cáp chéo sau: CuuDuongThanCong.com https://fb.com/tailieudientucntt Trường hợp sử dụng Các thiết bị mạng chia làm hai nhóm: - Nhóm 1: Hub, Switch - Nhóm 2: Các thiết bị lại (Router, Computer, …) Khi đấu nối hai thiết bị nhóm: dùng cáp chéo (crossover) Khi đấu nối hai thiết bị khác nhóm: dùng cáp thẳng (straight-through) Đối với Switchs: CuuDuongThanCong.com https://fb.com/tailieudientucntt Cáp Serial: Là cáp thông tin (data cable) có đầu nối với jack cắm DB-60, đầu nối với thiết bị DCE, đầu lại nối với thiết bị DTE Sử dụng: Nối cổng Serial Router, cổng serial Router với tổng đài số, Frame-Relay… Cáp console: hay gọi cáp Roll : Rolled-over Cable Sơ đồ nối dây cáp Console sau : Cáp console bấm lại theo sơ đồ sau: 1–8 2–7 3–6 4–5 5–4 6–3 7–2 2–1 CuuDuongThanCong.com https://fb.com/tailieudientucntt Làm quen với chế độ dòng lệnh (CLI) số lệnh router Cisco Hướng dẫn Nối cáp  Để đảm bảo an toàn thiết bị thực hành, cần phải tắt hoàn toàn nguồn điện thiết bị nối cáp Dùng cáp Console nối cổng COM1 máy PC (dùng Terminal chuyển đổi từ DB-9 sang RJ45) với cổng Console Router  Kiểm tra lại dây jack cắm đảm bảo nối chắn Đăng nhập vào router  Khởi động Windows, vào HyperTerminal  Start – Programs – Accessories – Communicatons – Hyper Terminal  Đặt tên thơng số hình  Name:  Icon: chọn biểu tượng tùy thích  Connect using: COM1 CuuDuongThanCong.com https://fb.com/tailieudientucntt Đây dạng để thơng qua máy tính cấu hình thiết bị cisco Nhưng cách thức bị động, máy tính cấu hình router Trong thực tế phòng LAB, ta thường đấu nối theo sơ đồ sau, để cấu hình router thơng qua Terminal Server Terminal Server cung cấp truy cập out-ofband, nghĩa sử dụng telnet để truy cập router thông qua cổng console hay cổng aux Termial server router có Asynchronous port nối trực tiếp với console port thiết bị router, switch CuuDuongThanCong.com https://fb.com/tailieudientucntt LỆNH CISCO CĂN BẢN: Giao diện terminal vừa khởi động router F3: 7712008+112808+595100 at 0x3000060 Restricted Rights Legend Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c) of the Commercial Computer Software - Restricted Rights clause at FAR sec 52.227-19 and subparagraph (c) (1) (ii) of the Rights in Technical Data and Computer Software clause at DFARS sec 252.227-7013 cisco Systems, Inc 170 West Tasman Drive San Jose, California 95134-1706 Cisco Internetwork Operating System Software IOS (tm) 2500 Software (C2500-I-L), Version 12.1(1)T, Copyright (c) 1986-2000 by cisco Systems, Inc Compiled Thu 16-Mar-00 16:10 by ccai Image text-base: 0x0303F64C, data-base: 0x00001000 RELEASE SOFTWARE (fc1) cisco 2500 (68030) processor (revision D) with 4096K/2048K bytes of memory Processor board ID 03874635, with hardware revision 00000000 Bridging software X.25 software, Version 3.0.0 Ethernet/IEEE 802.3 interface(s) Serial network interface(s) 32K bytes of non-volatile configuration memory 8192K bytes of processor board System flash (Read ONLY) - System Configuration Dialog Would you like to enter the initial configuration dialog? [yes/no]: n Would you like to terminate autoinstall? [yes]: Press RETURN to get started! Bấm Enter để bắt đầu vào cấu hình router 00:01:01: %IP-5-WEBINST_KILL: Terminating DNS process 00:01:07: %SYS-5-RESTART: System restarted -Cisco Internetwork Operating System Software IOS (tm) 2500 Software (C2500-I-L), Version 12.1(1)T, RELEASE SOFTWARE (fc1) Copyright (c) 1986-2000 by cisco Systems, Inc Compiled Thu 16-Mar-00 16:10 by ccai 00:01:07: %LINK-5-CHANGED: Interface Ethernet0, changed state to administratively down 00:01:07: %LINK-5-CHANGED: Interface Serial1, changed state to administratively down 00:01:08: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0, changed state to down 00:01:08: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1, changed state to down Router> CuuDuongThanCong.com https://fb.com/tailieudientucntt Bấm ? Router>? để xem trợ giúp mode có lệnh tất Router>? Exec commands: access-enable access-profile clear connect disable disconnect enable exit help lock login logout mrinfo mstat mtrace name-connection pad ping ppp resume More Create a temporary Access-List entry Apply user-profile to interface Reset functions Open a terminal connection Turn off privileged commands Disconnect an existing network connection Turn on privileged commands Exit from the EXEC Description of the interactive help system Lock the terminal Log in as a particular user Exit from the EXEC Request neighbor and version information from a multicast router Show statistics after multiple multicast traceroutes Trace reverse multicast path from destination to source Name an existing network connection Open a X.29 PAD connection Send echo messages Start IETF Point-to-Point Protocol (PPP) Resume an active network connection Vào Priviledge mode: Router>enable Router# Để quay lại user mode lệnh disable Router>enable Router# Router#disable Router> Để thoát hẳn trở khỏi chế độ dòng lệnh Router con0 is now available Press RETURN to get started Router>enable Router#logout Router con0 is now available Press RETURN to get started CuuDuongThanCong.com https://fb.com/tailieudientucntt 10 Lệnh giúp đỡ (?) hữu dụng, bạn dùng chế độ nào, Router đưa lệnh phép sử dụng ý nghĩa lệnh Ví dụ muốn đánh lệnh enable user mode để vào Priviledge mode, bạn lại quên, không nhớ rõ lệnh enable phải đánh nào, bạn cần đánh e? Router>e? enable exit Router liệt kê cho biết, mode có lệnh bắt đầu chữ e lệnh enable lệnh exit Bây giờ, bạn đánh vào : Router>en? enable Router liệt kê cho biết có lệnh mode lệnh enable, ta đánh tắt lệnh enable = en Router>en Router#  Như vậy, dấu hỏi đặt liền kề vào lệnh (khơng có khoảng trắng) cho ta biết lệnh có mode bắt đầu chữ trước ? Tại priviledg mode, ví dụ bạn muốn xem tiếp phần lệnh show, bạn gõ : Router#show ? access-expression access-lists accounting adjacency aliases arp async List access expression List access lists Accounting data for active sessions Adjacent nodes Display alias commands ARP table Information on terminal lines used as router cops debugging More— traffic-shape users version vtemplate whoami x25 x29 COPS information State of each debugging option traffic rate shaping configuration Display information about terminal lines System hardware and software status Virtual Template interface information Info on current tty line X.25 information X.29 information router liệt kê cho ta thấy tất sub-comand theo sau lệnh show, bạn lưu ý có sub-command version, dùng để xem tình trạng hardware software CuuDuongThanCong.com https://fb.com/tailieudientucntt 86 private Net from ISP 203.162.Z.0/24 giả lập NET_ID mà ISP cung cấp cho khách hàng Sau cấu hình xong số ip add, router phải hoạt động sau:  R_B ping R_C S0 R_A R_B#p 192.168.1.3 Type escape sequence to abort Sending 5, 100-byte ICMP Echos to 192.168.1.3, timeout is seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 4/4/4 ms R_B#p 210.10.1.1 Type escape sequence to abort Sending 5, 100-byte ICMP Echos to 210.10.1.1, timeout is seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 28/31/32 ms  R_C khơng thể ping S0 R_B thiếu thông số bảng routing, hiển nhiên không ping S0 R_A R_C#p 210.10.1.2 Type escape sequence to abort Sending 5, 100-byte ICMP Echos to 210.10.1.2, timeout is seconds: Success rate is percent (0/5) R_C#p 210.10.1.1 Type escape sequence to abort Sending 5, 100-byte ICMP Echos to 210.10.1.1, timeout is seconds: Success rate is percent (0/5)  R_B không ping LOO R_A lý tương tự R_B#p 65.5.1.1 Type escape sequence to abort Sending 5, 100-byte ICMP Echos to 65.5.1.1, timeout is seconds: Success rate is percent (0/5) Cấu hình R_A, R_B R_C để router có khả routing bình thường:  R_C đặt default route R_B R_C#conf t R_C(config)#ip route 0.0.0.0 0.0.0.0 192.168.1.2  R_B đặt default route R_A R_B#conf t R_B(config)#ip route 0.0.0.0 0.0.0.0 210.10.1.1  R_A đặt static route cho NET_ID 203.162.Z.0/24 R_A#conf t R_A(config)#ip route 203.162.1.0 255.255.255.0 s0 Sau làm xong bước router hoạt động sau:  R_C ping S0 R_B lúc R_C có default gateway R_B CuuDuongThanCong.com https://fb.com/tailieudientucntt 87 R_C#p 210.10.1.2 Type escape sequence to abort Sending 5, 100-byte ICMP Echos to 210.10.1.2, timeout is seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 4/4/4 ms  R_B ping LOO R_A R_B#p 65.5.1.1 Type escape sequence to abort Sending 5, 100-byte ICMP Echos to 65.5.1.1, timeout is seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 28/31/32 ms  R_A ping E0 R_B lẫn R_C địa private address, địa khơng nhìn thấy Internet R_A#p 192.168.1.3 Type escape sequence to abort Sending 5, 100-byte ICMP Echos to 192.168.1.3, timeout is seconds: Success rate is percent (0/5)  Hệ tất yếu R_C khơng có khả liên lạc với S0 LOO R_A khơng phải R_C R_B khơng routing mà R_A đường gửi trả lời packet R_C#p 210.10.1.1 Type escape sequence to abort Sending 5, 100-byte ICMP Echos to 210.10.1.1, timeout is seconds: Success rate is percent (0/5) R_C#p 65.5.1.1 Type escape sequence to abort Sending 5, 100-byte ICMP Echos to 65.5.1.1, timeout is seconds: Success rate is percent (0/5) CÙNG LÚC ĐÓ R_A#debug ip icmp ICMP packet debugging is on R_A# 01:50:07: ICMP: echo reply sent, 01:50:09: ICMP: echo reply sent, 01:50:11: ICMP: echo reply sent, 01:50:13: ICMP: echo reply sent, 01:50:15: ICMP: echo reply sent, 01:50:21: ICMP: echo reply sent, 01:50:23: ICMP: echo reply sent, 01:50:25: ICMP: echo reply sent, 01:50:27: ICMP: echo reply sent, 01:50:29: ICMP: echo reply sent, src src src src src src src src src src 210.10.1.1, dst 192.168.1.3 210.10.1.1, dst 192.168.1.3 210.10.1.1, dst 192.168.1.3 210.10.1.1, dst 192.168.1.3 210.10.1.1, dst 192.168.1.3 65.5.1.1, dst 192.168.1.3 65.5.1.1, dst 192.168.1.3 65.5.1.1, dst 192.168.1.3 65.5.1.1, dst 192.168.1.3 65.5.1.1, dst 192.168.1.3 Muốn R_C liên lạc với số IP bên ngoài, thực Dynamic NAT R_B Có thể thực theo hai cách: CuuDuongThanCong.com https://fb.com/tailieudientucntt 88 PAT gọi Overloading: R_B(config)#int s R_B(config-if)#ip nat outside R_B(config-if)#int e R_B(config-if)#ip nat inside R_B(config-if)#exit R_B(config)#access-list per 192.168.1.0 0.0.0.255 R_B(config)#ip nat inside source list int s0 overload Sau thực câu lệnh R_B, R_C có khả liên lạc với R_A R_C#p 210.10.1.1 Type escape sequence to abort Sending 5, 100-byte ICMP Echos to 210.10.1.1, timeout is seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 40/40/44 ms R_C#p 65.5.1.1 Type escape sequence to abort Sending 5, 100-byte ICMP Echos to 65.5.1.1, timeout is seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 40/40/40 ms Trong thời điểm R_A# 01:53:28: 01:53:28: 01:53:28: 01:53:28: 01:53:28: R_A# 01:53:29: 01:53:29: 01:53:29: 01:53:29: 01:53:29: ICMP: ICMP: ICMP: ICMP: ICMP: echo echo echo echo echo reply reply reply reply reply sent, sent, sent, sent, sent, src src src src src 210.10.1.1, 210.10.1.1, 210.10.1.1, 210.10.1.1, 210.10.1.1, ICMP: ICMP: ICMP: ICMP: ICMP: echo echo echo echo echo reply reply reply reply reply sent, sent, sent, sent, sent, src src src src src 65.5.1.1, 65.5.1.1, 65.5.1.1, 65.5.1.1, 65.5.1.1, R_B#sh ip nat trans Pro Inside global Inside local icmp 210.10.1.2:5777 192.168.1.3:5777 icmp 210.10.1.2:5778 192.168.1.3:5778 icmp 210.10.1.2:5779 192.168.1.3:5779 icmp 210.10.1.2:5780 192.168.1.3:5780 icmp 210.10.1.2:5781 192.168.1.3:5781 icmp 210.10.1.2:6551 192.168.1.3:6551 icmp 210.10.1.2:6552 192.168.1.3:6552 icmp 210.10.1.2:6553 192.168.1.3:6553 icmp 210.10.1.2:6554 192.168.1.3:6554 icmp 210.10.1.2:6555 192.168.1.3:6555 dst dst dst dst dst dst dst dst dst dst Outside local 65.5.1.1:5777 65.5.1.1:5778 65.5.1.1:5779 65.5.1.1:5780 65.5.1.1:5781 210.10.1.1:6551 210.10.1.1:6552 210.10.1.1:6553 210.10.1.1:6554 210.10.1.1:6555 210.10.1.2 210.10.1.2 210.10.1.2 210.10.1.2 210.10.1.2 210.10.1.2 210.10.1.2 210.10.1.2 210.10.1.2 210.10.1.2 Outside global 65.5.1.1:5777 65.5.1.1:5778 65.5.1.1:5779 65.5.1.1:5780 65.5.1.1:5781 210.10.1.1:6551 210.10.1.1:6552 210.10.1.1:6553 210.10.1.1:6554 210.10.1.1:6555 Dynamic NAT Trong trường hợp tổng qt hơn, cấu hình NAT số IP ISP cung cấp cho khách hàng Điều cho phép mở rộng thêm khả hoạt động NAT Trong sơ đồ NET 203.162.Z.0/24 số IP ISP cung cấp, ta cấu hình NAT 10 số (203.162.Z.1-203.162.Z.10) thực lệnh sau R_B: R_B#cle ip nat trans * R_B#conf t R_B(config)#no ip nat inside source list int s0 overload R_B(config)#ip nat pool abc 203.162.1.1 203.162.1.10 netmask 255.255.255.0 CuuDuongThanCong.com https://fb.com/tailieudientucntt 89 R_B(config)#ip nat inside source list pool abc overload R_C#p 210.10.1.1 Type escape sequence to abort Sending 5, 100-byte ICMP Echos to 210.10.1.1, timeout is seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 40/40/44 ms R_C#p 65.5.1.1 Type escape sequence to abort Sending 5, 100-byte ICMP Echos to 65.5.1.1, timeout is seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 40/40/40 ms R_A# 01:56:01: 01:56:01: 01:56:01: 01:56:01: 01:56:02: R_A# 01:56:04: 01:56:04: 01:56:04: 01:56:04: 01:56:04: ICMP: ICMP: ICMP: ICMP: ICMP: echo echo echo echo echo reply reply reply reply reply sent, sent, sent, sent, sent, src src src src src 210.10.1.1, 210.10.1.1, 210.10.1.1, 210.10.1.1, 210.10.1.1, ICMP: ICMP: ICMP: ICMP: ICMP: echo echo echo echo echo reply reply reply reply reply sent, sent, sent, sent, sent, src src src src src 65.5.1.1, 65.5.1.1, 65.5.1.1, 65.5.1.1, 65.5.1.1, R_B#sh ip nat trans Pro Inside global icmp 203.162.1.1:4358 icmp 203.162.1.1:4359 icmp 203.162.1.1:4360 icmp 203.162.1.1:4361 icmp 203.162.1.1:4362 icmp 203.162.1.1:9058 icmp 203.162.1.1:9059 icmp 203.162.1.1:9060 icmp 203.162.1.1:9061 icmp 203.162.1.1:9062 Inside local 192.168.1.3:4358 192.168.1.3:4359 192.168.1.3:4360 192.168.1.3:4361 192.168.1.3:4362 192.168.1.3:9058 192.168.1.3:9059 192.168.1.3:9060 192.168.1.3:9061 192.168.1.3:9062 dst dst dst dst dst dst dst dst dst dst 203.162.1.1 203.162.1.1 203.162.1.1 203.162.1.1 203.162.1.1 203.162.1.1 203.162.1.1 203.162.1.1 203.162.1.1 203.162.1.1 Outside local 65.5.1.1:4358 65.5.1.1:4359 65.5.1.1:4360 65.5.1.1:4361 65.5.1.1:4362 210.10.1.1:9058 210.10.1.1:9059 210.10.1.1:9060 210.10.1.1:9061 210.10.1.1:9062 Outside global 65.5.1.1:4358 65.5.1.1:4359 65.5.1.1:4360 65.5.1.1:4361 65.5.1.1:4362 210.10.1.1:9058 210.10.1.1:9059 210.10.1.1:9060 210.10.1.1:9061 210.10.1.1:9062 Trong trường hợp R_C giả lập WEB server, để truy cập PC khác Internet phải có địa IP hợp lệ (số IP mà ISP cung cấp) Ta dùng static NAT để thực công việc này: R_B#conf t R_B(config)#no ip nat inside source list pool abc overload R_B(config)#ip nat inside source static 192.168.1.3 203.162.1.100 R_B(config)#end R_B#wr R_B#reload // LƯU Ý: SAU KHI THỰC HIỆN XONG CẤU HÌNH STATIC NAT PHẢI RELOAD LẠI ROUTER ĐỂ CẤU HÌNH MỚI CĨ TÁC DỤNG.// R_B#sh ip nat tran Pro Inside global - 203.162.1.100 Inside local 192.168.1.3 Outside local - Outside global - Tại R_A IP Internet, ta truy cập vào R_C số 203.162.Z.100 R_A#p 203.162.1.100 CuuDuongThanCong.com https://fb.com/tailieudientucntt 90 Type escape sequence to abort Sending 5, 100-byte ICMP Echos to 203.162.1.100, timeout is seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 36/37/40 ms R_A#telnet 203.162.1.100 Trying 203.162.1.100 Open R_C>exit [Connection to 203.162.1.100 closed by foreign host] R_A#conf t Enter configuration commands, one per line End with CNTL/Z R_A(config)#ip telnet source-interface loo R_A(config)#^Z R_A#telnet 203.162.1.100 Trying 203.162.1.100 Open R_C>exit [Connection to 203.162.1.100 closed by foreign host] R_A# Tại R_C ta lại thấy R_A gửi packet trực tiếp đến địa 192.168.Z.3 Đó R_B đổi số IP đích đến từ số 203.162.Z.100 thành 192.168.Z.3 R_C#deb ip packet IP packet debugging is on R_C# 01:13:56: IP: s=210.10.1.1 (Ethernet0), d=192.168.1.3 (Ethernet0), len 44, rcvd 01:13:56: IP: s=192.168.1.3 (local), d=210.10.1.1 (Ethernet0), len 44, sending 01:13:56: IP: s=210.10.1.1 (Ethernet0), d=192.168.1.3 (Ethernet0), len 40, rcvd 01:13:56: IP: s=210.10.1.1 (Ethernet0), d=192.168.1.3 (Ethernet0), len 49, rcvd 01:13:56: IP: s=210.10.1.1 (Ethernet0), d=192.168.1.3 (Ethernet0), len 40, rcvd 01:13:56: IP: s=192.168.1.3 (local), d=210.10.1.1 (Ethernet0), len 52, sending 01:13:56: IP: s=192.168.1.3 (local), d=210.10.1.1 (Ethernet0), len 46, sending 01:13:56: IP: s=192.168.1.3 (local), d=210.10.1.1 (Ethernet0), len 43, sending R_C# R_C# 01:15:45: IP: s=65.5.1.1 (Ethernet0), d=192.168.1.3 (Ethernet0), len 44, rcvd 01:15:45: IP: s=192.168.1.3 (local), d=65.5.1.1 (Ethernet0), len 44, sending 01:15:45: IP: s=65.5.1.1 (Ethernet0), d=192.168.1.3 (Ethernet0), len 40, rcvd 01:15:45: IP: s=65.5.1.1 (Ethernet0), d=192.168.1.3 (Ethernet0), len 49, rcvd 01:15:45: IP: s=65.5.1.1 (Ethernet0), d=192.168.1.3 (Ethernet0), len 40, rcvd 01:15:45: IP: s=192.168.1.3 (local), d=65.5.1.1 (Ethernet0), len 52, sending 01:15:45: IP: s=192.168.1.3 (local), d=65.5.1.1 (Ethernet0), len 46, sending 01:15:45: IP: s=192.168.1.3 (local), d=65.5.1.1 (Ethernet0), len 43, sending 01:15:45: IP: s=65.5.1.1 (Ethernet0), d=192.168.1.3 R_C# Bài tập thực hành mở rộng : Kết nối tất router nhóm khác lại thành hệ thống lớn Tất router nhóm đổi tên router sau: R_A_NZ, R_B_NZ, R_C_NZ Z số nhóm bạn Cấu hình Dynamic Routing router R_A_NZ, lúc tất router có khả liên lạc với tất router nhóm khác Ví dụ: để telnet vào R_C_NZ nhóm khác, ta telnet vào số 203.162.Z.100 CuuDuongThanCong.com https://fb.com/tailieudientucntt 3 3 91 PPP: Sơ đồ nối dây địa IP Trong lab yêu cầu bạn thực trước câu lệnh phần XĨA CẤU HÌNH ROUTER trang 19, sau thực tiếp phần TÓM TẮT trang17 Lưu ý đặt số IP ADD theo sơ đồ Hạn chế tham khảo tài liệu thực lệnh cũ Trong LAB yêu cầu hai router thực hiện, kết trích dẫn thực hai router RA RB Làm tương tự RA RC Đặt địa IP cho Router RA RA(config)#INT S0 RA(config-if)#ip add 192.168.1.1 255.255.255.0 RA(config-if)#clo 64000 RA(config-if)#no shut RA(config-if)#int s RA(config-if)#ip add 192.168.2.1 255.255.255.0 RA(config-if)#clo 64000 RA(config-if)#no shut Đặt địa IP cho Router RB RB(config)#int s0 RB(config-if)#ip add 192.168.1.2 255.255.255.0 RB(config-if)#no shut Theo default, interface Router Cisco đóng gói theo HDLC CuuDuongThanCong.com https://fb.com/tailieudientucntt 92 RA#sh int s Serial0 is up, line protocol is up Hardware is HD64570 Internet address is 192.168.1.1/24 MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec, rely 255/255, load 1/255 Encapsulation HDLC, loopback not set, keepalive set (10 sec) Last input 00:00:05, output 00:00:02, output hang never Last clearing of "show interface" counters never RB#sh int s0 Serial0 is up, line protocol is up Hardware is HD64570 Internet address is 192.168.1.2/24 MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec, rely 255/255, load 1/255 Encapsulation HDLC, loopback not set, keepalive set (10 sec) Last input 00:00:00, output 00:00:06, output hang never Last clearing of "show interface" counters never Input queue: 0/75/0 (size/max/drops); Total output drops: Queueing strategy: weighted fair Output queue: 0/64/0 (size/threshold/drops) Conversations 0/1 (active/max active) RB#p 192.168.1.1 Type escape sequence to abort Sending 5, 100-byte ICMP Echoes to 192.168.1.1, timeout is seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 28/30/32 ms RB# Thơng thường, để tương thích hòan tòan với lọai router khác nhau, người ta thường chuyển sang sử dụng PPP thay cho HDLC RA(config)#int s0 RA(config-if)#encapsulation ppp Ngay sau vừa chuyển sang sử dụng PPP cho interface s0 RA, RA khơng thể liên lạc RB, RB đóng gói HDLC, ta kiểm tra cách từ RB ping thử RA: RB#ping 192.168.1.1 Type escape sequence to abort Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is seconds: Success rate is percent (0/5) RA#sh int s Serial0 is up, line protocol is down Hardware is HD64570 Internet address is 192.168.1.1/24 MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec, rely 255/255, load 1/255 Encapsulation PPP, loopback not set, keepalive set (10 sec) LCP REQsent Closed: ipcp, cdp Last input 00:00:03, output 00:00:01, output hang never Last clearing of "show interface" counters never Input queue: 0/75/0 (size/max/drops); Total output drops: CuuDuongThanCong.com https://fb.com/tailieudientucntt 93 Queueing strategy: weighted fair Output queue: 0/64/0 (size/threshold/drops) Conversations 0/2 (active/max active) Reserved Conversations 0/0 (allocated/max allocated) minute input rate bits/sec, packets/sec minute output rate bits/sec, packets/sec 34 packets input, 3197 bytes, no buffer Received 28 broadcasts, runts, giants input errors, CRC, frame, overrun, ignored, abort Bây giờ, ta đóng gói PPP cho interface s0 RB: RB(config)#int s RB(config-if)#encap ppp RB#sh int s0 Serial0 is up, line protocol is up Hardware is HD64570 Internet address is 192.168.1.2/24 MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec, rely 255/255, load 1/255 Encapsulation PPP, loopback not set, keepalive set (10 sec) LCP Open Open: ipcp, cdp Last input 00:00:02, output 00:00:02, output hang never Last clearing of "show interface" counters never Input queue: 0/75/0 (size/max/drops); Total output drops: Queueing strategy: weighted fair Output queue: 0/64/0 (size/threshold/drops) RB#p 192.168.1.2 Type escape sequence to abort Sending 5, 100-byte ICMP Echoes to 192.168.1.2, timeout is seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 56/57/60 ms Phương pháp đóng gói PPP có nhiều lựa chọn thêm cho cấu hình, có phầm lựa chọn phương thức chứng thực: RA(config) #int s0 RA(config-if)#ppp authentication chap RB(config)#int s0 RB(config-if)#ppp authentication chap Lúc này, RA RB chưa làm việc với được, chưa có username password để chứng thực lẫn nhau: Kiểm tra lệnh debug ppp authentication RA# PPP PPP PPP PPP RA# PPP PPP PPP PPP RA# Serial0: Serial0: Serial0: Serial0: Send CHAP challenge id=7 to remote CHAP challenge from RB USERNAME RB not found Unable to authenticate for peer Serial0: Serial0: Serial0: Serial0: Send CHAP challenge id=8 to remote CHAP challenge from RB USERNAME RB not found Unable to authenticate for peer CuuDuongThanCong.com https://fb.com/tailieudientucntt 94 Tạo username RB RA với password là: nhatnghe tạo username RA RB với password nhatnghe (password phải giống bên bắt buộc) RA#conf t RA#username RB password nhatnghe RB#conf t RB#username RA password nhatnghe RA# %LINK-3-UPDOWN: Interface Serial0, changed state to up PPP Serial0: Send CHAP challenge id=36 to remote PPP Serial0: CHAP challenge from RB PPP Serial0: CHAP response id=36 received from RB PPP Serial0: Send CHAP success id=36 to remote PPP Serial0: remote passed CHAP authentication PPP Serial0: Passed CHAP authentication with remote RA# %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0, changed state to up RA# Ping kiểm tra thử RA#ping 192.168.1.2 Type escape sequence to abort Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 28/31/32 ms Để tiết kiệm băng thông, PPP cho phép tiến hành nén liệu trước truyền đi, giải nén liệu nhận Để nén, dùng lệnh : compress stac Cấu hình compress cho RA, ping thử vài lần đến RB, sau dùng lệnh show compress để xem thống kê việc nén, giải nén, ta thấy tỉ lệ bên RB chưa khai báo compress: RA(config-if)#compress stac RA# 00:40:14: %SYS-5-CONFIG_I: Configured from console by console R13#ping 192.168.1.2 Type escape sequence to abort Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 28/30/32 ms R13#ping 192.168.1.2 Type escape sequence to abort Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 28/30/32 ms R13#ping 192.168.1.2 Type escape sequence to abort Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is seconds: !!!!! CuuDuongThanCong.com https://fb.com/tailieudientucntt 95 Success rate is 100 percent (5/5), round-trip min/avg/max = 28/30/32 ms RA#sho compress Serial0 Software compression enabled uncompressed bytes xmt/rcv 0/0 avg ratio xmt/rcv 0.000/0.000 avg ratio xmt/rcv 0.000/0.000 10 avg ratio xmt/rcv 0.000/0.000 no bufs xmt no bufs rcv resyncs Additional Stacker Stats: Transmit bytes: Uncompressed = Compressed = Received bytes: Compressed = Uncompressed = Khai báo compress cho RB: RB(config)#int s0 RB(config-if)#compress stac RB(config-if)#shut RB(config-if)#no shut RB#ping 192.168.1.1 Type escape sequence to abort Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 28/31/32 ms RB#ping 192.168.1.1 Type escape sequence to abort Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 28/31/32 ms RB#ping 192.168.1.1 Type escape sequence to abort Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 28/31/32 ms RB#sho compress Serial0 Software compression enabled uncompressed bytes xmt/rcv 3156/3176 avg ratio xmt/rcv 3.067/2.810 avg ratio xmt/rcv 0.871/0.928 10 avg ratio xmt/rcv 0.871/0.928 no bufs xmt no bufs rcv resyncs Additional Stacker Stats: Transmit bytes: Uncompressed = Compressed = 766 Received bytes: Compressed = 814 Uncompressed = CuuDuongThanCong.com https://fb.com/tailieudientucntt 96 FRAME RELAY: Sơ đồ nối dây địa IP Trong lab yêu cầu bạn thực trước câu lệnh phần XĨA CẤU HÌNH ROUTER trang 19, sau thực tiếp phần TĨM TẮT trang17 Lưu ý đặt số IP ADD theo sơ đồ Hạn chế tham khảo tài liệu thực lệnh cũ Trong sơ đồ này, RA làm nhiệm vụ giả lập môi trường truyên thông FRAME RELAY Cấu hình để Router RA làm nhiệm vụ Frame-relay Switch: RA(config)#frame-relay switching RA(config)#int s0 RA(config-if)#no ip address RA(config-if)#clock rate 64000 RA(config-if)#encapsulation frame-relay RA(config-if)#no shut RA(config-if)#frame-relay lmi-type cisco RA(config-if)#frame-relay intf-type dce RA(config-if)#frame-relay route 500 int s1 600 RA(config)#int s1 RA(config-if)#no ip add RA(config-if)#clock rate 64000 RA(config-if)#encapsulation frame-relay RA(config-if)#no shut RA(config-if)#frame-relay lmi-type ansi RA(config-if)#frame-relay intf-type dce RA(config-if)#frame-relay route 600 int s0 500 CuuDuongThanCong.com https://fb.com/tailieudientucntt 97 Cấu hình Router RB với DLCI=500, LMI=cisco: Khai báo phương thức đóng gói Fram-relay RB(config-if)#int s0 RB(config-if)#ip add 192.168.10.1 255.255.255.0 RB(config-if)#encapsulation frame-relay RB(config-if)#no shut RC(config-if)#int s1 RC(config-if)#ip add 192.168.10.2 255.255.255.0 RC(config-if)#encapsulation frame-relay RC(config-if)#no shut Xem frame-relay map tại, Dynamic invert ARP hỗ trợ: RB#sh fram pvc map Serial1 (up): ip 192.168.10.2 dlci 500(0x258,0x9480), dynamic, broadcast,, status defined, active RC#sh fram pvc map Serial1 (up): ip 192.168.10.1 dlci 600(0x258,0x9480), dynamic, broadcast,, status defined, active RC#ping 192.168.10.1 Type escape sequence to abort Sending 5, 100-byte ICMP Echos to 192.168.10.1, timeout is seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 60/60/60 ms Trong trường hợp ISP không cho phép Invert ARP hoạt động, phải dùng lệnh Map IP hai đầu kết nối: RB(config)#int s0 RB(config-if)#frame-relay map ip 192.168.10.2 500 RC(config)#int s1 RC(config-if)#frame-relay map ip 192.168.10.1 600 Xem frame-relay map lại static, sau đánh lệnh frame-relay map: RB#sh fram pvc map Serial1 (up): ip 192.168.10.2 dlci 500(0x258,0x9480), CISCO, status defined, active static, RC#sh fram pvc map Serial1 (up): ip 192.168.10.1 dlci 600(0x258,0x9480), CISCO, status defined, active static, Trong trường hợp này, ta thấy khơng có tham số broadcast loại tín hiệu broadcast không gửi đường truyền này, để thử trương hợp xảy ra, ta cấu hình router RB RC dùng RIP để routing, nhận thấy router routing RB(config)#int loo RB(config-if)#ip add 192.168.9.9 255.255.255.0 RB(config-if)#exit RB(config)#router rip RB(config-router)#net 192.168.10.0 RB(config-router)#net 192.168.9.0 RB(config-router)#^Z CuuDuongThanCong.com https://fb.com/tailieudientucntt 98 RC(config)#int loop1 RC(config-if)#ip add 192.168.7.7 255.255.255.0 RB(config)#router rip RB(config-router)#net 192.168.10.0 RB(config-router)#net 192.168.7.0 RB(config-router)#^Z Ping RB kiểm tra thử: RC#ping 192.168.10.1 Type escape sequence to abort Sending 5, 100-byte ICMP Echos to 192.168.10.1, timeout is seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 60/60/60 ms Do khơng làm việc với tín hiệu broadcast nên không nhân quảng báo Routing table từ Router RB qua: Dùng lệnh debug ip rip: không thấy nhận broadcast show ip route: NET_ID router khác: RC#debug ip rip RIP protocol debugging is on RC# 01:18:52: RIP: sending v1 update to 255.255.255.255 (192.168.7.7) 01:18:52: RIP: build update entries 01:18:52: network 192.168.10.0 metric 01:18:52: RIP: sending v1 update to 255.255.255.255 (192.168.10.2) 01:18:52: RIP: build update entries 01:18:52: network 192.168.7.0 metric 01:18:52: subnet 192.168.10.0 metric RC#sh ip 01:19:20: RIP: sending v1 update to 255.255.255.255 (192.168.7.7) 01:19:20: RIP: build update entries 01:19:20: network 192.168.10.0 metric 01:19:20: RIP: sending v1 update to 255.255.255.255 (192.168.10.2) 01:19:20: RIP: build update entries 01:19:20: network 192.168.7.0 metric 01:19:20: subnet 192.168.10.0 metric via Loopback1 via Serial1 via Loopback1 via Serial1 RC#sh 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 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, 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 C C 192.168.10.0/24 is directly connected, Serial1 192.168.7.0/24 is directly connected, Loopback1 Cho phép broadcast Router RB RC: CuuDuongThanCong.com https://fb.com/tailieudientucntt 99 RB(config)#int s RB(config-if)#frame-re map ip 192.168.10.2 500 broadcast RC(config)#int s RC(config-if)#frame map ip 192.168.10.1 600 broadcast Ngay bên nhận broadcast  update routing table: Router RB: 01:19:45: RIP: received v1 update from 192.168.10.2 on Serial0 01:19:45: 192.168.7.0 in hops 01:19:45: 192.168.10.0 in hops 01:19:47: RIP: sending v1 flash update to 255.255.255.255 via Loopback1 (192.168.9.9) 01:19:47: RIP: build flash update entries 01:19:47: network 192.168.7.0 metric 01:19:47: RIP: sending v1 flash update to 255.255.255.255 via Serial0 (192.168.10.1) 01:19:47: RIP: build flash update entries 01:19:47: network 192.168.7.0 metric 01:20:01: RIP: sending v1 update to 255.255.255.255 via Loopback1 (192.168.9.9) 01:20:01: RIP: build update entries 01:20:01: network 192.168.7.0 metric 01:20:01: network 192.168.10.0 metric 01:20:01: RIP: sending v1 update to 255.255.255.255 via Serial0 (192.168.10.1) 01:20:01: RIP: build update entries 01:20:01: network 192.168.7.0 metric 01:20:01: network 192.168.9.0 metric 01:20:01: subnet 192.168.10.0 metric RB# 01:20:03: RIP: received v1 update from 192.168.10.2 on Serial0 01:20:03: 192.168.9.0 in hops 01:20:11: RIP: received v1 update from 192.168.10.2 on Serial0 01:20:11: 192.168.7.0 in hops 01:20:11: 192.168.9.0 in hops 01:20:11: 192.168.10.0 in hops RB#sh 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 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, 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 C C R 192.168.9.0/24 is directly connected, Loopback1 192.168.10.0/24 is directly connected, Serial0 192.168.7.0/24 [120/1] via 192.168.10.2, 00:00:03, Serial0 CuuDuongThanCong.com https://fb.com/tailieudientucntt 100 Router RC: 01:19:45: RIP: sending v1 update to 255.255.255.255 via Loopback1 (192.168.7.7) 01:19:45: RIP: build update entries 01:19:45: network 192.168.10.0 metric 01:19:45: RIP: sending v1 update to 255.255.255.255 via Serial1 (192.168.10.2) 01:19:45: RIP: build update entries 01:19:45: network 192.168.7.0 metric 01:19:45: subnet 192.168.10.0 metric RC(config-if)# 01:19:48: RIP: received v1 update from 192.168.10.1 on Serial1 01:19:48: 192.168.7.0 in hops RC(config-if)#^Z RC# 01:19:57: %SYS-5-CONFIG_I: Configured from console by console RC# 01:20:01: RIP: received v1 update from 192.168.10.1 on Serial1 01:20:01: 192.168.7.0 in hops 01:20:01: 192.168.9.0 in hops 01:20:01: 192.168.10.0 in hops RC# 01:20:03: RIP: sending v1 flash update to 255.255.255.255 via Loopback1 (192.168.7.7) 01:20:03: RIP: build flash update entries 01:20:03: network 192.168.9.0 metric 01:20:03: RIP: sending v1 flash update to 255.255.255.255 via Serial1 (192.168.10.2) 01:20:03: RIP: build flash update entries 01:20:03: network 192.168.9.0 metric RC# RC#sh 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 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, 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 C C 192.168.9.0/24 [120/1] via 192.168.10.1, 00:00:07, Serial1 192.168.10.0/24 is directly connected, Serial1 192.168.7.0/24 is directly connected, Loopback1 Có thể xem lại: RC#sh fram map Serial1 (up): ip 192.168.10.1 dlci 600(0x258,0x9480), static, broadcast, CISCO, status defined, active CuuDuongThanCong.com https://fb.com/tailieudientucntt ... Transport Cung cấp việc vận tải đảm bảo không đảm bảo Network Cung cấp việc đánh địa luận lý – định tuyến gói liệu TCP UDP SPX IP IPX Datalink Tạo frames từ bits liệu Dùng địa MAC Detect lỗi, không... Model có lớp, chia làm phần Application (5,6,7) Data flow (1,2,34) Encapsulation q trình đóng gói: liệu dịch chuyển qua lớp thêm header trailers Phía thiết bị nhận, tiến hành de-encapstulation... dụng để giao tiếp lớp Encapsulation phương pháp thêm header (phần đầu) trailer (phần đuôi) data di chuyển qua lớp Phía thiết bị nhận, tiến hành gở header qua lớp (De-encapsulation) Tóm lược Mơ hình

Ngày đăng: 17/12/2019, 00:12

Tài liệu cùng người dùng

Tài liệu liên quan