Bước 1: Khởi tạo vlan và access vlan
1 default active Gi1/0/3, Gi1/0/5, Gi1/0/11, Gi1/0/12, Gi1/0/14, Gi1/0/16, Gi1/0/17
10 DMZ active
20 Code active Gi1/0/1
22 Data active Gi1/0/9
30 KinhDoanh active Gi1/0/18
40 WIFI_HeThong active
50 WIFI_KHACH active
101 FPT active Gi1/0/22
102 CMC active Gi1/0/23
Trunking: g1/0/3, g1/0/4, g1/0/7, g1/0/8
G1/0/11: allowed vlan 20,22,30,101,102,103
G1/0/7: Cắm vào wifi1
G1/0/8: Cắm vào wifi2
G1/0/4: Cắm ra server DC
G1/0/3: Cắm ra server
Bước 2: Cấu hình DHCP cho 3 phòng ban Code, data, KinhDoanh
ip dhcp excluded-address 192.168.4.1 192.168.4.50
ip dhcp excluded-address 192.168.8.1 192.168.8.50
ip dhcp excluded-address 192.168.12.1 192.168.12.50
ip dhcp excluded-address 10.0.1.1 10.0.1.20
!
ip dhcp pool LanCode
network 192.168.4.0 255.255.254.0
dns-server 8.8.8.8 8.8.4.4
default-router 192.168.4.10
!
ip dhcp pool LanData
network 192.168.8.0 255.255.254.0
default-router 192.168.8.10
dns-server 8.8.8.8 8.8.4.4
!
ip dhcp pool LanKinhDoanh
network 10.0.1.0 255.255.255.0
dns-server 8.8.8.8 8.8.4.4
default-router 10.0.1.10
Bước 3: Khởi tạo access-list
ip access-list extended Code_to_DC
permit ip 192.168.4.0 0.0.1.255 172.22.0.0 0.0.255.255
ip access-list extended Code_to_Local
permit ip 192.168.4.0 0.0.1.255 192.168.100.0 0.0.1.255
ip access-list extended Code_to_internet
permit ip 192.168.4.0 0.0.1.255 any
ip access-list extended Data_to_DC
permit ip 192.168.8.0 0.0.1.255 172.22.1.0 0.0.0.255
ip access-list extended Data_to_Internet
permit ip 192.168.8.0 0.0.1.255 any
ip access-list extended Data_to_Local
permit ip 192.168.8.0 0.0.1.255 192.168.4.0 0.0.1.255
permit ip 192.168.8.0 0.0.1.255 192.168.100.0 0.0.1.255
ip access-list extended KinhDoanh_to_internet
permit ip 10.0.1.0 0.0.0.255 any
ip access-list extended Server_to_Local
permit ip 192.168.100.0 0.0.1.255 192.168.4.0 0.0.1.255
Bước 4: Khởi tạo route map
route-map server permit 20
match ip address Server_to_Local
- Server chỉ có 1 đường định tuyến tới Local
route-map Code permit 20
match ip address Code_to_Local
!
route-map Code permit 21
match ip address Code_to_DC
!
route-map Code permit 100
match ip address Code_to_internet
set ip next-hop 192.168.200.1
- Phòng ban Code có 3 đường đi, tới Local, DC và internet
route-map Data permit 20
match ip address Data_to_Local
!
route-map Data permit 21
match ip address Data_to_DC
!
route-map Data permit 100
match ip address Data_to_internet
set ip next-hop 192.168.200.1
- Phòng ban Data có 3 đường đi, tới Local, DC và internet
route-map KinhDoanh permit 100
match ip address KinhDoanh_to_internet
set ip next-hop 10.0.0.1
- Phòng ban KinhDoanh chỉ ra internet
Bước 5: Đặt default gateway cho Vlan và gán route map tương ứng
interface Vlan1
description This is intergace Vlan 1
ip address 192.168.100.10 255.255.254.0
ip policy route-map server
!
interface Vlan20
ip address 192.168.4.10 255.255.254.0
ip policy route-map Code
!
interface Vlan22
ip address 192.168.8.10 255.255.254.0
ip policy route-map Data
!
interface Vlan30
ip address 10.0.1.10 255.255.255.0
ip policy route-map KinhDoanh