Electronic-Telecommunication. Together Discoverly New Technology
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Cau Hinh CCNA

Go down

Cau Hinh CCNA Empty Cau Hinh CCNA

Post  telecom1988 Fri May 08, 2009 3:56 pm

Chủ đề 1. Routing - Định Tuyến (Các giao thức phức tạp)

OSPF

Note: Tất cả những router có cùng area phải cấu hình giống nhau tất cả các thông số thì khu vực đó mới hoạt động đúng chức năng được.

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

Router(config)#router ospf process ID
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.

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.

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 hình OSPF timer trong các interface

Router(config-if)ip ospf hello-interval timer
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 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
telecom1988
telecom1988
Admin

Posts : 317
Join date : 2009-04-08
Age : 36
Location : 144 Xuan Thuy - Cau Giay - Ha Noi

https://banks.forum.st

Back to top Go down

Cau Hinh CCNA Empty Re: Cau Hinh CCNA

Post  telecom1988 Fri May 08, 2009 3:56 pm

Chủ đề 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.dat
Switch#erase startup-config
Switch#reload

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

Switch(config)#hostname tên switch
Switch(config)#line console 0
Switch(config-line)#password mật khẩu
Switch(config-line)#login

Switch(config)#line vty 0 4
Switch(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 vlan1
Switch(config-int)#ip address địa chỉ subnetmask
Switch(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 server
Switch(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ố vlan
Switch#show mac-address-table
Switch#clear mac-address-table

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

Switch(config-if)#switchport mode acess
Switch(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 value
Switch(config-if)#switchport port-security violation shutdown

8.Tạo Vlan

Cách 1.

Switch#vlan database
Switch(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/0
Switch(config-int)#switchport access vlan vlan-id

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

Switch(config-if)#no switchport access vlan vlan-id
Switch#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-n
Switch(config-range)#switchport access vlan vlan-id


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

10.Cấu hình Trunk

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

11.Cấu hình VTP

Switch#vlan database
Switch(vlan)#vtp v2-mode
Switch(vlan)#vtp domain tên domain
Switch(vlan)#vtp {server/client/transperant}
Switch(vlan)#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.1
Router(config-subif)#encapsulation type
Router(config-subif)#ip address địa chỉ subnetmask
telecom1988
telecom1988
Admin

Posts : 317
Join date : 2009-04-08
Age : 36
Location : 144 Xuan Thuy - Cau Giay - Ha Noi

https://banks.forum.st

Back to top Go down

Cau Hinh CCNA Empty Re: Cau Hinh CCNA

Post  telecom1988 Fri May 08, 2009 3:57 pm

Chủ đề 3 3. Access-list và các cấu hình liên quan


1.Nhắc lại về lý thuyết

Có 2 loại access-list:

Loại thứ nhất: Standard IP Access-list chỉ lọc dữ liệu dựa vào địa chỉ IP nguồn. Range của loại này là từ 1à 99. Nên được áp dụng với cổng gần đích nhất.

Loại thứ hai: Extended IP Access-list lọc dữ liệu dựa vào
Địa chỉ IP nguồn
Địa chỉ IP đích
Giao thức (TCP, UDP)
Số cổng ([Only registered and activated users can see links] Telnet…)
Và các thông số khác như Windcard mask
Range của loại này là từ 100 à199. Nên được áp dụng với cổng gần nguồn nhất.

Hai bước để cấu hình Access-list
Bước 1: Tạo access-list trong chế độ cấu hình config.
Bước 2: Áp dụng access-list cho từng cổng tuỳ theo yêu cầu ở chế độ cấu hình (config-if)

Lưu ý:
Mặc định của tất cả Access-list là deny all, vì vậy trong tất cả các access-list tối thiểu phải có 1 lệnh permit. Nếu trong access-list có cả permit và deny thì nên để các dòng lệnh permit bên trên.
Về hướng của access-list (In/Out) khi áp dụng vào cổng có thể hiểu đơn giản là: In là từ host, Out là tới host hay In vào trong Router, còn Out là ra khỏi Router.
Đối với IN router kiểm tra gói tin trước khi nó được đưa tới bảng xử lý. Đối vơi OUT, router kiểm tra gói tin sau khi nó vào bảng xử lý.
Windcard mask được tính bằng công thức:
WM = 255.255.255.255 – Subnet mask (Áp dụng cho cả Classful và Classless addreess)
0.0.0.0 255.255.255.255 = any.
Ip address 0.0.0.0 = host ip address (chỉ định từng host một )

2.Cấu hình Standard Access-list (Ví dụ)

Router(config)#access-list 1 deny 172.16.0.0 0.0.255.255
Router(config)#access-list 1 permit any
Router(config)#interface fastethernet 0/0
Router(config-in)#ip access-group in

3.Cấu hình Extended Access-list (Ví dụ)

Router(config)#access-list 101 deny tcp 172.16.0.0 0.0.255.255 host 192.168.1.1 eq telnet
Router(config)#access-list 101 deny tcp 172.16.0.0 0.0.255.255 host 192.168.1.2 eq ftp
Router(config)#access-list 101 permit any any
Router(config)#interface fastethernet 0/0
Router(config-int)#ip access-group out

4.Cấu hình named ACL thay cho các số hiệu.

Router(config)#ip access-list extended server-access (tên của access-list)
Router(config-ext-nacl)#permit tcp any host 192.168.1.3 eq telnet
Router(config)#interface fastethernet 0/0
Router(config-int)#ip access-group server-access out

5.Permit hoặc Deny Telnet sử dụng Standard Acl (Ví dụ)

Router(config)#access-list 2 permit 172.16.0.0 0.0.255.255
Router(config)#access-list 2 deny any
Router(config)#line vty 0 4
Router(config-line)#password cisco
Router(config-line)#login
Router(config-line)#ip access-class 2 in

6.Xoá và kiểm tra Access-list

Muốn xoá thì ta dùng lệnh sau:
Router(config)# no ip access-list số hiệu

Kiểm tra Acl ta dùng các lệnh sau:

show access-list
show running-config
show ip interface
telecom1988
telecom1988
Admin

Posts : 317
Join date : 2009-04-08
Age : 36
Location : 144 Xuan Thuy - Cau Giay - Ha Noi

https://banks.forum.st

Back to top Go down

Cau Hinh CCNA Empty Re: Cau Hinh CCNA

Post  telecom1988 Fri May 08, 2009 3:57 pm

Chủ đề 4. NAT – PPP – Frame Relay


I.Cấu hình NAT

Cấu hình Static NATCấu hình NAT trong chế độ Router(config). Các lệnh như sau:

Router(config)#ip nat inside source static [[i]inside local address] [inside global address]
Ví dụ:
R(config)#ip nat inside source statice 10.0.0.1 202.103.2.1 (Địa chỉ 10.10.0.1 sẽ được chuyển thành 202.103.2.1 khi đi ra khỏi Router)

Sau khi cấu hình xong phải áp dụng vào cổng in và cổng out, trong ví dụ dưới đây, cổng Ethernet là công in, còn cổng Serial là cổng out

Router(config)#interface ethernet 0
Router(config-if)#ip nat inside

Router(config)#interface serial 0
Router(config-if)#ip nat outside

Cấu hình Dynamic NAT
Router(config)#ip nat pool [ tên pool] [A.B.C.D A1.B1.C1.D1] netmask [mặt nạ]
Router(config)#ip nat inside source list [số hiệu ACL] pool [tên pool]
Router(config)#access-list [số hiệu ACL] permit A.B.C.D windcard masks

Ví dụ:
R(config)#ip nat pool nat-pool1 179.9.8.80 179.9.8.95 netmask 255.255.255.0
R(config)#ip nat inside source list 1 pool nat-pool1
R(config)#access-list 1 permit 10.1.0.0 0.0.0.255

Sau đó áp vào cổng In và Out như Static NAT

Note: Giải địa chỉ inside local address và inside global address phải nằm trong giải cho phép của ACL

Cấu hình PAT overload

Cấu hình overload với 1 địa chỉ IP cụ thể.Router(config)#ip nat pool [tên pool] [ip global inside] [subnet mask]
Router(config)#ip nat inside source list [tên số hiệu ACL] pool [tên pool] overload
Router(config)#access-list [số hiệu] permit [địa chỉ] [windcard mask]

Ví dụ:
R(config)#access-list 2 permit 10.0.0.0 0.0.0.255
R(config)#ip nat pool nat-pool2 179.9.8.20 255.255.255.240
R(config)#ip nat inside source list 2 nat-pool2 overload


Cấu hình overload dùng địa chỉ của cổng ra.(Thường xuyên được dung hơn là trường hợp trên)Router(config)#ip nat inside source list [tên số hiệu ACL] interface [cổng ra] overload
Router(config)#access-list [số hiệu] permit [địa chỉ] [windcard mask]

Ví dụ:
R(config)#ip nat inside source list 3 interface serial 0 overload
R(config)#access-list 3 permit 10.0.0.0 0.0.0.255

Các lệnh Clear NAT/PAT[i]Lệnh xóa tất cả dynamic nat trên toàn bộ các interface.
Router#clear ip nat translation *

Lệnh xóa các single nat trên từng interface
Router#clear ip nat translation [global ip - local ip]

Lệnh xóa các extended nat trên từng interface
Router#clear ip nat translation protocol [inside/outside] [global ip - global port – local ip – local port]

Kiểm tra và Debug các NAT và PATRouter#show ip nat translation
Router#show ip nat statics
Router#debug ip nat

Cấu hình DHCPRouter(config)#ip dhcp excluded-address ip-address (end-ip-address)
Router(config)#ip dhcp pool [tên pool]
Router(dhcp-config)#network addess subnetmask
Router(dhcp-config)#default-router address
Router(dhcp-config)#dns-server address
Router(dhcp-config)#netbios-name-server address
Router(dhcp-config)#domain-name tên domain
Router(dhcp-config)#lease ngày/giờ/phút

Kiểm tra và troubleshoot cấu hình DHCPRouter#show ip dhcp binding
Router#debug ip dhcp server events

Trong trường hợp DHCP server không nằm cùng mạng với hostNote: khi DHCP server không cùng mạng với host thì ta phải dùng lệnh ip helper-address giúp host đến DHCP server.

Router(config)#interface [cổng nằm cùng mạng với host]
Router(config-if)#ip helper-address [địa chỉ của DHCP server]

Note: Trong trường hợp muốn gói tin của host được broadcast ở mạng chứa DHCP thì ta dùng thêm lệnh ip directed-broadcast ở cổng cùng mạng với DHCP server

Router(config)#interface [cổng nằm cùng mạng với dhcp]
Router(config-ì)#ip directed-broadcast

II. Cấu hình PPP

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

R(config)#interface serial 0/0
R(config-if)#encapsulation ppp

2. Cấu hình PAP

Cấu hình PAP không yêu cầu hai Router giống nhau về password nhưng CHAP thì phải có.

(Cấu hình trên RA)
R(config)#host RA
RA(config)#username RB password 321
RA(config-if)#encapsulation ppp
RA(config-if)#ppp authentication pap
RA(config-if)#ppp pap sent-username RA password 123

(Cấu hình trên RB)
R(config)#host RB
RB(config)#username RA password 123
RB(config-if)#encapsulation ppp
RB(config-if)#ppp authentication pap
RB(config-if)#ppp pap sent-username RB password 321

3. Cấu hình CHAP. (yêu cầu phải giống nhau về password)

(Cấu hình trên RA)
R(config)#host RA
RA(config)#username RB password 123
RA(config-if)encapsulation ppp
RA(config-if)ppp authentication chap

(Cấu hình trên RB)

R(config)#host RB
RB(config)#username RA password 123
RB(config-if)encapsulation ppp
RB(config-if)ppp authentication chap


4. Các cấu hình khác của PPP

Cấu hình Multilink

R(config-if)#encapsulation ppp
R(config-if)#ppp multilink

Cấu hình Compression

R(config-if)#encapsulation ppp
R(config-if)#compress [predictor/stac/mppc]

Cấu hình Error detection

R(config-if)#encapsulation ppp
R(config-if)#ppp quality [phần trăm]

5. Các lệnh kiểm tra cấu hình PPP

R#show interface (xem encapsulation)
R#debug ppp negotiation (Xem quá trình kết nối giữa 2 node)
R#debug ppp authentication (Xem quá trình xác thực giữa 2 node)


III. Cấu hình Frame-Relay

Cấu hình đơn giản

R(config-if)#encapsulation frame-relay {ciso| ietf} (mặc định là cisco)

Khi lệnh này được thực thi, DLCI sẽ được Inverse ARP tự động map, người dùng không cần phải làm gì cả.

* Nhưng Inverse ARP không làm việc với các kết nối Hub-and-Spoke

Cấu hình Frame-relay static map

R(config-if)#encapsulation frame-relay
R(config-if)#frame-relay map [i]ip remote–ip-address local-dlci [cisco| ietf]
(ip address trong dòng lệnh trên chỉ lấy làm minh họa bởi nó rất phổ biến, chính xác phải là remote–protocol–address)
Broadcast trong câu lệnh trên có 2 chức năng:
Forward broadcast khi multicast không được khởi động.
Đơn giản hóa cấu hình OSPF cho mạng nonbroadcast sử dụng FRelay.
Ví dụ:

R(config-if)#encapsulation frame-relay
R(config-if)#frame-relay map ip 192.168.2.1 100 broadcast


Cấu hình FR trong mạng None Broadcast MutiAccess

Trong mạng Broadcast khi 1 máy tính truyền frame tất cả các node lắng nghe frame nhưng chỉ có node cần nhận mới nhận được.
Trong mạng None Broadcast khi 1 máy tính truyền frame thì chỉ có node cần nhận mới lắng nghe và nhận được frame đó, các node còn lại thì không. Frame được truyền qua 1 virtual Circuit hoặc 1 thiết bị chuyển mạch.
Star topology có thể được coi như là 1 mạng Hub and Spoke.

Giải quyết vấn đề với Routing Updates mà không disable Split Horizal

Giải pháp dùng Sub-interface

R(config)#interface s0/0
R(config-if)#encapsulation frame-relay
R(config-if)interface s0/0.1 [multipoint| point-to-point]

point-to-point: Mỗi subinterface có subnet riêng của mình. Broadcast và Split horizol không là vấn đề.
Multi-point: Tất cả các subinterface liên quan phải cùng chung 1 subnet và như vậy Broadcast và Split horizol sẽ có vấn đề.

Ví dụ:
(Point-to-point)
R(config)#interface s0/0
R(config-if)#encapsulation frame-relay
R(config-if)#interface s0/0.1 point-to-point
R(config-subif)#frame-relay interface-dlci 18

(Multipoint)
R(config)#interface s0/0
R(config-if)#encapsulation frame-relay
R(config-if)#interface s0/0.2 multipoint
R(config-subif)#frame-relay interface-dlci 19
R(config-subif)#frame-relay interface-dlci 20

Cấu hình trên Frame-relay Switching (ví dụ)

R(config)#frame-relay switching
R(config)#interface s0/0
R(config-if)#encapsulation frame-relay
R(config-if)#frame-relay intf-type dce
R(config-if)#frame-relay route 103interface serial 0/1 301
telecom1988
telecom1988
Admin

Posts : 317
Join date : 2009-04-08
Age : 36
Location : 144 Xuan Thuy - Cau Giay - Ha Noi

https://banks.forum.st

Back to top Go down

Cau Hinh CCNA Empty Re: Cau Hinh CCNA

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum