Upload
lee-jun
View
235
Download
0
Embed Size (px)
Citation preview
Ôn tập ANM (Thực Hành)
1. Cabling and subnetting the topology.
* Gắn thiết bị và nối dây
- Router 2811
+ HCM gắn thêm WIC-2T và NM-1FE-TX
+ Router0 gắn thêm WIC-2T
- Switch 2960
- End devices : PC, Laptop, Server
- Wireless devices : Linksys-WRT300N
- WAN Emulation : Cloud, DSL-modem
Copper Straight: nối theo sơ đồ và vlan phù hợp
Serial DCE: giữa hai cổng serial của HCM và Router0
Phone: giữa hai cổng modem của Cloud và DSL
Nối dây thẳng giữa FE của HCM và E của Cloud
* Chia mạng con:
172.20.0.0/16
DMZ, 10 host, 172.20.4.224/28
VLAN100, 1000 hosts, 172.20.0.0/22
VLAN200, 120 hosts, 172.20.4.0/25
VLAN300, 50 hosts, 172.20.4.128/26
VLAN99, 192.168.99.0/29
WLAN, 20 host, 172.20.4.192/27
WAN: 172.20.4.240/30
2. Configure VLANs as required and Inter-VLAN routing.
* Tạo vlan:
SWA(config)#vlan 100
SWA(config-vlan)#name Student
Tương tự cho 200, 300 và 99.
* Gán các vlan vào cổng.
Đối với cổng access:
SWA (config)#interface range f0/5-f0/15
SWA (config-if-range)#switchport mode access
SWA (config-if-range)#switchport access vlan 100
Tương tự cho 200 và 300
Đối với cổng trunk:
SWA (config)#interface range f0/1-f0/4
SWA (config-if-range)#switchport mode trunk
SWA (config-if-range)#switchport trunk native vlan 99
* Cấu hình Inter-Vlan
Bật cổng F0/1
HCM(config)#interface f0/1
HCM(config-if)#no shutdown
HCM(config-if)#exit
Tạo subif cho vlan quản lý cổng access
HCM(config)#interface f0/1.100
HCM(config-subif)#encapsulation dot1Q 100
HCM(config-subif)#ip address 172.20.0.1 255.255.252.0
Tương tự 200 và 300
Tạo subif cho vlan quản lý cổng trunk
HCM(config)#interface f0/1.99
HCM(config-subif)#encapsulation dot1Q 99 native
HCM(config-subif)#ip address 192.168.99.1 255.255.255.248
3. Configure EIGRP routing protocol.
Sau khi đã đặt IP cho tất cả các cổng còn lại của tất cả Router và các thiết bị khác
trên sơ đồ, show ip route để thấy được các đường C kết nối trực tiếp của Router rồi
ta tiến hành cấu hình EIGRP
Trên HCM (không tính đường ra Internet)
HCM(config)#router eigrp 1
HCM(config-router)# no auto-summary
HCM(config-router)# network 172.20.0.0 0.0.3.255
HCM(config-router)# network 172.20.4.0 0.0.0.127
HCM(config-router)# network 172.20.4.128 0.0.0.63
HCM(config-router)# network 172.20.4.224 0.0.0.15
HCM(config-router)# network 172.20.4.240 0.0.0.3
HCM(config-router)# network 192.168.99.0 0.0.0.7
Trên Router0
Router0 (config)#router eigrp 1
Router0 (config-router)# no auto-summary
Router0 (config-router)# network 172.20.4.192 0.0.0.31
Router0 (config-router)# network 172.20.4.240 0.0.0.3
4. Configure default route for the Internet connection.
Giữa HCM và TD sau khi đã nối dây ta vào Cloud để nối chúng lại.
Cấu hình Router
Trên HCM:
HCM(config)#ip route 0.0.0.0 0.0.0.0 200.200.1.2
HCM(config)#router eigrp 1
HCM(config-router)#redistribute static
Trên TD:
TD(config)#ip route 0.0.0.0 0.0.0.0 200.200.1.1 IP F1/0 HCM
IP F0/0 TD
5. Basic router secure configure for HCM router
a. Configure password min length: 6 characters
HCM(config)#security passwords min-length 6
b. Configure enable secret for router: cisco456
HCM(config)#enable secret cisco456
c. Encrypt all password stored on routers
HCM(config)#service password-encryption
d. Exec-timeout for console line and vty line : 30 seconds
HCM(config)#line console 0
HCM(config-line)#exec-timeout 0 30 (0 phút 30 giây)
HCM(config)#line vty 0 4
HCM(config-line)#exec-timeout 0 30
e. Disable unnecessary services : CDP, DNS lookup, Telnet router
HCM(config)#no cdp run
HCM(config)#no ip domain-lookup
HCM(config)#line vty 0 4
HCM(config-line)#no transport input telnet
6. Basis the LAN security on
a. Shutdown all unused ports. (Làm được trên mọi Switch)
Tắt các cổng không sử dụng trên switch.
(config)#interface f0/?
(config-if)#shutdown
Hoặc
(config)#interface range f0/?-f0/?
(config-if-range)#shutdown
b. Prevent MAC address table overflow attacks. (Làm được trên mọi Switch)
Cấu hình port security, tương tự như câu a có thể làm trên 1 cổng hay nhiều cổng
một lúc.
(config-if-range)#switchport mode access
(config-if-range)#switchport port-security
(config-if-range)#switchport port-security maximum 2 (Tối đa lưu 2 địa chỉ MAC)
(config-if-range)#switchport port-security mac-address sticky
(config-if-range)#switchport port-security violation shutdown
c. Prevent STP attack. (Chỉ làm được trên Switch có cổng trunk, vd SWA)
SWA (config)#interface range f0/1-f0/4
SWA (config-if-range)#spanning-tree bpduguard enable
d. Prevent VLAN attack. (Chỉ làm được trên Switch có cổng trunk, vd SWA)
SWA (config)#interface range f0/1-f0/4
SWA (config-if-range)#switchport nonegotiate
7. Configure AAA server based authentication to restrict router login
access on HCM
HCM(config)#aaa new-model
- Create the local backup account
HCM(config)#username backup password backup
- Method list for line console: Radius– Tacas+ -- Local
HCM(config)#aaa authentication login CONSOLE group radius group tacacs+
local
HCM(config)#tacacs-server host 172.20.4.130 key ccna
HCM(config)#line console 0
HCM(config-line)#login authentication CONSOLE
Tại Tacacs Server -> Thẻ Config -> Service AAA
- Method list for vty console : Tacas+ -- Local
HCM(config)#aaa authentication login VTY group tacacs+ local
HCM(config)#radius-server host 172.20.4.131 key ccna
HCM(config)#line vty 0 4
HCM(config-line)#login authentication VTY
Tại Radius Server -> Thẻ Config -> Service AAA
8. Basic WLAN secure configuration
a. SSID : Practice
b. Security: WPA2 – enterprise.
c. Encryption : AES
d. Share key : wireless
Tại Radius Server -> Thẻ Config -> Service AAA
Lấy một laptop đã gắn card wireless, vào thẻ Config -> Interface wireless0
Tới đây ta sẽ save bài lại thành 2 file Part1 và Part2 để làm riêng 2 câu tiếp
theo.
Part 1
9. Configure Site-to-Site IPsec VPN between VLAN100, VLAN 200 at
HCM site and LAN at TD site
Tại HCM
HCM(config)# access-list 199 permit ip 172.20.0.0 0.0.3.255 195.1.1.0 0.0.0.255
HCM(config)# access-list 199 permit ip 172.20.4.0 0.0.0.127 195.1.1.0 0.0.0.255
Tại TD
TD(config)# access-list 199 permit ip 195.1.1.0 0.0.0.255 172.20.0.0 0.0.3.255
TD(config)# access-list 199 permit ip 195.1.1.0 0.0.0.255 172.20.4.0 0.0.0.127
a. Isakmp policy: AES – PSK – MD5 – group 2
Tại HCM
HCM(config)#crypto isakmp enable
HCM(config)#crypto isakmp policy 10
HCM(config-isakmp)#encryption aes
HCM(config-isakmp)#authentication pre-share
HCM(config-isakmp)#hash md5
HCM(config-isakmp)#group 2
HCM(config)#crypto isakmp key vnp address 200.200.1.2
Tại TD
TD (config)#crypto isakmp enable
TD (config)#crypto isakmp policy 10
TD (config-isakmp)#encryption aes
TD (config-isakmp)#authentication pre-share
TD (config-isakmp)#hash md5
TD (config-isakmp)#group 2
TD(config)#crypto isakmp key vnp address 200.200.1.1
b. IPsec transform set: ESP- 3DES and ESP- MD5- HMAC
Tại HCM
HCM(config)#crypto ipsec transform-set NET esp-3des esp-md5-hmac
Tại TD
HCM(config)#crypto ipsec transform-set NET esp-3des esp-md5-hmac
c. Crypto map : VPN_ONTAP
Tại HCM
HCM(config)#crypto map VPN_ONTAP 10 ipsec-isakmp
HCM(config-crypto-map)# match address 199
HCM(config-crypto-map)# set peer 200.200.1.2
HCM(config-crypto-map)# set transform-set NET
HCM(config-crypto-map)# set pfs group2
Tại TD
TD (config)#crypto map VPN_ONTAP 10 ipsec-isakmp
TD (config-crypto-map)# match address 199
TD (config-crypto-map)# set peer 200.200.1.1
TD (config-crypto-map)# set transform-set NET
TD (config-crypto-map)# set pfs group2
Part 2
10. Configure CBAC firewall on HCM site to:
a. Allow user from VLAN100, VLAN200 to access the Internet by any TCP, UDP,
ICMP services.
HCM(config)#ip access-list extended Cau9a
HCM(config-ext-nacl)# permit ip 172.20.0.0 0.0.3.255 195.1.1.0 0.0.0.255
HCM(config-ext-nacl)# permit ip 172.20.4.0 0.0.0.127 195.1.1.0 0.0.0.255
HCM(config-ext-nacl)# deny ip any any
HCM(config)#interface f1/0
HCM(config-if)#ip access-group Cau9a out
b. Allow user from the Internet to access to DNZ Zone by any services.
c. Deny users from the Internet to access VLAN 100, VLAN 200, VLAN 300.
HCM(config)#ip access-list extended Cau9bc
HCM(config-ext-nacl)#permit ip 195.1.1.0 0.0.0.255 172.20.4.224 0.0.0.15
HCM(config-ext-nacl)#deny ip any any
HCM(config)#interface f1/0
HCM(config-if)#ip access-group Cau9bc in
Tạo CBAC firewall (Chỉ có thể gán CBAC Firewall trên cổng FastEthernet)
HCM(config)#ip inspect audit-trail
HCM(config)#ip inspect name CBAC tcp
HCM(config)#ip inspect name CBAC udp
HCM(config)#ip inspect name CBAC icmp
HCM(config)#interface f1/0
HCM(config-if)#ip inspect CBAC in (Dành cho câu 9b & 9c)
HCM(config-if)#ip inspect CBAC out (Dành cho câu 9a)
Một số vấn đề khác
1. Cấu hình SSH (Làm được trên Router và Switch)
(config)#username ssh password ssh
(config)#ip domain-name ssh.com
(config)#crypto key generate rsa
Enter
(config)#line vty 0 4 (0 15 đối với switch)
(config-line)#transport input ssh
(config-line)#login local
PC vào Command Prompt, gõ lệnh sau để kiểm tra
ssh –l [username] [IP Router/Switch]
Nhập password
2. Đóng kết nối và khóa tài khoản khi đăng nhập sai nhiều lần
Restrict the access to 2 times, within 1 minutes and block for 20 seconds
(config)#username Long password 0712
(config)#login block-for 20 attempts 2 within 60
(config)#line vty 0 4
(config-line)#login local
3. Recovery password configuration (Phục hồi mật khẩu enable)
Khởi động lại Router: Power Off -> On
Trong khi khởi động nhấn Ctrl + C
rommon 1 >confreg 0x2142 (để khởi động bằng bộ nhớ RAM)
rommon 1 >reset
---
>enable
#copy startup-config running-config
Đổi lại pass enable tùy ý
(config)#config-register 0x2102 (để khởi động bằng bộ nhớ NVRAM)
#write
#reload
4. Cấu hình PAP/CHAP
PAP
Tại R1
R1(config)#username R2 password 456
R1(config)#interface s0/0/0
R1(config-if)#ip address 200.200.200.1 255.255.255.252
R1(config-if)#no shutdown
R1(config-if)#clock rate 64000
R1(config-if)#encapsulation ppp
R1(config-if)#ppp authentication pap
R1(config-if)#ppp pap sent-username R1 password 123
Tại R2
R2(config)#username R1 password 123
R2(config)#interface s0/0/0
R2(config-if)#ip address 200.200.200.2 255.255.255.252
R2(config-if)#no shutdown
R2(config-if)#encapsulation ppp
R2(config-if)#ppp authentication pap
R2(config-if)#ppp pap sent-username R2 password 456
CHAP
Tại R1
R1(config)#username R2 password cisco
R1(config)#interface s0/0/0
R1(config-if)#ip address 200.200.200.1 255.255.255.252
R1(config-if)#no shutdown
R1(config-if)#clock rate 64000
R1(config-if)#encapsulation ppp
R1(config-if)#ppp authentication chap
Tại R2
R2(config)#username R2 password cisco
R2(config)#interface s0/0/0
R2(config-if)#ip address 200.200.200.2 255.255.255.252
R2(config-if)#no shutdown
R2(config-if)#encapsulation ppp
R2(config-if)#ppp authentication chap
Kiểm tra bằng câu lệnh
#show ip interface brief
5. Frame relay (no sub-interface)
Tại Cloud FR
Tại R1
R1(config)#interface s0/0/0
R1(config-if)#ip address 200.200.200.1 255.255.255.252
R1(config-if)#encapsulation frame-relay
R1(config-if)#frame-relay map ip 200.200.200.2 407 broadcast cisco
R1(config-if)#no shutdown
Tại R2
R2(config)#interface s0/0/0
R2(config-if)#ip address 200.200.200.2 255.255.255.252
R2(config-if)#encapsulation frame-relay
R2(config-if)#frame-relay map ip 200.200.200.1 704 broadcast cisco
R2(config-if)#no shutdown
6. Configure the Router with :
- Generate system logging messages for both successful and failed login.
(config)#login on-success
(config)#login on-failure
- Logging by Syslog server
(config)#logging host [IP Syslog Server]
(config)#logging trap debugging
(config)#logging on
- Timing with NTP server
(config)#ntp server [IP NTP Server]
(config)#ntp update-calendar
#show clock
7. Configure Roles base CLI
(config)#aaa new-model
(config)#enable secret [pass]
#disable
Root view : all commands
#enable view
Nhập pass đã khai bao ở trên để vào Root
- Tạo các show theo yêu câu sau khi đã vào Root
(config)#parser view [Name]
- Tạo pass cho view
(config-view)#secret [pass]
- Phân quyền
(config-view)#commands [các mode tương ứng] include [câu lệnh]/all [lệnh gốc]
Các mode:
Exec mode #
Global configuration mode (config)#
Interface configuration mode (config-if)#
Line configuration mode (config-line)#
Router configuration mode (config-router)#
-- Good Luck --