Professional Documents
Culture Documents
Cau Hinh Co Ban
Cau Hinh Co Ban
2a. Xa cu hnh c v khi ng li: Router#erase startup-config Router#reload 2b. Trnh tri theo con tr command Router(config)#line console 0 Router(config-line)#logging synchronous 3. t tn cho router: Router(config)#hostname R R(config)# 4. t password enable, secret: Router(config)#enable password cisco Router(config)#enable secret cisco 5. t password cho cng console: Router(config)#line console 0 Router(config-line)#password vnpro Router(config-line)#login 6. M ha tt c cc password t: Router(config)#service password-encryption 7. t Banner motd: Router(config)#banner motd #Chao mung cac ban# 8. Bt cng (no shut) v t a ch IP cho cng Ethernet: Router(config)#interface f0/0 Router(config-if)#no shutdown
Page 1
Router(config-if)#ip address 192.168.1.1 255.255.255.0 8.2. To interface loopack R(config)#interface loopback 0 R(config-if)#ip address 192.168.1.1 255.255.255.0 9. Bt cng (no shut) v t a ch IP cho cng Serial: - Bt cng serial ln: Router(config)#interface serial S0/0/0 Router(config-if)#no shutdown - Kim tra th xem cng ny ang ni vi u DCE hay u DTE: Router#show controllers s0/0/0 - Nu cng serial kt ni vi u ni DCE, ta phi thc hin lnh cp xung clock trn cng ny: Router(config)#interface s0/0/0 Router(config-if)#clock rate 64000 - t a ch IP cho cng serial: Router(config-if)#ip address 192.168.12.1 255.255.255.0 10. M t cc cng: Router(config-if)#description Cong LAN noi voi may tinh 11. Cc lnh show v ping kim tra: - Lnh Ping: Router#ping 192.168.12.2 Router(config)#do ping 192.168.12.2 - Lnh ping m rng. Router#ping 192.168.1.1 source 192.168.12.2 Ping hostname: R1(config)#ip host R2 192.168.12.2 R1#ping R2 !!!!! - Xem trng thi cc cng: Router#show ip interface brief - Xem cu hnh ang chy: Router#show running-config - Xem version, xem tnh trng phn cng, b nh, thanh ghi: Router#show version 12. Lu cu hnh: S dng mt trong hai cu lnh sau: Router#copy running-config startup-config Router#write memory
Page 2
13. Cc lnh khc : - Khc phc li tm config file qua TFTP Router(config)#no service config Router(config)#wr Router(config)#reload - Tr v u dng v cui dng : Router# ( nhn t hp phm CTRL + A ) Router# ( nhn t hp phm CTRL + E ) - Tr v 1 t : Router# ( nhn t hp phm ESC + B ) - Tin n 1 t : Router# ( nhn t hp phm ESC + L) - Thi gian b logout khi mn hnh console : Router(config)#line console 0 Router(config-line)# exec-timeout {pht} {giy} * nu cu hnh 0 0 th mn hnh console khng bao gi logout .
Page 3
1.1.1.1
HCM
Telnet
ISP
2.2.2.2
HN
1.
Cch ci Telnet. Trc khi ci cn m cng 23 v a ch IP phi thng nhau, c 2 cch m Telnet. C ci t Password: HN(config)#line vty 0 4 HN(config)#password . HN(config)#login Khng c ci password. HN(config)#line vty 0 4 HN(config)#privilege level 15 HN(config)#no login 2.1. Cch Telnet HCM#telnet 2.2.2.2 Password HN>enable HN# 2.2. Kt thc telnet. HN#exit 2.4. Quay v tm thi. HN#Ctrl + Shift + 6 th ra + X 2.5. Quay li cu hnh tip. HCM#Resume s line 2.6. Xem s line. HCM#Show sessions 2.7. Xem ai ang telnet n mnh. HN#show users 2.8. Ngt kt ni 1 trong nhiu i tng. HCM#disconnect s line 2.9. Ch ng ngt kt ni vi ngi telnet n. HN# clear line s line
Page 4
SSH
1. To cu hnh SSH server.
2. 3. 4.
5.
6. 7.
HN(config)#username U1 password 123 To domain HN(config )#ip domain-name VNPro Thut ton RSA to cp key. HN(config)#crypto generate rsa p vo cng vty. HN(config)#line vty 0 4 HN(config-if)#transport input [telnet] [ssh] HN(config-if)#login local SSH client kt ni SSH Server. HCM#ssh l username IP sever SSH Xem version HN#show ip ssh i verion. HN(config)#ip ssh version [1] [2]
Page 5
2.
Switch
1. Xo cu hnh SW#erase startup-config SW#delete vlan.dat SW#reload 2. t IP telnet n SW SW(config)#interface vlan 1 SW(config-if)#ip address .. SW(config-if)#no shutdown 3. Chnh kiu truyn SW(config-if)#duplex .auto SW(config-if)#duplex .full SW(config-if)#duplex .half 4. Chnh tc SW(config-if)#speed .auto SW(config-if)#duplex .10 SW(config-if)#duplex .100 SW(config-if)#duplex .1000 5. Xem cc th linh tinh SW#show mac-address-table SW#show interface vlan 1 SW#show version SW#show interface f0/x 6. Port security 6.a. Cu hnh f0/1 ch chp nhn MAC ca A. SW(config)#int f0/1 SW(config)#switchport mode access SW(config)#switchport port-security SW(config)#switchport port-security mac-address aaaa.bbbb.cccc.dddd 6.b. Cu hnh cho hn 1 cng ni vo. SW(config)#int f0/1 SW(config)#switchport mode access SW(config)#switchport port-security SW(config)#switchport port-security maximum 2 SW(config)#switchport port-security mac-address aaaa.aaaa.aaaa.aaaa SW(config)#switchport port-security mac-address bbbb.bbbb.bbbb.bbbb
Page 7
6.c. Cu hnh SW t in mac khi my u tin ni vi hn. SW(config)#int f0/1 SW(config)#switchport mode access SW(config)#switchport port-security SW(config)#switchport port-security maximum 2 SW(config)#switchport port-security mac-address sticky 6.d. B 1 mac-add ra khi dnah sch. SW(config)#int f0/1 SW(config)#switchport mode access SW(config)#switchport port-security SW(config)#no switchport port-security mac-address 6.e. To trng thi khi c mac khng ng in vo. SW(config)#int f0/1 SW(config)#switchport mode access SW(config)#switchport port-security SW(config)#switchport port-security maximum 2 SW(config)#switchport port-security mac-address sticky SW(config)#switchport port-security violation [shutdown][restrict][protect] Vi Shutdown: t tt cng, Restrict: bo vi phm, Protect: Im lng. 6.f. Sa li khi cng b shutdown. Cch 1: no shutdown n ln. Cch 2: t 30 t up ln 1 ln. SwitchX(config)#errdisable recovery cause psecure-violation SwitchX(config)#errdisable recovery interval {seconds} 6.g. a cng v trng thi mc nh. SwitchX(config)#default interface f0/0
Page 8
CDP
R#sh cdp /Trnh by thng tin tng qut v cdp/ R#show cdp neighbors /xem thng tin tng qut/ R#show cdp neighbors detail /Xem thng tin chi tit/ R#show cdp interface /TT trng thi cdp trn port hay trn interface/ R#show cdp entry* R(config-if)#no cdp enable /Tt cdp ca cng/ R(config)#no cdp run /Tt cdp hon ton/ R(coonfig)#cdp run /Bt li CDP/
Page 9
ROUTING
I. Static Route 1. Ci t Rout. R1(config)#ip route 192.168.23.0 255.255.255.0 f0/0 AD R1(config)#ip route 192.168.23.0 255.255.255.0 192.168.12.2 AD Vi 192.168.12.2 gi l IP next-hop 2. Default router R1(config)#ip route 0.0.0.0 0.0.0.0 [fastethernet] [ip next-hop] AD 3. Xem bn nh tuyn. R#show ip route 4. Gn DNS cho Router R(config)#ip name-server 4.2.2.2 II. Dynamic routing 1. Ci t route R(config)#router rip R(config-router)# version 2 R(config-router)# network 192.168.1.0 R(config-router)# passive int f0/0 /Tt cng khng cn thit/ 2. Cu hnh khc verersion. y R1 s dng version 1, R2 s dng version 2 R2(config)#int f0/1 R2(config-if)#ip rip send version 1 R2(config-if)#ip rip reccive version 1 3. Cc lnh linh tinh. R#show ip protocols
Page 10
DHCP
1. Cu hnh DHCP Server. Router(config)#service dhcp Router(config)#ip dhcp pool [pool name] Router(dhcp-config)#network [network address][subnet mask] Router(dhcp-config)#default-router [host address] Router(dhcp-config)#dns-server [DNS1] [DNS2] 2. Cu hnh 1 khon IP khng cp Router(config)#ip dhcp excluded [start ip] [end ip] 3. Chnh thi gian cho thu. Router(config)#ip dhcp pool [pool name] Router(dhcp-config)#lease [days] [hours] [minutes] 4. Lun lun cp IP c nh da trn MAC ADD Router(config)#ip dhcp pool [pool name] /pool name khc trn/ Router(dhcp-config)#client-identifier 01[MAC of host] Router(dhcp-config)#host [IP address issue for host] EX: Router(config-dhcp)#client-identifier 01AA.AABB.BBCC.CC 5. Pc xin IP. Ipconfig /renew Ipconfig /release 6. Router xin ip R(config-if)#ip address dhcp R(config-if)#no ip address dhcp 7. Cu hnh Router Relay Agent Router(config)#f0/0 Router(config-if)# ip helper-address ip DHCP server 8. Cc lnh linh tinh. Router#show ip dhcp server statistics Router#show ip dhcp binding Router#debug ip dhcp server {events | packets | linkage}
Page 11