Cau Hinh Cisco

  • View
    38

  • Download
    4

Embed Size (px)

Text of Cau Hinh Cisco

Ngy 29 thng 5 nm 2014 Qun tr mng !CISCO !songnuochuutinh30 : CU LNH &THNG S CU HNH ROUTER _SWC BNchanhtinh0905http://songnuochuutinh30.blogspot.com/2012/05/cau-lenh-cau-hinh-router-co-ban.html 1/14Lab_Cisco_H tng mng_CCNA_CCNSPCho cc bn n vi Blog chia s trao i kinh nghim v hc tp17-05-2012CU LNH &THNG S CU HNH ROUTER _SWC BNCU LNH CU HNH ROUTER C BNKhi nimc bnRoute >User EXEC modeRouter #Privilege modeRouter(config)#GlobalConfig modeCc bc khi ng RThot (config)#exit(config)#end| 5/29/2014 6:00:53 PMCh tch nc: 'Kt qu mphn Vit - Trung l tchcc' - Ngy 24 thng 6 nm2013 - Hi Phng hng nhiu thit hido bo Bebinca - Ngy 24 thng6 nm 2013 - Cng cha xinh p nht chuu khng mng ngi bu - Ngy24 thng 6 nm 2013 - N gip vic thnh 'i gia' khitrm tin ca ng b ch - Ngy24 thng 6 nm 2013 - MC xinh p t quan chc gila tnh - Ngy 24 thng 6 nm2013 - TRANG CH -VNEXPRESS.NETTm kimTM KIM BLOG NYChia s4 Lin kt khc Blog tip theo To Blog ng nhpNgy 29 thng 5 nm 2014 Qun tr mng !CISCO !songnuochuutinh30 : CU LNH &THNG S CU HNH ROUTER _SWC BNchanhtinh0905http://songnuochuutinh30.blogspot.com/2012/05/cau-lenh-cau-hinh-router-co-ban.html 2/14(config)#(nhn t hp phm Ctr+Z)show run//(hin th file cu hnh ang chy )show ip interfacebrief //Xem trng thi cc cngshow ip routeshow versionIOS lu trn Flash &RAM show start up-config NVRAM show running-config RAM kim tra cu hnhXo cu hnh c v khi ng liR1#erase startup-config R1#reload. Lu cu hnh t RAM ca router n NVRAM ca routerRouter#copy running-config startup-config Router#write memory Copycu hnh t NVRAM n RAM, dng trong mc ch recovery passwordRouter#copy startup-config running-configKhc phc li tm config file qua TFTPRouter(config)#no service config Router(config)#wr Router(config)#reload Lnh PingRouter#ping 192.168.12.2 Router(config)#do ping 192.168.12.2 Ping host nameR1(config)#ip host R2 192.168.12.2 R1#ping R2 t tn R1>en//vo ch Privilege modeR1#conf t //vo ch Config modeR1(config)#hostname TRAVINH//(t tn cho router)Password R1(config)#no ip domain-lookup //(tt chc nng phn gii tn min)R1(config)#enable password 123//(kch hot password mode priviledge)R1(config)#enable secrec 456//(pass c m ha MD5)R1(config)#service password-encryption//(m ha ton b password)R1(config)#security passwords min-length 10// pas ti thiu 10 k tThit lp banner khi ng nhp vo Router(config)#banner motd "CHAO MUNG ADMINISTRATOR "(config)# no banner login //(b banner)=====================================================================Thit lp Password cho cc cng Line console(config)#line console 0(config-lin )#password cisco1(config-line)#login2012 (16)thng nm (1)CU LNH &THNG SCU HNH ROUTER_SWC BNthng by (11)thng chn (2)thng mi (2)NHT K BLOGNhc1Nhac2H TR TRC TUYNAdminLIN KTNgy 29 thng 5 nm 2014 Qun tr mng !CISCO !songnuochuutinh30 : CU LNH &THNG S CU HNH ROUTER _SWC BNchanhtinh0905http://songnuochuutinh30.blogspot.com/2012/05/cau-lenh-cau-hinh-router-co-ban.html 3/14(config-line)#exec time out{pht} {giy} // 0 0 th mn hnh console khng bao gi logout (config-line)#logging synchronous //Trn mn hnh console khng cn hin tng b mt con tr Aux(config)#line aux 0(config)#password cisco2(config)#loginTelnet(config)#line vty 0 4 //16 ng trong cng 1 thi im(config-line) #password cisco3(config-line)#login(config-line)#exec time out 0 0 (config-line)# login authentication defaultSSH{PC mun SSH phi dng thm phn mm Putty, PC l SSH server th dng OpenSSH}To User Pass R(config)# username Admin01 password Admin01To domain kt hp RSA pht sinh keyR(config)#ip domain-name ccnasecurity.comDng thut ton RSA to cp key //(Mc nh 512 bit, ti a 2048 bit)R(config)#crypto key generate rsa1024 p vo cng o vty(config-line)#transport input sshR(config)#ip ssh authentication-retries 2R(config)#ip ssh time-out 90R(config)#ip ssh version 2 xem version sshR# show ip ssh ==================================================================== M t kt ni ca cc cng vt l trn RouterV d: cng Fast Ethernet 0/0(config)#interface fa 0/0(config-if)#description "ket noi toi mng Lan SaiGon " Lnh gn a ch ip cho cc cng vt l.Cng fa0/0(config)#interface fa 0/0(config-if)#ip add 192.168.1.254 255.255.255.0(config-if)#no shutdown(config-if)#description "ket noi toi mng Lan 192.168.1.1 " Cng Serial 0/0(config)#interface S0/0(config-if)#ip add 192.168.1.254 255.255.255.252(config-if)#no shutdown(config-if)#description "ket noi toi R2 "config-if)#clock rate 64000Trng hp cu hnh sai a ch ip, xa b bng cu lnh(config-if)#no ip addressNgy 29 thng 5 nm 2014 Qun tr mng !CISCO !songnuochuutinh30 : CU LNH &THNG S CU HNH ROUTER _SWC BNchanhtinh0905http://songnuochuutinh30.blogspot.com/2012/05/cau-lenh-cau-hinh-router-co-ban.html 4/14Lnh kim tra xem u kt ni serial l DTE ,DCE# show controller serial 0/0/0# show run# show interfaces0/0Lnh cp xung clock (ch s dng cho DCE)(config)#interface s0/0(config-if)#clock rate 64000{ 9600,19200,56000,64000,115200,nhng con s c nh sn lun l bi s ca 9600 bps. lnh clockrate, s lm thay i tc truyn d liu v xung nhp cao th d liu s c truynvi tc cao hn.}Tt CDP trn int f0/0 ca R1R1(config)#int f0/0 R1(config-if)#no cdp enable R1 h tr cu hnh bng giao din web (SDM) R1(config)#ip http server #ip http secure-server #ip http authentication local #username Admin01 privilege 15 password Admin01Cho php cng Ethernet vn up khi khng kt ni vi bn ngoi R1(config-if)# no keepalive =====================================================================DHCPLnh cp pool DHCP cho mng LAN(config)#ip dhcp pool LAN1 //tn pool(dhcp-config)#network 192.168.1.0 255.255.255.0 //lp mang mun cp(dhcp-config)#defautl-router 192.168.1.1//IP GW(dhcp-config)#dns-server8.8.8.8config)#ip dhcp excluded-address 192.168.3.1 192.168.3.9//gii hnLnh cp pool DHCP cho mng VLANvd:Router(config)#in f0/0.100Router(config-subif)#encapsulation dot1Q 100Router(config-subif)#ip address 192.168.100.1 255.255.255.192Router(config)#ip dhcp pool vlan100Router(dhcp-config)#network 192.168.100.0 255.255.255.192Router(dhcp-config)#default-router 192.168.100.1Router(dhcp-config)#dns-server 8.8.8.8DHCP relay(config)#interface fa 0/0(config-if)#ip helper-address 192.168.1.1 // IP serverXa DHCP(config)#no ip dhcp pool ID (LAN1,LAN2)Kim tra vic cp IPRI#show ip dhcp binding Gii hn dy a ch IP khng cpNgy 29 thng 5 nm 2014 Qun tr mng !CISCO !songnuochuutinh30 : CU LNH &THNG S CU HNH ROUTER _SWC BNchanhtinh0905http://songnuochuutinh30.blogspot.com/2012/05/cau-lenh-cau-hinh-router-co-ban.html 5/14(config)#ip dhcp excluded-addresss 192.168.1.1 192.168.1.15Cp ring cho 1 my(config)#client-address (a ch MAC ca my tinh)(config)#host 192.168.100.100Xin ip t ngRouter(config)#in f0/0Router(config-if)#ip add dhcp////////////////////////////////////////////////////////////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\NH TUYN Qung b default router R(config-router)#default-information originate Router(config)#ip route 0.0.0.0 0.0.0.0 [interface/nexthop]Router(config)#redistribute staticRouter(config)#ip default-network network numberRouter(config-if)#ip summary-network eigrp AS number 0.0.0.0 0.0.0.0 Static router(config)#ip route ip mng ch subnet mask mng ch a ch nexthop ( interface ra).Router(config)#Ip route 192.168.1.0 255.255.255.0 192.168.0.1Router(config)#Ip route 0.0.0.0 0.0.0.0 192.168.0.1 //default

Router(config)#ip route 0.0.0.0 0.0.0.0 s1/0 Ripv1Router(config)#router ripRouter(config)#network 192.168.1.0Router(config)#network 192.168.2.0Ripv2Router(config)#router ripRouter(config)#version 2Router(config)#network 192.168.1.0Router(config)#network 192.168.2.0Router(config)#no auto-summaryXano route rip//xa bng nh tuynClear ip route * //xa htClear ip route 192.168.2.0//xa networkXem qu trnh gi nhn thng tin nh tuyn RIP R2#debug ip rip R2# debug ip routing R2# logging console debug Tt ch debug bng lnh undebug allR2# u all Khng cho gi thng tin nh tuyn RIP trn Serial0 passiveinterface Serial0 Ngy 29 thng 5 nm 2014 Qun tr mng !CISCO !songnuochuutinh30 : CU LNH &THNG S CU HNH ROUTER _SWC BNchanhtinh0905http://songnuochuutinh30.blogspot.com/2012/05/cau-lenh-cau-hinh-router-co-ban.html 6/14RIP ch h tr classfull nn khng gi i thng tin v subnet mask trong cc routing update. R1 gi thng tin v mng 172.16.16.0 n R2, R1 s thc hin summary mng ny v dngclassfull 172.16.0.0 .R2 kt ni trc tip vi mng 172.16.17.0 th s hiu mng ny l 172.16.0.0. Khi R2 nhn thng tin v mng 172.16.0.0, n s loi b bn tin update ny v mng ny ctrong bng nh tuyn vi metric cao hn. gii quyt vn ny ta s dng a ch secondary trn cng kt ni gia R1 v R2{a ch ny phi thuc mng ln trong mng discontiguous network v phi cng SM}.R1(config)# int s0 R1(config-if)# ip address 130.1.3.1 255.255.255.0 secondary R2(config)#int s0 R2(config-if)# ip address 130.1.3.2 255.255.255.0 secondary ======================================================================EIGRP { Enhanced Internet Gateway Routing Protocol }Router(config)#route eigrp 100 //AS Number Autonomous systemRouter(config)#network 192.168.1.0Router(config)#network 192.168.2.0Router(config)#no auto-summary//(ko t ghp cc di a ch IP thnh 1 di ln)R(config)#no logging console // tt *Mar .................//ch lm trn labShowShow ip route eigrpshow ip eigrp neighborshow ip eigrp interfaceshow ip eigrp topologyshow ip eigrp trafficdebug eigrp fsmdebug eigrp packet Thay i bandwidth ,delayRouter(config)#in s0/0Router(config)#ban (.2n)Router(config)#del Thay i bng thng v t tng hp tuyn trong interfaceRouter(config-if)#bandwidth kilobitsRouter(config-if)#ip summary-address protocol AS network number subnets mask { Lnh bandwidthto mt tham s u vo tnh ra composite metric (ca IGRP). khi bandwidthcng ln th metric tnh ra cng nh, nh vy con ng s c tin cy cao hn, v s c utin so vi cc con ng khc n cng mng ch router chn update vo bng nh tuyn. }1.EIGRP l mt giao thc dng Distance vector c ci tin.khng s dng thut tontruyn thng Bellman Ford m s dng mt thut ton ring c pht trin bi J.J.Garcia Luna Aceves thut ton DUAL khin cho EIGRP c tc hi t rt nhanh.2.Ch s AD ca EIGRP l 90 cho cc route internal v 170 cho cc