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

1 s cu l nh c u hnh c b n v c u hnh cc giao th c + Cc ch c u hnh: Router> (ch user mode) Router>enable (vo ch Privileged EXEC Mode) Router#configure terminal

(vo ch Configuration Mode)

nh tuy n trn router.

+ C u hnh t tn v password cho router: Router(config)#hostname tn_mu n_ t ( t tn cho router) Router(config)#enable password pass_mu n t (c u hnh pass ko m ha) Router(config)#enable secret pass_mu n_ t (c u hnh pass c m ha b ng MD5) + C u hnh cc ng truy c p (console, aux v vty) - C u hnh c ng console: Router(config)#line console 0 Router(config-line)#password pass_cho_c ng_console (c th khc pass c a router) Router(config-line)#login (b t bu c ph i c ch t pass cho c ng console c hi u l c) - C u hnh c ng aux: Router(config)#line aux 0 Router(config-line)#password pass_cho_c ng_aux (c th khc pass c a router) Router(config-line)#login (b t bu c ph i c ch t pass cho c ng console c hi u l c) - C u hnh c ng vty (c ng telnet) Router(config)#line vty 0 4 (ch c u hnh 5 ng telnet trong 1 th i i m). Router(config-line)#password pass_cho_c ng_vty (c th khc pass c a router) Router(config-line)#login (b t bu c ph i c ch t pass cho c ng vty c hi u l c) + Cu l nh m ha t t c m t kh u: Router(config)#service password-encryption + C u hnh a ch ip cho interface: Router(config)#interface tn_c ng (vo interface) Router(config-if)#no shutdown (cho php interface ho t ng) Router(config-if)#clock rate 64000 ( t th i gian ng b gi a 2 router, ch dng v i serial) Router(config-if)#ip address a_ch _ip subnet_mask ( t a ch ip cho interface)
VD: Router>enable Router#configure terminal Router(config)#hostname Router1 Router1(config)# c u hnh Banner mote Router1(config)#banner motd " Router_1 " c u hnh console Router1(config)#line console 0 Router1(config-line)#password itn Router1(config-line)#login Router1(config-line)#exit

ng

c u hnh telnet Router1(config)#line vty 0 4 Router1(config-line)#password itn Router1(config-line)#login Router1(config-line)#exit c u hnh password privileged Router1(config)#enable secret itn 1.2. C u hnh cc interface c a router Router1(config)#interface serial 1/0 Router1(config-if)#ip address 192.168.2.1 255.255.255.0 Router1(config-if)#description ket noi toi router 2 Router1(config-if)#clock rate 64000 Router1(config-if)#no shutdown Router1(config-if)#exit Router1(config)#interface fastEthernet 2/0 Router1(config-if)#ip address 192.168.1.1 255.255.255.0 Router1(config-if)#description ket noi toi lan Router1(config-if)#no sh Router1(config-if)#exit

+ C u hnh static route: C 2 cch c u hnh Static Route, l c u hnh theo "next hop"address v exit interface. - C u hnh theo "next hop" address: Router(config)#ip route a_ch _m ng_mu n_qu ng_b subnet_mask a_ch _ip_c a_interface_n i_v i_m ng _mu n_qu ng_b. - C u hnh theo exit interface: Router(config)#ip route a_ch _m ng_mu n_qu ng_b subnet_mask interface_n i_v i_m ng_mu n_qu ng_b. + C u hnh ng default route: Router(config)#ip route 0.0.0.0 0.0.0.0 [exit interface/ip address]. + C u hnh RIP: Router(config)#router rip (dng giao th c nh tuy n RIP) Router(config-router)#network a_ch _ip ( a ch m ng mu n qu ng b b ng giao th c RIP) Router(config-router)#passive-interface tn_c ng (thng tin nh tuy n RIP ko c g i ra c ng ny) Router(config-router)#version 2 (dng RIP version 2,m c nh l version 1) + C u hnh EIGRP : - C u hnh c b n. Router(config)#router eigrp eigrp_mu n_ t ( 1->65535) Router(config-router)#network IP_m ng_mu n_qu ng_b Router(config-router)#no auto-summary (ko t ghp cc d i a ch IP thnh 1 d i l n) - Thay i b ng thng v t t ng h p tuy n trong interface Router(config-if)#bandwidth kilobits Router(config-if)#ip summary-address protocol AS network number subnets mask

- Cn b ng t i trong EIGRP Router(config-router)#variance number - Qu ng b default route Cch 1: Router(config)#ip route 0.0.0.0 0.0.0.0 [interface/nexthop] Router(config)#redistribute static Cch 2: Router(config)#ip default-network network number Cch 3: Router(config-if)#ip summary-network eigrp AS number 0.0.0.0 0.0.0.0 - Qu ng b cc tuy n khc trong EIGRP (khng ph i l default) Router(config-router)#redistribute giao_th c_mu n_qu ng_b ID_metrics k1 k2 k3 k4 k5 V d : Router(config-router)#redistribute ospf metrics 100 100 100 100 100 - Chia s traffic trong EIGRP Router(config-router)#traffic share {balanced/min} - Cc l nh ki m tra c u hnh EIGRP show ip eigrp neighbor show ip eigrp interface show ip eigrp topology show ip eigrp traffic debug eigrp fsm debug eigrp packet + OSPF: - C u hnh c b n Router(config)#router ospf ospf_mu n_ch n ( 1->65535) Router(config-router)#network d i_ i_ch _mu n_qu ng_b Wildcard_mask area_ID (th area 0) - C u hnh priority cc interface b u DR v BDR Priority cng l n th kh n ng c b u lm DR cng cao, ng Switch, cng nh th l i cng c b u. Router(config)#interface fastethernet 0/0 Router(config-int)#ip ospf priority 55 Sau khi c u hnh xong priority c th ki m tra b ng l nh. Router# show ip ospf interface f0/0 - Ch nh s a l i OSPF cost metric trong m i interface Cost cng nh th tuy n cng c coi l best path Router(config-int)#ip ospf cost 1 c v i b u Root brige c a

ng l

- C u hnh OSPF Authentication cc interface v p dng vo router Authentication key c hi u nh l password cc router trong cng m t vng chia s v i nhau. a. C u hnh authentication n gi n Router(config-if)#ip ospf authentication-key password Router(config-router)#area area number authentication b. C u hnh authentication theo d ng m ho, b o m t cao. Router(config-if)ip ospf message-digest-key key ID md5 encryption-type key Router(config-router)#area area ID authentication message-digest - C u hnh OSPF timer trong cc interface Router(config-if)ip ospf hello-interval timer Router(config-if)ip ospf dead-interval timer - C u hnh qu ng b m t tuy n m c nh trong OSPF Router(config-router)#default-information originate - Qu ng b m t tuy n khc (khng ph i l default) Router(config-router)#redistribute protocols subnets - Cc l nh show dng ki m tra c u hnh OSPF show ip protocol show ip route show ip ospf show ip ospf interface show ip ospf database show ip ospf neighbor detail clear ip route * debug ip ospf events debug ip ospf adj

VD: C u Hnh RIP v2


R1(config)#router rip R1(config-router)#version 2 R1(config-router)# network 172.30.0.0 R1(config-router)# network 209.165.200.0 R1(config)#router rip R1(config-router)#no auto-summary R1#show running-config

VD: C u Hnh EIGRP Ta c u hnh bi lab theo s

sau

-B

u tin ta c u hnh IP vo cc c ng c a router theo s

,l nl

t l router 1, 2, 3

+ Router 1: enable conf t hostname R1 int s 2/0 ip add 192.1.12.1 255.255.255.252 no sh int fa 0/0 ip add 100.0.0.1 255.255.255.252 no sh exit int lo 0 ip add 10.0.0.1 255.255.255.0 int lo 1

ip add 10.0.1.1 255.255.255.0 int lo 2 ip add 10.0.2.1 255.255.255.0 int lo 3 ip add 10.0.3.1 255.255.255.0 int lo 4 ip add 172.16.1.1 255.255.255.0 exit + Router 2: enable conf t hostname R2 int s 2/0 ip add 192.1.12.2 255.255.255.252 no sh int fa 0/0 ip add 100.0.0.2 255.255.255.252 no sh int s 2/1 ip add 192.1.23.2 255.255.255.252 no sh int lo 0 ip add 172.16.2.1 255.255.255.0 exit + Router 3: enable conf t hostname R3 int s 2/0 ip add 192.1.23.1 255.255.255.0 no sh exit int lo 0 ip add 172.16.3.1 255.255.255.0 exit - C u hnh nh tuy n b ng giao th c EIGRP v i AS = 10 trn router 1, 2, 3 R1(config)#router eigrp 10 R1(config-router)#network 100.0.0.0 R1(config-router)#network 192.1.12.0 R1(config-router)#network 10.0.0.0 R1(config-router)#network 172.16.0.0 R1(config-router)#no auto-summary R2(config)#router eigrp 10

R2(config-router)#network 100.0.0.0 R2(config-router)#network 192.1.12.0 R2(config-router)#network 192.1.23.0 R2(config-router)#network 172.16.0.0 R2(config-router)#no auto-summary

R3(config-router)#router eigrp 10 R3(config-router)#network 192.1.23.0 R3(config-router)#network 172.16.0.0 R3(config-router)#no auto-summary - M t s l nh ta c th dng ki m tra thng tin v giao th c EIGRP R1#show ip protocol R1#show ip eigrp neighbor R1#show ip eigrp topology all-links R1#show ip route - C u hnh variance cn b ng t i trn ng c cost khng b ng nhau router 1

R1(config)#router eigrp 10 R1(config-router)#variance 6 - C u hnh summary route trn c ng c a router 1 v router 2 R1(config)#interface serial 2/0 R1(config-if)#ip summary-address eigrp 10 10.0.0.0 255.255.252.0 R2(config)#interface serial 2/1 R2(config-if)#ip summary-address eigrp 10 10.0.0.0 255.255.0.0 c u hnh default route trong giao th c EIGRP ta dng cu l nh ip default-network network-number. Router 3 trong s s c c u hnh cu l nh ny v y c ng chnh l ng ra cu i cng c thng bo cho cc router khc. Ta c u hnh nh sau R3(config)#int fa 0/1 R3(config-if)#ip add 203.162.4.190 255.255.255.0 R3(config-if)#no sh R3(config-if)#no kee R3(config-if)#exit R3(config)#ip default-network 203.162.4.0 R3(config)#ip route 203.162.4.0 255.255.255.0 fa0/1 R3(config)#router eigrp 10 R3(config-router)#network 203.162.4.0 - Trn router 1 v router 2 ta dng l nh show ip route eigrp ki m tra

C u hnh OSPF v EIGRP

bi: HN(s2/0)----(s2/0)SG(s3/0)----(s3/0)DL HN: F0/0 10.0.0.0/8, S2/0 20.0.0.0/30 (EIGRP) SG: F0/0 30.0.0.0/8, S2/0 20.0.0.0/30 (EIGRP) F1/0 40.0.0.0/8, S3/0 50.0.0.0/30 (OSPF) DL: F0/0 60.0.0.0/8, S2/0 50.0.0.0/30 (OSPF) HN: (config)#router eigrp 100 (config-router)#net 10.0.0.0 0.255.255.255 (config-router)#net 20.0.0.0 0.0.0.3 SG: (config)#router eigrp 100 (config-router)#net 20.0.0.0 0.0.0.3 (config-router)#net 30.0.0.0 0.255.255.255 (config-router)#redistribute ospf 10 metric 10000 200 255 255 255 1500

Metric: Bandwidth, delay, reability, load, MTU (config)#router ospf 10 (config-router)#net 40.0.0.0 0.255.255.255 area 0 (config-router)#net 50.0.0.0 0.0.0.3 area 0 (config-router)#redistribute eigrp 100 subnets DL: (config)#router ospf 10 (config-router)#net 60.0.0.0 0.255.255.255 area 0 (config-router)#net 50.0.0.0 0.0.0.3 area 0 Note: T t c nh ng router c cng area ph i c u hnh gi ng nhau t t c cc thng s th khu v c m i ho t ng ng ch c n ng c. 1. C u hnh c b n Router(config)#router ospf process ID Router(config-router)#network Network_number Wildcard_mask area_ID 2. C u hnh priority cc interface b u DR v BDR c v i b u Root brige c a Switch,

Priority cng l n th kh n ng cng nh th l i cng c b u.

c b u lm DR cng cao, ng

Router(config)#interface fastethernet 0/0 Router(config-int)#ip ospf priority 55 Sau khi c u hnh xong priority c th ki m tra b ng l nh. Router# show ip ospf interface f0/0 3. Ch nh s a l i OSPF cost metric trong m i interface Cost cng nh th tuy n cng Router(config-int)#ip ospf cost 1 4.C u hnh OSPF Authentication Authentication key nhau. cc interface v p dng vo router cc router trong cng m t vng chia s v i c coi l best path

c hi u nh l password

a.C u hnh authentication

n gi n

Router(config-if)#ip ospf authentication-key password Router(config-router)#area area number authentication b.C u hnh authentication theo d ng m ho, b o m t cao. Router(config-if)ip ospf message-digest-key key ID md5 encryption-type key Router(config-router)#area area ID authentication message-digest 5.C u hnh OSPF timer trong cc interface Router(config-if)ip ospf hello-interval timer Router(config-if)ip ospf dead-interval timer 6.C u hnh qu ng b m t tuy n m c nh trong OSPF

Router(config-router)#default-information originate 7.Qu ng b m t tuy n khc (khng ph i l default) Router(config-router)#redistribute protocols subnets 8.Cc l nh show dng ki m tra c u hnh OSPF

show ip protocol show ip route show ip ospf show ip ospf interface show ip ospf database show ip ospf neighbor detail clear ip route * debug ip ospf events debug ip ospf adj EIGRP 1.C u hnh c b n. Router(config)#router eigrp autonomous number Router(config-router)#network network number Router(config-router)#eigpr log-neighbor-changes (Khng c c ng Router(config-router)#no auto-summary 2.Thay i b ng thng v t t ng h p tuy n trong interface

c)

Router(config-if)#bandwidth kilobits Router(config-if)#ip summary-address protocol AS network number subnets mask

3.Cn b ng t i trong EIGRP Router(config-router)#variance number 4.Qu ng b default route Cch 1: Router(config)#ip route 0.0.0.0 0.0.0.0 [interface/nexthop] Router(config)#redistribute static Cch 2: Router(config)#ip default-network network number Cch 3: Router(config-if)#ip summary-network eigrp AS number 0.0.0.0 0.0.0.0 5.Qu ng b cc tuy n khc trong EIGRP (khng ph i l default) Router(config-router)#redistribute protocol process ID metrics k1 k2 k3 k4 k5 Ex: Router(config-router)#redistribute ospf metrics 100 100 100 100 100 6.Chia s traffic trong EIGRP Router(config-router)#traffic share {balanced/min}

You might also like