Tổng hợp lệnh CCNA Cisco
Router(config-line)#login
Router(config-line)#password cisco
Router(config-line)#login
Router(config-line)#password cisco
Router(config-line)#exec-timeout 0 0
Set the enable secret password to peter:
Đặt mật khẩu secret là peter. Mật khẩu này ghi đè lên mật khẩu enable và được mã hóa trong file cấu hình.
Router(config-router)#network 172.16.0.0
Router(config-router)#network 172.16.0.0
Enable the http server to SDM can be used: Bật http server để dùng SDM.
Router(config)#ip http server
Defines a username and password: Đặt username (sue) và mật khẩu (cisco). Có thể dùng để xác thực PPP hoặc truy cập của người dùng.
Router(config)#username sue password cisco
Xác định file local host trong unix, kiểu như:
/etc/hosts in unix
Router(config)#ip host mypc 10.1.1.3
Vô hiệu hóa Disables DNS lookup. Hữu ích khi lệnh bị gõ lỗi.
Router(config)#no ip domain-lookup
Thiết lập băng thông logic (không phải vật lý) cho interface. Thường được sử dụng bởi các giao thức định tuyến, truy vấn SNMP.
Router(config)#int s0
Router(config-if)#bandwidth
Thiết lập physical clock
Router(config-if)#clock rate 64000
Set the serial interface WAN encapsulation: Ngoài hdlc còn có tùy chọn khác là PPP và frame-relay.
Router(config-if)#encapsulation hdlc
Authentication on PPP is optional: Xác thực trên PPP là tùy chọn. Lệnh này bật chap trên interface, tùy chọn khác là PAP.
Router(config-if)#ppp authentication chap
Chọn kiểu LMI. Nếu kiểu LMI không được cấu hình đúng nó sẽ được phát hiện tự động.
Router(config-if)#frame-relay lmi-type cisco
Định tuyến tĩnh. Kiểu định tuyến tĩnh có Administrative Distance (AD) là 1, do đó nó sẽ ghi đè lên bất kỳ định tuyến động nào.
Router(config)#ip route 50.0.0.0 255.0.0.0
10.1.2.1
Enables RIP version 1 on all LOCAL interfaces which have a 10.x.x.x address: Bật RIP v1 trên tất cả LOCAL interfaces có địa chỉ la 10.x.x.x.
Enables RIP version 2: Bật RIP v2
Router(config)#router rip
Router(config-router)#network 10.0.0.0
Router(config-router)#version 2
Enable the router to provide a DHCP service: Thiết lập DHCP trên router.
Router(config)#ip dhcp pool MYPOOL
Router(dhcp-config)#network 10.1.1.0 255.255.255.0
Router(dhcp-config)#default-router 10.1.1.1 Router(dhcp-config)#exit
Router(config)#ip dhcp excluded-address 10.1.1.1 10.1.1.99
Thiết lập config register: Chỉ định việc router sẽ làm khi nó khởi động.
Router(config)#config-register 0x2102
Tạo sub logic interface dưới physical interface.
Kích hoạt 802.1q trunking trên interface.
Đặt địa chỉ IP.
Router(config)#int fa0/0.1
Router(config-subif)#encapsulation dot1Q 1
Router(config-subif)#ip address 10.1.1.1
255.255.255.0
Bật OSPF trên bất kỳ local interface nào bắt đầu bằng địa chỉ IP 10.1.x.x.
Router(config-)#router ospf 1
Router(config-router)#network 10.1.0.0
0.0.255.255 area 0
EIGRP có thể cấu hình giống với RIP hoặc sử dụng tùy chọn mask.
Router(config)#router eigrp 1
Router(config-router)#network 172.16.0.0 Or
Router(config-router)#network 172.16.2.0
0.0.0.255
Thiết lập chuẩn ACL. Chuẩn này sử dụng số từ 1 đến 99.
Router(config)#access-list 1 permit
172.16.1.1
Thiết lập Extended ACL. Địa chỉ đầu tiên là địa chỉ IP nguồn.
Router(config)#access-list 101 deny tcp host
172.16.1.1 host 172.16.2.1 eq telnet Router(config)#access-list 101 permit ip any any
Use the group command to attach an ACL to an interface: Sử dụng lệnh group để gắn ACL vào interface.
Router(config)#interface fa0/0
Router(config-if)#ip access-group 1 out
Ví dụ về sử dụng tên ACL thay vì số.
Router(config)#ip access-list extended my_list
Router(config-ext-nacl)# deny tcp host
172.16.1.1 host 172.16.2.1 eq ftp
Router(config-ext-nacl)# permit ip any any
Gán ACL cho interface bằng tên.
Router(config)#int fa0/0
Router(config-if)#ip access-group my_list in
Configuring a static NAT to allow a server to be access via the Internet, using the IP address on interface s0/0/1: Cấu hình NAT tĩnh để cho phép truy cập server qua Internet, sử dụng địa chỉ IP trên interface s0/0/1.
Router(config)#ip nat inside source static
10.1.1.2 interface s0/0/1
Defining interface which NAT takes place between: Xác định interface mà NAT xảy ra.
Router(config)#int fa0/0.1
Router(config-if)#ip nat inside
Enables RIPng: Bật RIPng
Router(config)#ipv6 unicast-routing
Router(config)#ipv6 router rip ccna
Router(config)#int s0/0/0
Router(config-if)#ipv6 rip ccna enable