cau hinh static route

Upload: vu-hung

Post on 14-Apr-2018

225 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/27/2019 Cau hinh Static Route

    1/7

    CU HNH NH TUYN TNH(STATIC ROUTE)

    Yu cu :

    - Cu hnh c bn cho Router- Gn IP cho cc Router nh hnh v- S dng cc lnh CDP - Cisco Discovery Protocol- Kim tra trc khi nh tuyn- Cu hnh nh tuyn tnh

    Hng dn :Cng vic 1 : Cu hnh c bn cho Router- Thc hin trn Router 1 :

    Router#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#hostname R1R1(config)#no ip domain-lookupR1(config)#enable password classR1(config)#line console 0R1(config-line)#exec-timeout 0 0R1(config-line)#logging synchronousR1(config-line)#exit

    R1(config)#line vty 0 10R1(config-line)#password ciscoR1(config-line)#login

    VDC Training Center Trang 1 ThS L Xun Tng

  • 7/27/2019 Cau hinh Static Route

    2/7

    R1(config-line)#exitR1(config)#exitR1#copy run startDestination filename [startup-config]?

    Building configuration...[OK]R1#

    - Thc hin tng t cho Router 2 v Router 3

    Cng vic 2 : Gn IP cho cc Router

    - Thc hin trn Router 1 :

    R1(config)#int fa0/0R1(config-if)#ip address 172.16.1.1 255.255.255.0R1(config-if)#no shutR1(config-if)#exitR1(config)#

    - Thc hin trn Router 2 :

    R2(config)#int fa0/1R2(config-if)#ip address 172.16.1.254 255.255.255.0R2(config-if)#no shutR2(config-if)#exit

    R2(config)#int fa0/0R2(config-if)#ip address 10.10.10.1 255.255.255.0R2(config-if)#no shutR2(config-if)#exitR2(config)#

    - Thc hin trn Router 3 :

    R3(config)#int fa0/1R3(config-if)#ip address 10.10.10.254 255.255.255.0R3(config-if)#no shutR3(config-if)#exitR3(config)#

    - Dng lnh show ip int brief kim tra vic gn IP v trng thi ca cc cngCng vic 3 : S dng cc lnh CDP

    VDC Training Center Trang 2 ThS L Xun Tng

  • 7/27/2019 Cau hinh Static Route

    3/7

    Cisco Discovery Protocol (CDP) l giao thc ring ca Cisco dng thu thp thngtin v cc thit b ln cn. Khi s dng giao thc CDP, ta c th bit c thng tin

    phn cng, phn mm ca cc thit b gn k. Thng tin ny rt hu ch trong qutrnh x l s c hay kim sot cc thit b trong h thng mng. Mc nh, cc thit

    b Cisco cho php chy giao thc CDP, nn khi dng lnh show run thng tin vCDP s khng c hin th

    - Thc hin trn Router 2 : (Router 1 v Router 3 thc hin tng t)

    xem thng tin v cc thng s thi gian ca CDP, dng lnh show cdpR2#show cdpGlobal CDP information:

    Sending CDP packets every 60 seconds

    Sending a holdtime value of 180 secondsSending CDPv2 advertisements is enabled

    Holdtime : l khong thi gian thit b gi gi tin m n nhn c t lng ging

    Lnh show cdp neighbors hin thng tin v thit b ni trc tipR2#show cdp neighborsCapability Codes: R- Router, T - Trans Bridge, B - Source Route Bridge S - Switch, H - Host, I - IGMP, r - Repeater, P - PhoneDevice ID Local Intrfce Holdtme Capability Platform Port IDR1 Fas 0/1 141 R C2800 Fas 0/0R3 Fas 0/0 141 R C2800 Fas 0/1

    Local Interface : Interface ca Router mnh dng ni n Router lng gingPort ID : Interface ca Router lng ging dng ni vi Router ca mnh

    R2#show cdp neighbors detail

    Device ID: R1

    Entry address(es):IP address : 172.16.1.1

    Platform: cisco C2800, Capabilities: RouterInterface: FastEthernet0/1, Port ID (outgoing port): FastEthernet0/0Holdtime: 172Version :Cisco IOS Software, 2800 Software (C2800NM-ADVIPSERVICESK9-M), Version12.4(15)T1, RELEASE SOFTWARE (fc2)Technical Support: http://www.cisco.com/techsupport

    Copyright (c) 1986-2007 by Cisco Systems, Inc.Compiled Wed 18-Jul-07 06:21 by pt_rel_teamadvertisement version: 2

    VDC Training Center Trang 3 ThS L Xun Tng

  • 7/27/2019 Cau hinh Static Route

    4/7

    Duplex: full---------------------------

    Device ID: R3

    Entry address(es):IP address : 10.10.10.254Platform: cisco C2800, Capabilities: RouterInterface: FastEthernet0/0, Port ID (outgoing port): FastEthernet0/1Holdtime: 172Version :Cisco IOS Software, 2800 Software (C2800NM-ADVIPSERVICESK9-M), Version12.4(15)T1, RELEASE SOFTWARE (fc2)Technical Support: http://www.cisco.com/techsupport

    Copyright (c) 1986-2007 by Cisco Systems, Inc.Compiled Wed 18-Jul-07 06:21 by pt_rel_teamadvertisement version: 2Duplex: full

    Yu cu hc vin thc hin : ng ti mt Routertelnet n cc Router cn liv thc hin cc lnh cdp, cc lnh show cn thit v ra mt s mng y nh l : a ch IP, tn ca cc Router, tn ca cc cng ang hot ng ni ccRouter vi nhau

    Cng vic 4 : Kim tra trc khi nh tuyn

    Thc hin cc lnh ping trc khi nh tuynRouter 1 ping 172.16.1.254 : OKRouter 1 ping 10.10.10.1 : khng c

    Router 3 ping 10.10.10.1 : OKRouter 3 ping 172.16.1.254 : khng c

    Router 2 ping 172.16.1.1 : OKRouter 2 ping 10.10.10.254 : OK

    Kim tra bng Routing trc khi nh tuyn

    - Thc hin trn Router 1 :

    R1#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

    D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

    VDC Training Center Trang 4 ThS L Xun Tng

  • 7/27/2019 Cau hinh Static Route

    5/7

    E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - 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 - ODRP - periodic downloaded static route

    Gateway of last resort is not set

    172.16.0.0/24 is subnetted, 1 subnetsC 172.16.1.0 is directly connected, FastEthernet0/0

    - Thc hin trn Router 2 :

    R2#show ip route

    Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - 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 - ODRP - periodic downloaded static route

    Gateway of last resort is not set

    10.0.0.0/24 is subnetted, 1 subnetsC 10.10.10.0 is directly connected, FastEthernet0/0

    172.16.0.0/24 is subnetted, 1 subnetsC 172.16.1.0 is directly connected, FastEthernet0/1

    - Thc hin trn Router 3 :

    R3#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

    D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - 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 - ODRP - periodic downloaded static route

    Gateway of last resort is not set

    10.0.0.0/24 is subnetted, 1 subnetsC 10.10.10.0 is directly connected, FastEthernet0/1Cng vic 5 : Cu hnh nh tuyn tnh

    VDC Training Center Trang 5 ThS L Xun Tng

  • 7/27/2019 Cau hinh Static Route

    6/7

    Cu hnh nh tuyn tnh cho Router 1 (Next Hop)

    R1(config)#ip route 10.10.10.0 255.255.255.0 172.16.1.254

    Cu hnh nh tuyn tnh cho Router 3 (Outgoing Interface)

    R3(config)#ip route 172.16.1.0 255.255.255.0 fastEthernet 0/1

    Lu : cng Fastethernet 0/1 cu lnh trn l cng i ra ca Router 3 - nm trnRouter 3

    Kim tra bng Routing sau khi nh tuyn

    - Thc hin trn Router 1 :

    R1#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

    D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - 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 - ODRP - periodic downloaded static route

    Gateway of last resort is not set

    10.0.0.0/24 is subnetted, 1 subnetsS 10.10.10.0 [1/0] via 172.16.1.254

    172.16.0.0/24 is subnetted, 1 subnetsC 172.16.1.0 is directly connected, FastEthernet0/0

    Lu : S biu th cho kt ni Static vi AD=1 khi ta chn nh tuyn Next hop vHop count l 0[1/0] ( [AD/Hop count] )

    - Thc hin trn Router 3 :

    R3#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

    D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

    E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

    VDC Training Center Trang 6 ThS L Xun Tng

  • 7/27/2019 Cau hinh Static Route

    7/7

    * - candidate default, U - per-user static route, o - ODRP - periodic downloaded static route

    Gateway of last resort is not set

    10.0.0.0/24 is subnetted, 1 subnetsC 10.10.10.0 is directly connected, FastEthernet0/1

    172.16.0.0/24 is subnetted, 1 subnetsS 172.16.1.0 is directly connected, FastEthernet0/1

    Lu : AD=0 khi ta chn Outgoing interface cu hnh Static route. y takhng thy entry [1/0] trong cu hnh.

    Thc hin cc lnh ping sau khi nh tuynRouter 1 ping Router 3 : OK

    R1#ping 10.10.10.254

    Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 10.10.10.254, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 62/62/63 ms

    Router 3 ping Router 1 : OK

    R3#ping 172.16.1.1

    Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 172.16.1.1, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 47/59/63 ms

    VDC Training Center Trang 7 ThS L Xun Tng