Cac Cau Lenh Thi Skill - CCNA 3

7
OSPF. 1. Cấu hình cơ bản Router(config)#router ospf process ID Router(config-router)log-adjacency-change Router(config-router)#network Network_number Wildcard_mask area_ID 2. Cấu hình priority ở các interface để bầu DR và BDR Priority càng lớn thì khả năng được bầu làm DR càng cao, ngược với bầu Root brige của Switch, càng nhỏ thì lại càng được bầu. Router(config)#interface fastethernet 0/0 Router(config-int)#ip ospf priority 55 Sau khi cấu hình 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 càng nhỏ thì tuyến đó càng được coi là best path Router(config-int)#ip ospf cost 1 4.Cấu hình OSPF Authentication ở các interface và áp dụng vào router Authentication key được hiểu như là password để các router trong cùng một vùng chia sẻ với nhau. R(config-router)#area 0 authen ---> clear text R(config-router)#area 0 anthen message-digest - md5 a.Cấu hình authentication đơn giản Router(config-if)#ip ospf authentication-key password Router(config-router)#area area number authentication b.Cấu hình authentication theo dạng mã hoá, bảo mật cao.

Transcript of Cac Cau Lenh Thi Skill - CCNA 3

Page 1: Cac Cau Lenh Thi Skill - CCNA 3

OSPF.1. Cấu hình cơ bản

Router(config)#router ospf process IDRouter(config-router)log-adjacency-change Router(config-router)#network Network_number Wildcard_mask area_ID

2. Cấu hình priority ở các interface để bầu DR và BDR

Priority càng lớn thì khả năng được bầu làm DR càng cao, ngược với bầu Root brige của Switch, càng nhỏ thì lại càng được bầu.

Router(config)#interface fastethernet 0/0Router(config-int)#ip ospf priority 55

Sau khi cấu hình 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 càng nhỏ thì tuyến đó càng được coi là best path

Router(config-int)#ip ospf cost 1

4.Cấu hình OSPF Authentication ở các interface và áp dụng vào routerAuthentication key được hiểu như là password để các router trong cùng một vùng chia sẻ với nhau.R(config-router)#area 0 authen ---> clear textR(config-router)#area 0 anthen message-digest - md5a.Cấu hình authentication đơn giản

Router(config-if)#ip ospf authentication-key passwordRouter(config-router)#area area number authentication

b.Cấu hình authentication theo dạng mã hoá, bảo mật cao.

Router(config-if)ip ospf message-digest-key key ID md5 encryption-type keyRouter(config-router)#area area ID authentication message-digest

5.Cấu hình OSPF timer trong các interface

Router(config-if)ip ospf hello-interval timer

Page 2: Cac Cau Lenh Thi Skill - CCNA 3

Router(config-if)ip ospf dead-interval timer

6.Cấu hình 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 khác (không phải là default)

Router(config-router)#redistribute protocols subnets

8.Các lệnh show dùng để kiểm tra cấu hình OSPF

show ip protocolshow ip routeshow ip ospfshow ip ospf interfaceshow ip ospf databaseshow ip ospf neighbor detailclear ip route *debug ip ospf eventsdebug ip ospf adj

EIGRP

1.Cấu hình cơ bản.

Router(config)#router eigrp autonomous numberRouter(config-router)#network network numberRouter(config-router)#eigpr log-neighbor-changes (Không có cũng được)Router(config-router)#no auto-summary

2.Thay đổi băng thông và tự tổng hợp tuyến trong interface

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

3.Cân bằng tải trong EIGRP

Router(config-router)#variance number

4.Quảng bá default route

Page 3: Cac Cau Lenh Thi Skill - CCNA 3

Cách 1: Router(config)#ip route 0.0.0.0 0.0.0.0 Router(config)#redistribute static

Cách 2: Router(config)#ip default-network network number

Cách 3:Router(config-if)#ip summary-network eigrp AS number 0.0.0.0 0.0.0.0

5.Quảng bá các tuyến khác trong EIGRP (không phải là default)

Router(config-router)#redistribute protocol process ID metrics k1 k2 k3 k4 k5Ex: Router(config-router)#redistribute ospf metrics 100 100 100 100 100

6.Chia sẻ traffic trong EIGRP

Router(config-router)#traffic share {balanced/min}

7.Các lệnh kiểm tra cấu hình EIGRP

show ip eigrp neighborshow ip eigrp interfaceshow ip eigrp topologyshow ip eigrp trafficdebug eigrp fsmdebug eigrp packet

EIGRP OSPF : R(config)#router ospf 1R(config-router)#resdistribute eigrp AS_number subnetsR(config-router)#default-metric 2OSPF EIGRP : R(config)#router eigrp AS_numberR(config-router)#resdestribute ospf 1R(config-router)#default metric 128 10 100 100 1000OSPF RIPv.2 R(config)#router ospf 1R(config-router)#resdistribute rip subnetsR(config-router)#defaul-metric 2RIPv.2 OSPF : R(config)#router ripR(config-router)#version 2R(config-router)#resdestribute ospf 1R(config-router)#default metric 2

Page 4: Cac Cau Lenh Thi Skill - CCNA 3

Phần 2. Switching - Chuyển mạch

1.Cấu hình cơ bản chung cho một Switch

Reset tất cả cấu hình của Switch và reload lại.

Switch#delete flash:vlan.datSwitch#erase startup-configSwitch#reload

2.Cấu hình về Security và management

Switch(config)#hostname <ten SW>Switch(config)#line console 0Switch(config-line)#password <mật khẩu>Switch(config-line)#login

Switch(config)#line vty 0 4Switch(config-line)#pass <mật khẩu>Switch(config-line)#login

3.Thiết lập địa chỉ IP và default gateway cho Switch

Switch(config)#interface vlan1Switch(config-int)#ip address địa chỉ subnetmaskSwitch(config)#ip default-gateway địa chỉ

4.Thiết lập tốc độ và duplex của cổng

Switch(config-int)#speed tốc độSwitch(config-int)#duplex full

5.Thiết lập dịch vụ HTTP và cổng

Switch(config)#ip http serverSwitch(config)#ip http port 80

6.Thiết lập, quản lý địa chỉ MAC

Switch(config)#mac-address-table static địa chỉ MAC interface fastethernet số vlanSwitch#show mac-address-tableSwitch#clear mac-address-table

Page 5: Cac Cau Lenh Thi Skill - CCNA 3

7.Cấu hình bảo mật cho cổng

Switch(config-if)#switchport mode acessSwitch(config-if)#switchport port-security

Cấu hình Static: Switch(config-if)#switchport port-security mac-address địa chỉ Mac

Cấu hình Sticky: Switch(config-if)#switchport port-security mac-address sticky [i](thông dụng nhất)

Switch(config-if)#switchport port-security maximum valueSwitch(config-if)#switchport port-security violation shutdown

8.Tạo Vlan

Cách 1.

Switch#vlan databaseSwitch(vlan)#vlan number

Cách 2. Khi gán các cổng vào vlan, dù vlan chưa tồn tại nhưng Switch vẫn tự tạo.

Switch(config)#interface fastethernet 0/0Switch(config-int)#switchport access vlan vlan-id

Muốn xoá vlan ta làm như sau:

Switch(config-if)#no switchport access vlan vlan-idSwitch#clear vlan vlan_number (xoá toàn bộ vlan )

9.Gán nhiều cổng vào trong vlan cùng một lúc, cấu hình Range

Đối với dãy cổng không liên tục.Switch(config)#interface range cổng 1 , cổng 2 , cổng 3

Đối với một dãy liên tục.Switch(config)#interface range cổng 1-nSwitch(config-range)#switchport access vlan vlan-id

Ví dụ:Switch(config)#interface range f0/0 , f0/2 , f0/4Switch(config)#interface range f0/0-10

Page 6: Cac Cau Lenh Thi Skill - CCNA 3

Switch(config-range)#switchport access vlan 10

10.Cấu hình Trunk

Switch(config-if)#switchport mode trunkSwitch(config-if)#switchpor trunk encapsulation encapsulation-typeSwitch#show trunk

11.Cấu hình VTP

Switch#conf tSwitch(config)#vtp v2Switch(config)#vtp domain tên domainSwitch(config)#vtp {server/client/transperant}Switch(config)#vtp password password (Tạo pass cho domain)Switch#show vtp status

12.Cấu hình Inter-Vlan trên Router

Router(config)#interface fastethernet 0/0.1Router(config-subif)#encapsulation typeRouter(config-subif)#ip address địa chỉ subnetmask