GIÁO TRÌNH CCNA PHẦN 4

28 206 0
GIÁO TRÌNH CCNA   PHẦN 4

Đ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

CCNA Tài liӋu dành cho hӑc viên Ph̿n : ACCESS LIST NAT BÀI 21: STANDAR ACCESS LIST Giӟi thiӋu: -Mӝt nhӳng công cө rҩt quan trӑng Cisco Router ÿѭӧc dùng lƭnh vӵc security Access List Ĉây mӝt tính giúp bҥn có thӇ cҩu hình trӵc tiӃp Router ÿӇ tҥo mӝt danh sách ÿӏa chӍ mà bҥn có thӇ cho phép hay ngăn cҧn viӋc truy cұp vào mӝt ÿӏa chӍ ÿó -Access List có loҥi Standard Access List Extended Access List -Standard Access List: ÿұy loҥi danh sách truy cұp mà cho phép hay ngăn cҧn viӋc truy cұp,Router chӍ kiӇm tra mӝt yӃu tӕ nhҩt ÿӏa chӍ nguӗn(Source Address) -Extended Access List: ÿây loҥi danh sách truy cұp mӣ rӝng hѫn so vӟi loҥi Stanhdar,các yӃu tӕ vӅ ÿӏa chӍ nguӗn, ÿӏa chӍ ÿích,giao thӭc,port sӁ ÿѭӧc kiӇm tra trѭӟc Router cho phép viӋc truy nhұp hay ngăn cҧn Mô tҧ lab ÿӗ hình : -Bài Lab giúp bҥn thӵc hiӋn viӋc cҩu hình Standard Access List cho Cisco Router vӟi mөc ÿích ngăn không cho host truy cұp ÿӃn router VSIC2 Cҩu hình router : Router Vsic1 Vsic1#show run VSIC Education Corporation Trang 136 CCNA Tài liӋu dành cho hӑc viên Building configuration Current configuration: ! version 12.0 service timestamps debug uptime service timestamps log uptime no service password-encryption ! hostname Vsic1 ! ip subnet-zero ! process-max-time 200 ! interface Ethernet0 ip address 11.0.0.1 255.255.255.0 no ip directed-broadcast ! interface Serial0 ip address 192.168.1.1 255.255.255.0 no ip directed-broadcast ! interface Serial1 no ip address no ip directed-broadcast shutdown ! ip classless no ip http server ! line transport input none line line aux line vty ! end Router Vsic2 Vsic2#show run Building configuration Current configuration: ! version 12.1 service timestamps debug uptime VSIC Education Corporation Trang 137 CCNA Tài liӋu dành cho hӑc viên service timestamps log uptime no service password-encryption ! hostname Vsic2 ! ip subnet-zero ! interface Ethernet0 no ip address shutdown ! interface Serial0 ip address 192.168.1.2 255.255.255.0 clockrate 56000 ! interface Serial1 no ip address shutdown ! ip classless no ip http server ! line transport input none line line aux line vty ! end Host: IP Address:11.0.0.2 Subnet mask:255.255.255.0 Gateway:11.0.0.1 -Bҥn thӵc hiӋn viӋc ÿӏnh tuyӃn cho Router nhѭ sau(Dùng giao thӭc RIP): Vsic1(config)#router rip Vsic1(config-router)#net 192.168.1.0 Vsic1(config-router)#net 11.0.0.0 Vsic2(config)#router rip Vsic2(config-router)#net 192.168.1.0 Vsic2(config-router)#net 10.0.0.0 -Bҥn thӵc hiӋn kiӇm tra trình ÿӏnh tuyӃn: Vsic2#ping 192.168.1.1 VSIC Education Corporation Trang 138 CCNA Tài liӋu dành cho hӑc viên 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 = 32/34/36 ms Vsic2#ping 11.0.0.1 Type escape sequence to abort Sending 5, 100-byte ICMP Echos to 11.0.0.1, timeout is seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 32/34/36 ms Vsic2#ping 11.0.0.2 Type escape sequence to abort Sending 5, 100-byte ICMP Echos to 11.0.0.2, timeout is seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 32/34/40 ms -Sau trình ÿӏnh tuyӃn,kiӇm tra chҳc chҳn rҵng mҥng ÿã ÿѭӧc thông,bҥn thӵc hiӋn viӋc tҥo Access List Standar ÿӇ ngăn không cho Router Vsic ping vào Host Vsic1 -Vì lѭu thông,gói tin muӕn ÿӃn ÿѭӧc ÿӏa chӍ cӫa Host bҳt buӝt phҧi ÿi qua Router -Bҥn thӵc hiӋn tҥo Access List Router Vsic nhѭ sau: Vsic1#conf t Enter configuration commands, one per line End with CNTL/Z Vsic1(config)#access-list deny 11.0.0.2 0.0.0.0 //tͳ ch͙i s͹ truy nh̵p cͯa ÿ͓a ch͑ 11.0.0.2// -Lúc bҥn thӵc hiӋn lӋnh Ping tӯ Host ÿӃn VSIC2 VSIC Education Corporation Trang 139 CCNA Tài liӋu dành cho hӑc viên -Bҥn thҩy lӋnh Ping thӵc hiӋn vүn thành công, lý bҥn chѭa mӣ chӃ ÿӝ Access list interface ethernet0 cӫa router Vsic1 Vsic1(config)#int e0 Vsic1(config-if)#ip access-group in //ngăn c̫n ÿ˱ͥng vào cͯa serial theo access group 1// -Sau apply access list vào interface ethernet 0, ta ping tӯ PC1 ÿӃn VSIC2 Bây giӡ ta ÿәi ÿӏa chӍ cӫa PC thành 11.0.0.3, thӱ ping lҥi lҫn nӳa VSIC Education Corporation Trang 140 CCNA Tài liӋu dành cho hӑc viên -Bҥn thҩy lӋnh Ping vүn không thành cӝng, lý không tìm thҩy ÿӏa chӍ source (ÿӏa chӍ lҥ) danh sách Access list, router sӁ mһc ÿӏnh thӵc hiӋn Deny any,vì vұy bҥn phҧi thay ÿәi mһc ÿӏnh Sau ÿây lӋnh debug ip packet tҥi VSIC1 thӵc hiӋn lӋnh ping Vsic1(config)#access-list permit any -Lúc bҥn thӵc hiӋn lҥi lӋnh Ping tӯ PC1 ÿӃn VSIC2 VSIC Education Corporation Trang 141 CCNA Tài liӋu dành cho hӑc viên -Bҥn thҩy lӋnh Ping ÿã thành công, ÿӃn ÿây bҥn ÿã cҩu hình xong Standard Access List Tӵ cҩu hình bҵng Dynagen: Click file lab21acls.net cҩu hình theo sѫ ÿӗ sau: Thay apply ACL tҥi interface Fa0/0 theo chiӅu in, ta có thӇ hiӋn ÿӕi vӟi interface s1/0 theo chiӅu out Ta cҩu hình tѭѫng tӵ test theo hѭӟng dүn cӫa VSIC Education Corporation Trang 142 CCNA Tài liӋu dành cho hӑc viên BÀI 22: EXTENDED ACCESS LIST Giӟi thiӋu : -Ӣ trѭӟc bҥn ÿã thӵc hiӋn viӋc cҩu hình Standard Access List, Lab bҥn sӁ tiӃp tөc tìm hiӇu sâu hѫn vӅ Extended Access List Ĉây mӣ rӝng cӫa Standard Access List, trình kiӇm tra, Router sӁ kiӇm tra yӃu tӕ vӅ ÿӏa chӍ nguӗn, ÿích,giao thӭc port… Mô tҧ lab ÿӗ hình : -Mөc ÿích cӫa Lab:Bҥn thӵc hiӋn cҩu hình Extended Access List cho Host1 không thӇ Telnet vào Router Vsic nhѭng vүn có thӇ duyӋt web qua Router Vsic2 Bҥn thӵc hiӋn ÿӗ hình nhѭ sau: Bҥn thӵc hiӋn viӋc cҩu hình cho Router Host nhѭ ÿӗ hình trên: Cҩu hình router : Host1: IP Address:11.0.0.2 Subnet mask:255.255.255.0 Gateway:11.0.0.1 VSIC Education Corporation Trang 143 CCNA Tài liӋu dành cho hӑc viên Host2: IP Address:10.0.0.2 Subnet mask:255.255.255.0 Gateway:10.0.0.1 Router Vsic1: vsic1#show run Building configuration Current configuration: ! version 12.0 service timestamps debug uptime service timestamps log uptime no service password-encryption ! hostname vsic1 ! ip subnet-zero ! process-max-time 200 ! interface Ethernet0 ip address 11.0.0.1 255.255.255.0 no ip directed-broadcast ! interface Serial0 ip address 192.168.1.1 255.255.255.0 no ip directed-broadcast ! interface Serial1 no ip address no ip directed-broadcast shutdown ! line transport input none line line aux line vty ! end Router Vsic2 VSIC Education Corporation Trang 144 CCNA Tài liӋu dành cho hӑc viên Building configuration Current configuration: ! version 12.1 service timestamps debug uptime service timestamps log uptime no service password-encryption ! hostname vsic2 ! enable secret $1$V7En$XlyfRt14RWv2KPO9goxVt //m̵t kẖu secret l Router// ! ip subnet-zero ! interface Ethernet0 ip address 10.0.0.1 255.255.255.0 ! interface Serial0 ip address 192.168.1.2 255.255.255.0 no fair-queue clockrate 56000 ! interface Serial1 no ip address shutdown ! ip classless no ip http server ! line transport input none line line aux line vty password cisco login ! end -Bҥn thӵc hiӋn viӋc ÿӏnh tuyӃn(sӱ dөng Rip) vsic1(config)#router rip vsic1(config-router)#net 11.0.0.0 vsic1(config-router)#net 192.168.1.0 VSIC Education Corporation Trang 145 CCNA Tài liӋu dành cho hӑc viên DuyӋt Web -ĈӇ thành công bѭӟc duyӋt Web,bҥn thӵc hiӋn câu lӋnh thay ÿәi viӋc Deny any mһc ÿӏnh cӫa Access List vsic2(config)#access-list 101 permit ip any any -Bҥn ý rҵng câu lӋnh Access List extended không giӕng nhѭ Access List Standard Access List Extended,Router sӁ kiӇm tra cҧ ÿӏa chӍ nguӗn,ÿích,giao thӭc port Permit ip any any có nghƭa cho phép tҩt cҧ ÿӏa chӍ nguӗn ÿích khác(không tìm thҩy danh sách Access List) chҥy nӅn giao thӭc IP ÿi qua Lúc bҥn thӵc hiӋn lҥi trình duyӋt web VSIC Education Corporation Trang 149 CCNA Tài liӋu dành cho hӑc viên Bҥn nhұp vào User Name Password User name:Vsic2 Password:Router -ĈӃn ÿây bҥn ÿã thành công viӋc cҩu hình cho Extended Access List,bҥn ÿã thӵc hiӋn ÿѭӧc yêu cҫu tҥo Access List cho Router vӟi mөc ÿích ngăn cҩm viӋc Telnet vào Router cho phép trình duyӋt Web vào Router.Bҥn cNJng có thӇ mӣ rӝng thêm ÿӗ hình vӟi nhiӅu Router ÿӇ thӵc tұp viӋc cҩu hình Access List cho Router vӟi nhӳng yêu cҫu bҧo mұt khác Tӵ Thӵc hành bҵng Dynagen: Sӱ dөng file lab22acle.net ÿӇ thӵc hành Sѫ ÿӗ cách cҩu hình tѭѫng tӵ nhѭ VSIC Education Corporation Trang 150 CCNA Tài liӋu dành cho hӑc viên BÀI 23: TҨN CÔNG ROUTER BҴNG FLOOD Mô tҧ lab cҩu hình : Ĉӗ hình lab hình trên, sӁ bұt http server router Vsic2 Deny Service bҵng DoS S0 cӫa router Vsic2 ÿӏa chӍ 192.168.1.2, ta cҩu hình access-list 101 áp vào interface S0, nӝi dung cӫa access-list 101 cҩm tҩt cҧ gói ÿi vào interface (sӱ dөng ÿӇ Defense) Cҩu hình cӫa Router : Cҩu hình cӫa router : Vsic1#show run Building configuration Current configuration : 559 bytes version 12.1 hostname Vsic1 interface Ethernet0 ip address 10.1.0.1 255.255.255.0 interface Serial0 ip address 192.168.1.1 255.255.255.0 no fair-queue clockrate 64000 router rip network 10.0.0.0 network 192.168.1.0 end Vsic2#show run Building configuration Current configuration : 616 bytes version 12.1 hostname Vsic2 interface Loopback0 VSIC Education Corporation Trang 151 CCNA Tài liӋu dành cho hӑc viên ip address 11.1.0.1 255.255.255.0 interface Serial0 ip address 192.168.1.2 255.255.255.0 router rip network 11.0.0.0 network 192.168.1.0 ip http server access-list 101 deny tcp any 10.1.0.0 0.0.0.255 access-list 101 permit ip any any end Chúng ta bұt http server router Vsic2 bҵng cách : Vsic2(config)#ip http server Thӵc thi DoS : Sau cҩu hình xong, ta chҥy thӱ Web Service router 2501 bҵng vào Internet explorer browser, nhұp vào khung Address : http://192.168.3.1/ chҳc chҳn Service ÿang chҥy Bây giӡ, vào command prompt khӣi ÿӝng chѭѫng trình bonk (http://www.packetstorm.net/) Chѭѫng trình sӁ gӣi packet liên tөc ÿӃn ÿӏa chӍ mà nhұp vào (Interface S0 cӫa Vsic2) Lúc tҥo router Vsic2 ÿã cҩu hình access-list deny tҩt cҧ gói ÿӃn ÿӏa chӍ 192.168.1.2 (interface S0 cӫa Vsic2) Chúng ta có thӇ xem trình ÿҫu tiên mӟi bҳt ÿҫu gӣi gói tӯ phҫn mӅm file chҥy bonk, nhӳng gói tӯ phҫn mӅm gӣi bӏ deny : (sӱ dөng câu lӋnh debug ip packet detail ÿӇ hiӋn thӏ thông tin vӅ gói Vsic2) 01:35:27: IP: s=192.168.1.2 (local), d=58.78.126.160, len 56, unroutable 01:35:28: IP: s=234.163.97.104 (Serial0), d=192.168.1.2, len 56, access denied 01:35:28: IP: s=90.18.161.21 (Serial0), d=192.168.1.2, len 56, access denied 01:35:28: IP: s=192.168.1.2 (local), d=90.18.161.21, len 56, unroutable 01:35:29: IP: s=212.188.230.189 (Serial0), d=192.168.1.2, len 56, access denied VSIC Education Corporation Trang 152 CCNA Tài liӋu dành cho hӑc viên 01:35:29: IP: s=95.72.43.45 (Serial0), d=192.168.1.2, len 56, access denied 01:35:29: IP: s=192.168.1.2 (local), d=95.72.43.45, len 56, unroutable 01:35:30: IP: s=137.183.32.171 (Serial0), d=192.168.1.2, len 56, access denied 01:35:30: IP: s=34.183.126.195 (Serial0), d=192.168.1.2, len 56, access denied Tuy nhiên trình deny router Vsic2 phҧi ÿѭa gói vào dӳ liӋu cӫa ÿӇ phân tích Trong file chҥy bonk gӣi gói mӝt cách liên tөc, nên chѭa ÿҫy phút sau interface serial cӫa Vsic2 bӏ down service http cӫa vұy cNJng sӁ bӏ down Chúng ta không thӇ duyӋt web lúc 01:35:31: IP: s=192.168.1.2 (local), d=190.191.154.23, len 56, unroutable 01:35:32: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0, changed state to down 01:35:32: IP: s=68.190.155.4 (Serial0), d=192.168.1.2, len 56, access denied 01:35:32: IP: s=192.168.1.2 (local), d=68.190.155.4, len 56, unroutable Sau down mӝt thӡi gian, router sӁ tӵ ÿӝng up interface S0 lên lҥi NӃu không ghӁn nӳa sӁ hoҥt ÿӝng bình thѭӡng 01:35:52: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0, changed state to up VSIC Education Corporation Trang 153 CCNA Tài liӋu dành cho hӑc viên BÀI 24: CҨU HÌNH NAT STATIC Giӟi thiӋu : Nat (Network Address Translation) mӝt giao thӭc dùng ÿӇ cung cҩp sӵ chuyӇn ÿәi IP miӅn ÿӇ ÿѭa mӝt môi trѭӡng khác thông qua mӝt IP ÿã ÿѭӧc ÿăng ký ÿӇ chuyӇn ÿәi thông tin giNJa môi trѭӡng (either Local or Global) Ѭu ÿiӇm cӫa NAT( Network Nat Translation ) chuyӇn ÿәi IP adress riêng mҥng ÿӃn IP adress inside ÿѭӧc Cung cҩp ÿã ÿăng ký Các loҥi ÿӏa chӍ : Inside Local : ÿӏa chӍ bên mҥng nӝi bӝ ( gateway) Inside Global :là ÿӏa chӍ cәng GATEWAY , ÿó ÿӏa chӍ Nat ÿã ÿѭӧc ÿăng ký Trong :172.17.0.1/24 Outside Global : hӋ thӕng mҥng bên môi trѭӡng Cách thӭc chuyӇn ÿәi mӝt IP public mӝt IP private sӁ hiӋu quҧ triӇn khai rӝng cho tҩt cҧ host mҥng, bӣi làm nhѭ vұy ta sӁ ÿӫ ÿӏa chӍ ÿӇ cung cҩp Nat tƭnh thѭӡng ÿѭӧc áp dөng ta sӱ dөng ÿӏa chӍ public làm WebServer hay FTP Server,v.v Mô tҧ lab ÿӗ hình : Các PC nӕi vӟi router bҵng cáp chéo, hai router nӕi vӟi bҵng cáp serial Ĉӏa chӍ IP cӫa interface PC ÿѭӧc cho hình vӁ Trong lab này, router Vsic2 ÿѭӧc cҩu hình nhѭ mӝt ISP, router Vsic1 ÿѭѫc cҩu hình nhѭ mӝt gateway Cҩu hình : Chúng ta cҩu hình cho router nhѭ sau : Router#conf t Vsic2(config)#enable password cisco Route r(config)#hostname Vsic2 Vsic2(config)#interface serial Vsic2(config-if)#ip address 192.168.0.1 255.255.255.0 Vsic2(config-if)# no shut Vsic2(config-if)#clock rate 64000 Vsic2(config)#interface ethernet Vsic2(config-if)#ip address 10.1.0.1 255.255.0.0 Vsic2(config-if)#no shut Vsic1(config)#interface serial Vsic1(config-if)#ip address 192.168.0.2 255.255.255.0 VSIC Education Corporation Trang 154 CCNA Tài liӋu dành cho hӑc viên Vsic1(config)#ip nat outside c̭u hình interface S0 interface outside Vsic1(config)#interface ethernet Vsic1(config-if)#ip address 11.1.0.1 255.255.0.0 Vsic1(config-if)#no shut Vsic1(config-if)#ip nat intside C̭u hình interface E0 interface inside Chúng ta tiӃn hành cҩu hình Static NAT cho Vsic1 bҵng câu lӋnh : Vsic1(config)#ip nat inside source static 10.1.0.2 172.17.0.1 Câu lӋnh có ý nghƭa : gói tin xuҩt phát tӯ PC2 qua router( vào tӯ interface E0) Vsic1 ngoài( khӓi interface S0) sӁ ÿѭӧc ÿәi ÿӏa chӍ IP source tӯ 11.1.0.2 thành ÿӏa chӍ 172.17.0.1 (ÿây ÿӏa chӍ ÿã ÿѭӧc ÿăng ký vӟi ISP) Chúng ta tiӃn hành ÿһt Static Route cho Router Vsic2 Vsic1 Vsic1(config)#ip route 0.0.0.0 0.0.0.0 192.168.0.1 Vsic2(config)#ip route 172.17.0.0 255.255.0.0 192.168.0.2 Ĉӏa chӍ 172.17.0.1 Address ÿã ÿѭӧc ÿăng ký Trên thӵc tӃ ISP chӍ route xuӕng user bҵng ÿӏa chӍ ÿã ÿăng ký ĈӇ kiӇm tra viӋc NAT cӫa router Vsic1 nhѭ thӃ sӱ dөng câu lӋnh sau: Vsic1#sh ip nat translation Pro Inside global Inside local Outside local Outside global - 172.17.0.1 11.1.0.2 ĈӇ kiӇm tra router Vsic1 chuyӇn ÿәi ÿӏa chӍ nhѭ thӃ sӱ dөng câu lӋnh debug ip nat router Vsic1 và ping tӯ PC1 ÿӃn PC2( hay interface loopback giҧ lұp) VSIC Education Corporation Trang 155 CCNA Tài liӋu dành cho hӑc viên Ta có thӇ sӱ dөng lӋnh ping tӯ Router Vsic2 vào bên Server( ÿӏa chӍ 172.17.0.1) cӫa chúng ta, Nhѭ vұy ӣ bên muӕn tѭѫng tác ÿѭӧc vӟi Server ӣ bên phҧi truy cұp vào ÿӏa chӍ IP 172.17.0.1 Tӵ thӵc hành bҵng Dynagen : Ta sӱ dөng file lab24nats.net ÿӇ thӵc hành Ta thӵc hành tѭѫng tӵ nhѭ vӟi sѫ ÿӗ nhѭ sau : VSIC Education Corporation Trang 156 CCNA Tài liӋu dành cho hӑc viên Bұt thêm “debug ip packet” ӣ VSIC2 ÿӇ xem packet tӯ PC1 tӟi VSIC2 VSIC Education Corporation Trang 157 CCNA Tài liӋu dành cho hӑc viên BÀI 25:CҨU HÌNH NAT OVERLOAD Giӟi thiӋu : NAT (Network Address Translation) dùng ÿӇ chuyӇn ÿәi private address thành ÿӏa chӍ public address Các gói tin tӯ mҥng nӝi bӝ cӫa user gӱi ngoài, ÿӃn router biên ÿӏa chӍ IP source sӁ ÿѭӧc chuyӇn ÿәi thành ÿӏa chӍ public mà user ÿã ÿăng ký vӟi ISP ĈiӅu cho phép gói tin tӯ mҥng nӝi bӝ có thӇ ÿѭӧc gӱi mҥng (Internet) NAT có loҥi : NAT static, NAT pool, NAT overload NAT static cho phép chuyӇn ÿәi m͡t ÿӏa chӍ nӝi bӝ thành m͡t ÿӏa chӍ public NAT pool cho phép chuyӇn ÿәi ÿ͓a ch͑ n͡i b͡ thành mӝt dãy ÿ͓a ch͑ public NAT overload cho phép chuyӇn ÿәi ÿ͓a ch͑ n͡i b͡ thành m͡t ÿ͓a ch͑ public Trong kӻ thuұt NAT overload, router sӁ sӱ dөng thêm port cho ÿӏa chӍ chuyӇn ÿәi Các câu lӋnh sӱ dөng lab : ip nat {inside | outside} Cҩu hình interface inside hay outside ip nat inside source {list {accessílistínumber | name} pool name [overload] | static localíip globalíip} Cho phép chuyӇn ÿӏa chӍ nӝi bӝ thành ÿӏa chӍ public ip nat pool name startíip endíip {netmask | prefixílength prefixílength} [type rotary] Tҥo NAT pool show ip nat translations Xem thông tin vӅ NAT debug ip nat Xem hoҥt ÿӝng cӫa NAT Mô tҧ lab ÿӗ hình : Ĉӗ hình lab nhѭ hình Router Vsic1 ÿѭӧc cҩu hình inteface loopback 0, loopback 1, loopback Router Vsic2 ÿѭӧc cҩu hình interface loopback Hai router ÿѭӧc nӕi vӟi bҵng cáp Serial Ta giҧ lұp lӟp mҥng lo0, lo1, lo2 nhӳng mҥng bên trong, traffic ӣ bên mҥng ÿi ( khӓi S0) sӁ ÿѭӧc chuyӇn ÿәi ÿӏa chӍ Cҩu hình router : VSIC Education Corporation Trang 158 CCNA Tài liӋu dành cho hӑc viên Hai router ÿѭӧc cҩu hình interface nhѭ sau : Vsic1#sh run Building configuration Current configuration : 630 bytes hostname Vsic1 interface Loopback0 ip address 10.1.0.1 255.255.0.0 interface Loopback1 ip address 11.1.0.1 255.255.0.0 interface Loopback2 ip address 12.1.0.1 255.255.0.0 interface Serial0 ip address 192.168.1.1 255.255.255.0 end Vsic2#sh run Building configuration Current configuration : 644 bytes hostname Vsic2 interface Loopback0 ip address 13.1.0.1 255.255.0.0 interface Serial0 ip address 192.168.1.2 255.255.255.0 no fair-queue clockrate 64000 end Chúng ta cҩu hình NAT router Vsic1 theo bѭӟc sau : Bѭӟc : C̭u hình interface inside outside Trong lab này, cҩu hình cho interface loopback cӫa Vsic1 inside interface serial out side Vsic1(config)#in lo0 Vsic1(config-if)#ip nat inside Vsic1(config)#in lo1 Vsic1(config-if)#ip nat inside Vsic1(config-if)#in lo2 Vsic1(config-if)#ip nat inside Vsic1(config-if)#in s0 Vsic1(config-if)#ip nat outside Vsic1(config-if)#exit Bѭӟc : T̩o access list cho phép m̩ng ÿ˱ͫc NAT Chúng ta cҩu hình cho phép mҥng 10.1.0.0/16 mҥng 11.1.0.0/16 ÿѭӧc cho phép, cҩm mҥng 12.1.0.0/16 Vsic1(config)# access-list deny 12.1.0.0 0.0.255.255 Vsic1(config)#access-list permit any VSIC Education Corporation Trang 159 CCNA Tài liӋu dành cho hӑc viên Bѭӟc : T̩o NAT pool cho router Vsic1 Cҩu hình NAT pool tên Vsic1 có ÿӏa chӍ tӯ 172.1.1.1/24 ÿӃn 172.1.1.5/24 Vsic1(config)#ip nat pool Vsic1 172.1.1.1 172.1.1.5 netmask 255.255.255.0 Bѭӟc : C̭u hình NAT cho router Vsic1(config)#ip nat inside source list pool Vsic1 overload Câu lӋnh cҩu hình overload cho NAT pool Bѭӟc : Ĉ͓nh tuy͇n cho router Vsic1(config)#ip route 13.1.0.0 255.255.0.0 192.168.1.2 Vsic2(config)#ip route 172.1.1.0 255.255.255.0 192.168.1.1 L˱u ý : ÿ͙i vͣi router Vsic2, n͇u ta ÿ͓nh tuy͇n theo d̩ng : Vsic2(config)#ip route 0.0.0.0 0.0.0.0 192.168.1.1 có th͋ ping th̭y ÿ˱ͫc m̩ng ͧ router Vsic1 (10.1.0.0/16, 11.1.0.0/16) Nh˱ng th͹c t͇, ISP ch͑ ÿ͓nh tuy͇n xu͙ng cho user b̹ng ÿ͓a ch͑ mà user ÿã ÿăng ký (Inside global address) Bѭӟc : Ki͋m tra ho̩t ÿ͡ng cͯa NAT Chúng ta sӁ kiӇm tra NAT bҵng câu lӋnh debug ip nat Vsic1#debug ip nat IP NAT debugging is on Sau bұt debug NAT, sӁ ping ÿӃn loopback0 cӫa Vsic2 tӯ loopback0 cӫa Vsic1 Ta giҧ lұp traffic tӯ host 10.1.0.1 ÿӃn mҥng 13.1.0.1 Lúc traffic cӫa 10.1.0.1 qua S0 sӁ chuyӇn ÿәi ÿӏa chӍ Vsic1#ping Protocol [ip]: Target IP address: 13.1.0.1 Repeat count [5]: Datagram size [100]: Timeout in seconds [2]: Extended commands [n]: y Source address or interface: 10.1.0.1 Type of service [0]: Set DF bit in IP header? [no]: Validate reply data? [no]: Data pattern [0xABCD]: Loose, Strict, Record, Timestamp, Verbose[none]: Sweep range of sizes [n]: Type escape sequence to abort Sending 5, 100-byte ICMP Echos to 13.1.0.1, timeout is seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 40/40/44 ms Vsic1# 00:31:12: NAT: s=10.1.0.1->172.1.1.1, d=13.1.0.1 [190] 00:31:12: NAT*: s=13.1.0.1, d=172.1.1.1->10.1.0.1 [190] 00:31:12: NAT: s=10.1.0.1->172.1.1.1, d=13.1.0.1 [191] 00:31:12: NAT*: s=13.1.0.1, d=172.1.1.1->10.1.0.1 [191] VSIC Education Corporation Trang 160 CCNA Tài liӋu dành cho hӑc viên 00:31:12: NAT: s=10.1.0.1->172.1.1.1, d=13.1.0.1 [192] 00:31:12: NAT*: s=13.1.0.1, d=172.1.1.1->10.1.0.1 [192] 00:31:12: NAT: s=10.1.0.1->172.1.1.1, d=13.1.0.1 [193] 00:31:12: NAT*: s=13.1.0.1, d=172.1.1.1->10.1.0.1 [193] 00:31:12: NAT: s=10.1.0.1->172.1.1.1, d=13.1.0.1 [194] 00:31:12: NAT*: s=13.1.0.1, d=172.1.1.1->10.1.0.1 [194] Tӯ kӃt quҧ ta thҩy ÿѭӧc, gói tin tӯ mҥng 10.1.0.1 ÿã ÿѭӧc ÿәi source IP thành 171.1.1.1 Sӱ dөng câu lӋnh show ip nat translations ÿӇ xem thông vӅ NAT Vsic1#sh ip nat translations Pro Inside global Inside local Outside local Outside global icmp 172.1.1.1:2459 10.1.0.1:2459 13.1.0.1:2459 13.1.0.1:2459 icmp 172.1.1.1:2460 10.1.0.1:2460 13.1.0.1:2460 13.1.0.1:2460 icmp 172.1.1.1:2461 10.1.0.1:2461 13.1.0.1:2461 13.1.0.1:2461 icmp 172.1.1.1:2462 10.1.0.1:2462 13.1.0.1:2462 13.1.0.1:2462 icmp 172.1.1.1:2463 10.1.0.1:2463 13.1.0.1:2463 13.1.0.1:2463 Các sӕ ÿѭӧc in ÿұm port NAT sӱ dөng cho ÿӏa chӍ 10.1.0.1 Lұp lҥi bѭӟc ÿӇ kiӇm tra NAT cho loopback 1, loopback cӫa router Vsic1 Vsic1#ping Protocol [ip]: Target IP address: 13.1.0.1 Repeat count [5]: Datagram size [100]: Timeout in seconds [2]: Extended commands [n]: y Source address or interface: 11.1.0.1 Type of service [0]: Set DF bit in IP header? [no]: Validate reply data? [no]: Data pattern [0xABCD]: Loose, Strict, Record, Timestamp, Verbose[none]: Sweep range of sizes [n]: Type escape sequence to abort Sending 5, 100-byte ICMP Echos to 13.1.0.1, timeout is seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 40/40/44 ms Vsic1# 00:33:16: NAT: s=11.1.0.1->172.1.1.1, d=13.1.0.1 [210] 00:33:16: NAT*: s=13.1.0.1, d=172.1.1.1->11.1.0.1 [210] 00:33:16: NAT: s=11.1.0.1->172.1.1.1, d=13.1.0.1 [211] 00:33:16: NAT*: s=13.1.0.1, d=172.1.1.1->11.1.0.1 [211] 00:33:16: NAT: s=11.1.0.1->172.1.1.1, d=13.1.0.1 [212] 00:33:16: NAT*: s=13.1.0.1, d=172.1.1.1->11.1.0.1 [212] 00:33:17: NAT: s=11.1.0.1->172.1.1.1, d=13.1.0.1 [213] 00:33:17: NAT*: s=13.1.0.1, d=172.1.1.1->11.1.0.1 [213] 00:33:17: NAT: s=11.1.0.1->172.1.1.1, d=13.1.0.1 [214] 00:33:17: NAT*: s=13.1.0.1, d=172.1.1.1->11.1.0.1 [214] VSIC Education Corporation Trang 161 CCNA Tài liӋu dành cho hӑc viên Vsic1#sh ip nat translations Pro Inside global Inside local Outside local Outside global icmp 172.1.1.1:6407 11.1.0.1:6407 13.1.0.1:6407 13.1.0.1:6407 icmp 172.1.1.1:6408 11.1.0.1:6408 13.1.0.1:6408 13.1.0.1:6408 icmp 172.1.1.1:6409 11.1.0.1:6409 13.1.0.1:6409 13.1.0.1:6409 icmp 172.1.1.1:6410 11.1.0.1:6410 13.1.0.1:6410 13.1.0.1:6410 icmp 172.1.1.1:6411 11.1.0.1:6411 13.1.0.1:6411 13.1.0.1:6411 Vsic1#ping Protocol [ip]: Target IP address: 13.1.0.1 Repeat count [5]: Datagram size [100]: Timeout in seconds [2]: Extended commands [n]: y Source address or interface: 12.1.0.1 Type of service [0]: Set DF bit in IP header? [no]: Validate reply data? [no]: Data pattern [0xABCD]: Loose, Strict, Record, Timestamp, Verbose[none]: Sweep range of sizes [n]: Type escape sequence to abort Sending 5, 100-byte ICMP Echos to 13.1.0.1, timeout is seconds: … Success rate is percent (0/5) Ĉӕi vӟi 12.1.0.1, không ping ÿѭӧc mҥng 12.1.0.0/16 ÿã bӏ cҩm access list Ĉӭng ӣ router Vsic2, ping xuӕng loopback cӫa router Vsic1 Vsic2#ping 10.1.0.1 Type escape sequence to abort Sending 5, 100-byte ICMP Echos to 10.1.0.1, timeout is seconds: Success rate is percent (0/5) Vsic2#ping 11.1.0.1 Type escape sequence to abort Sending 5, 100-byte ICMP Echos to 11.1.0.1, timeout is seconds: Success rate is percent (0/5) Vsic2#ping 12.1.0.1 Type escape sequence to abort Sending 5, 100-byte ICMP Echos to 12.1.0.1, timeout is seconds: Success rate is percent (0/5) Nhұn xét : tҩt cҧ ÿӅu không thành công Nguyên nhân router Vsic2 route ÿӃn loopback cӫa router Vsic1 Trong thӵc tӃ, ta cNJng có kӃt quҧ tѭѫng tӵ ISP chӍ VSIC Education Corporation Trang 162 CCNA Tài liӋu dành cho hӑc viên ÿӏnh tuyӃn xuӕng ÿӏa chӍ mà user ÿăng ký, ÿӏa chӍ mҥng bên cӫa user không ÿѭӧc ISP ÿӏnh tuyӃn Tӵ thӵc hành bҵng Dynagen: Ta click vào file lab25nato.net ÿӇ thӵc hành tѭѫng tӵ nhѭ Tuy nhiên ta có thay mҥng giҧ lұp lo0 bҵng mӝt mҥng LAN Ta sӱ dөng PC ping bұt debug theo dõi router, ta sӁ thҩy sӵ chuyӇn ÿәi ÿӏa chӍ xҧy tҥi router Hӑc viên tӵ thӵc hành nên kӃt hӧp giӳa static NAT dynamip NAT Ta có có thӇ giҧ sӱ trѭӡng hӧp mҥng có Web Server, Web Server ÿѭӧc NAT static ÿi ngѭӧc lҥi Còn lҥi nhӳng PC khác mҥng sӱ dөng NAT overload ÿӇ Internet ĈӇ thӵc hiӋn thành công ÿѭӧc này, ta test bҵng cách PC bên có thӇ ping ӣ có thӇ truy cұp Web Server ӣ bên VSIC Education Corporation Trang 163 [...]... global icmp 172.1.1.1: 245 9 10.1.0.1: 245 9 13.1.0.1: 245 9 13.1.0.1: 245 9 icmp 172.1.1.1: 246 0 10.1.0.1: 246 0 13.1.0.1: 246 0 13.1.0.1: 246 0 icmp 172.1.1.1: 246 1 10.1.0.1: 246 1 13.1.0.1: 246 1 13.1.0.1: 246 1 icmp 172.1.1.1: 246 2 10.1.0.1: 246 2 13.1.0.1: 246 2 13.1.0.1: 246 2 icmp 172.1.1.1: 246 3 10.1.0.1: 246 3 13.1.0.1: 246 3 13.1.0.1: 246 3 Các sӕ ÿѭӧc in ÿұm là port NAT sӱ dөng cho ÿӏa chӍ 10.1.0.1 Lұp lҥi các bѭӟc trên ÿӇ kiӇm... [2 14] 00:33:17: NAT*: s=13.1.0.1, d=172.1.1.1->11.1.0.1 [2 14] VSIC Education Corporation Trang 161 CCNA Tài liӋu dành cho hӑc viên Vsic1#sh ip nat translations Pro Inside global Inside local Outside local Outside global icmp 172.1.1.1: 640 7 11.1.0.1: 640 7 13.1.0.1: 640 7 13.1.0.1: 640 7 icmp 172.1.1.1: 640 8 11.1.0.1: 640 8 13.1.0.1: 640 8 13.1.0.1: 640 8 icmp 172.1.1.1: 640 9 11.1.0.1: 640 9 13.1.0.1: 640 9 13.1.0.1: 640 9... 13.1.0.1: 640 7 icmp 172.1.1.1: 640 8 11.1.0.1: 640 8 13.1.0.1: 640 8 13.1.0.1: 640 8 icmp 172.1.1.1: 640 9 11.1.0.1: 640 9 13.1.0.1: 640 9 13.1.0.1: 640 9 icmp 172.1.1.1: 641 0 11.1.0.1: 641 0 13.1.0.1: 641 0 13.1.0.1: 641 0 icmp 172.1.1.1: 641 1 11.1.0.1: 641 1 13.1.0.1: 641 1 13.1.0.1: 641 1 Vsic1#ping Protocol [ip]: Target IP address: 13.1.0.1 Repeat count [5]: Datagram size [100]: Timeout in seconds [2]: Extended commands [n]: y Source... d=13.1.0.1 [1 94] 00:31:12: NAT*: s=13.1.0.1, d=172.1.1.1->10.1.0.1 [1 94] Tӯ kӃt quҧ trên ta thҩy ÿѭӧc, các gói tin tӯ mҥng 10.1.0.1 ÿã ÿѭӧc ÿәi source IP thành 171.1.1.1 Sӱ dөng câu lӋnh show ip nat translations ÿӇ xem các thông vӅ NAT Vsic1#sh ip nat translations Pro Inside global Inside local Outside local Outside global icmp 172.1.1.1: 245 9 10.1.0.1: 245 9 13.1.0.1: 245 9 13.1.0.1: 245 9 icmp 172.1.1.1: 246 0 10.1.0.1: 246 0... IP: s=2 34. 163.97.1 04 (Serial0), d=192.168.1.2, len 56, access denied 01:35:28: IP: s=90.18.161.21 (Serial0), d=192.168.1.2, len 56, access denied 01:35:28: IP: s=192.168.1.2 (local), d=90.18.161.21, len 56, unroutable 01:35:29: IP: s=212.188.230.189 (Serial0), d=192.168.1.2, len 56, access denied VSIC Education Corporation Trang 152 CCNA Tài liӋu dành cho hӑc viên 01:35:29: IP: s=95.72 .43 .45 (Serial0),... !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 40 /40 /44 ms Vsic1# 00:31:12: NAT: s=10.1.0.1->172.1.1.1, d=13.1.0.1 [190] 00:31:12: NAT*: s=13.1.0.1, d=172.1.1.1->10.1.0.1 [190] 00:31:12: NAT: s=10.1.0.1->172.1.1.1, d=13.1.0.1 [191] 00:31:12: NAT*: s=13.1.0.1, d=172.1.1.1->10.1.0.1 [191] VSIC Education Corporation Trang 160 CCNA Tài liӋu dành cho hӑc viên 00:31:12: NAT: s=10.1.0.1->172.1.1.1,... nhѭ mӝt Web Server -Sau khi quá trình ÿӏnh tuyӃn ÿã thành công,bҥn thӵc hiӋn các bѭӟc Telnet và duyӋt Web tӯ Host 1 vào Router Vsic2 -Chú ý :ÿӇ thành công viӋc Telnet bҥn phҧi Login cho ÿѭӡng line vty và ÿһt mұt khҭu cho ÿѭӡng này(ӣ ÿây là Cisco) Telnet: DuyӋt web VSIC Education Corporation Trang 146 CCNA VSIC Education Corporation Tài liӋu dành cho hӑc viên Trang 147 CCNA Tài liӋu dành cho hӑc viên... qua Lúc này bҥn thӵc hiӋn lҥi quá trình duyӋt web VSIC Education Corporation Trang 149 CCNA Tài liӋu dành cho hӑc viên Bҥn nhұp vào User Name và Password User name:Vsic2 Password:Router -ĈӃn ÿây bҥn ÿã thành công viӋc cҩu hình cho Extended Access List,bҥn ÿã thӵc hiӋn ÿѭӧc yêu cҫu tҥo Access List cho Router vӟi mөc ÿích ngăn cҩm viӋc Telnet vào Router và cho phép quá trình duyӋt Web vào Router.Bҥn cNJng... s0 vsic2(config-if)#ip access-group 101 in -Bҥn thӵc hiӋn lҥi viӋc Telnet nhѭ trên,bҥn nhұn thҩy quá trình Telnet không thành công nhѭng bѭӟc duyӋt Web cӫa bҥn cNJng không thành công -Theo yêu cҫu bҥn chӍ ngăn cҩm Telnet nhѭng cho phép quá trình duyӋt Web Telnet VSIC Education Corporation Trang 148 CCNA Tài liӋu dành cho hӑc viên DuyӋt Web -ĈӇ thành công bѭӟc duyӋt Web,bҥn thӵc hiӋn câu lӋnh thay ÿәi... s=95.72 .43 .45 (Serial0), d=192.168.1.2, len 56, access denied 01:35:29: IP: s=192.168.1.2 (local), d=95.72 .43 .45 , len 56, unroutable 01:35:30: IP: s=137.183.32.171 (Serial0), d=192.168.1.2, len 56, access denied 01:35:30: IP: s= 34. 183.126.195 (Serial0), d=192.168.1.2, len 56, access denied Tuy nhiên trong quá trình deny router Vsic2 phҧi ÿѭa gói vào dӳ liӋu cӫa mình ÿӇ phân tích Trong khi file chҥy bonk gӣi ... 172.1.1.1: 245 9 10.1.0.1: 245 9 13.1.0.1: 245 9 13.1.0.1: 245 9 icmp 172.1.1.1: 246 0 10.1.0.1: 246 0 13.1.0.1: 246 0 13.1.0.1: 246 0 icmp 172.1.1.1: 246 1 10.1.0.1: 246 1 13.1.0.1: 246 1 13.1.0.1: 246 1 icmp 172.1.1.1: 246 2... 172.1.1.1: 640 7 11.1.0.1: 640 7 13.1.0.1: 640 7 13.1.0.1: 640 7 icmp 172.1.1.1: 640 8 11.1.0.1: 640 8 13.1.0.1: 640 8 13.1.0.1: 640 8 icmp 172.1.1.1: 640 9 11.1.0.1: 640 9 13.1.0.1: 640 9 13.1.0.1: 640 9 icmp 172.1.1.1: 641 0... 13.1.0.1: 246 1 13.1.0.1: 246 1 icmp 172.1.1.1: 246 2 10.1.0.1: 246 2 13.1.0.1: 246 2 13.1.0.1: 246 2 icmp 172.1.1.1: 246 3 10.1.0.1: 246 3 13.1.0.1: 246 3 13.1.0.1: 246 3 Các sӕ ÿѭӧc in ÿұm port NAT sӱ dөng cho ÿӏa chӍ

Ngày đăng: 04/12/2015, 14:39

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

  • Đang cập nhật ...

Tài liệu liên quan