/*auto readmore*/ /*auto readmore*/ /* an hien script*/ // an hien password /*an hien ma chuong trinh cong tru */ /*Scrollbox thanh cuon*/ /***Nhung CODE***/ /* dòng xanh dòng trắng */ /* https://cdnjs.com/libraries/prism lay thu vien, can vao ten file ma goi 1. copy link vao vi du:prism-python.min.js 2. ten ngon nua la python */ /*=== New posts ===*/ /*header slider*/ /*=== bai viet lien quan===*/ /*===tabcode===*/

Mô Hình Mạng Cho Các Doanh Nghiệp Vừa & Nhỏ - Bài 1

Sơ đồ bài lab:


Các kiến thức sử dụng trong bài: Spanning tree, VLAN, Trunking, Router on a stick, Access List, NAT, DHCP, Static route

YÊU CẦU:
1. Cấu hình ban đầu:
  • Đặt IP cho các thiết bị như hình, gồm: router ISP, Router, HR server, Web Server
  • Sw_01: Cấu hình port trunk, tạo các vlan và gán các port access vào VLAN tương ứng như sơ đồ.
  • ISP: Cấu hình cấp dãy IP 200.0.21.128/29 về cho Router (dùng static route)
  • DHCP server trên Router để cấp IP cho các VLAN 101, VLAN 102, VLAN 103
2. Cấu hình NAT trên Router:
  • Static NAT: Đảm bảo các địa chỉ trên Internet có thể truy cập vào:
               + Web server 192.168.100.12 thông qua IP Public là 200.0.21.129
               + Port 23 (telnet) của HR server 192.168.100.11 thông qua IP public 200.0.21.130
  • Dynamic NAT để các IP 192.168.101.1 đến 192.168.101.4 có thể ra internet và dùng dãy IP public là 200.0.21.131 đến 200.0.21.134
  • NAT overload/PAT: 
                 + HR Server được phép truy cập web ngoài internet. Các giao thức khác cấm.
                 + Cấu hình đảm bảo tất cả các PC (ngoại trừ các IP 192.168.101.1-192.168.101.3), Server (ngoại trừ IP từ 192.168.100.11-12) có thể truy cập được internet (ping 8.8.8.8 thành công) với IP đấu nối trên cổng Et0/0 hiện tại, ngoại trừ VLAN 101: 192.168.101.0/24.
               
3. Cấu hình Access-List trên Router sao cho:
* Standard ACL:
  • Cấm VLAN 102 truy câp vào VLAN 103 (gán theo chiều out của interface Et0/3.103)
  • Cấm VLAN 103 truy câp vào VLAN 102 (gán theo chiều out của interface Et0/3.102)
  • Gán theo chiều out của interface Et0/3.101 với yêu cầu:
  •          + Cho phép các IP từ 192.168.102.1 đến 192.168.102.31 có thể truy cập trên VLAN 101 (còn lại cấm)
             + Cho phép các IP từ 192.168.103.240 đến 192.168.103.255 có thể truy cập trên VLAN 101 (còn lại cấm)
  • Gán theo chiều in của cổng line VTY với yêu cầu:
         + Cho phép tất cả IP trong vlan 101 có thể truy vào Router bằng đường theo telnet
         + Cho tất cả các IP lẻ trong dãy IP từ 192.168.102.1 đến 192.168.102.127 của vlan 102 có thể telnet đến được Router
         + Cho phép duy nhất ip 192.168.100.11 (HR server) trong lớp mạng 192.168.100.0/24 có thể truy cập vào router bằng telnet.
         + Những trường hợp còn lại không được phép

*Extended ACL:
  • Cho phép tất cả các host có  thể truy cập vào web server 192.168.100.12 bằng port 80
  • Cấm tất các traffic xuất phát từ vlan 102, vlan 103 truy cấp đến web server - 192.168.100.12
  • Cho phép vlan 101 có thể truy cập đến web server -192.168.100.12
  • Cho phép VLAN 101, VLAN 103 có thể truy cập đến HR server - 192.168.100.11 bằng port 80
  • Cho phép các IP chẵn trong dãy từ 192.168.101.240 đến 192.168.101.255 có thể truy cập vào HR_Server: 192.168.100.11
  • Cho phép mọi traffic của VLAN 102 có thể truy cập đến HR server - 192.168.100.11
  • Các traffic còn lại của VLAN 101, VLAN 103 đến HR server -192.168.100.11 sẽ bị cấm
  • Còn lại được phép.
  • Chỉ viết 1 ACL này được phép gán vào cổng Et0/1 theo chiều out của Router.

THỰC HIỆN:

 1. Cấu hình ban đầu:
  • Đặt IP cho các thiết bị như hình, gồm: router ISP, Router, HR server, Web Server
ISP:
interface Loopback0
 ip address 8.8.8.8 255.255.255.255
exit
interface Ethernet0/0
no shutdown
 ip address 100.0.12.1 255.255.255.252
end
write

Router:
interface Ethernet0/0
 ip address 100.0.12.2 255.255.255.252
interface Ethernet0/3
no shutdown
 no ip address
interface Ethernet0/1
 ip address 192.168.100.254 255.255.255.0
no shutdown
interface Ethernet0/3.101
 encapsulation dot1Q 101
 ip address 192.168.101.254 255.255.255.0
interface Ethernet0/3.102
 encapsulation dot1Q 102
 ip address 192.168.102.254 255.255.255.0
interface Ethernet0/3.103
 encapsulation dot1Q 103
 ip address 192.168.103.254 255.255.255.0
exit
!
ip route 0.0.0.0 0.0.0.0 100.0.12.1
end
write

Sw_02:
hostname Sw_02
spanning-tree portfast default
do write
Cấu hình để cho các Server cắm vào switch là chuyển sang trạng thái forward dữ liệu liền, bỏ qua bước chờ thời 30-50 giây của spanning tree


HR_server (dùng router để giả lập):
interface Ethernet0/0
no shutdown
ip address 192.168.100.11 255.255.255.0
ip route 0.0.0.0 0.0.0.0 192.168.100.254
do write

Web_server (dùng router để giả lập):
interface Ethernet0/0
no shutdown
ip address 192.168.100.12 255.255.255.0
ip route 0.0.0.0 0.0.0.0 192.168.100.254
do write

  • Sw_01: Cấu hình port trunk, tạo các vlan và gán các port access vào VLAN tương ứng như sơ đồ.
* Cấu hình:
Sw_01:
interface Ethernet0/3
 switchport trunk encapsulation dot1q
 switchport mode trunk
exit
!
vlan 101
name ITDept.
name ===ITDept.===
exit
vlan 102
name ===HRDept.===
exit
vlan 103
name ===SalesDept.===
exit
!
interface ethernet 2/0
switchport mode access
switchport access vlan 101
exit
interface range ethernet 0/0-1
switchport mode access
switchport access vlan 102
exit
interface range ethernet 1/0-1
switchport mode access
switchport access vlan 103
end
write
* Kiểm tra:
Sw_01#show interfaces trunk 
Port        Mode             Encapsulation  Status        Native vlan
Et0/3       on                 802.1q              trunking      1
Port        Vlans allowed on trunk
Et0/3       1-4094
Port        Vlans allowed and active in management domain
Et0/3       1,101-103
Port        Vlans in spanning tree forwarding state and not pruned
Et0/3       1,101-103

Đường kết nối giữa switch và Router đang ở trạng thái trunking

Sw_01#show vlan brief
VLAN Name                                Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                                      active    Et0/2, Et1/2, Et1/3, Et2/1
                                                                     Et2/2, Et2/3
101  ===ITDept.===                      active    Et2/0
102  ===HRDept.===                    active    Et0/0, Et0/1
103  ===SalesDept.===                 active    Et1/0, Et1/1

1002 fddi-default                            act/unsup
1003 token-ring-default                  act/unsup
1004 fddinet-default                        act/unsup
1005 trnet-default                            act/unsup

Các cổng đã gán vào vlan tương ứng đúng yêu cầu đề bài.

  • ISP: Cấu hình cấp dãy IP 200.0.21.128/29 về cho Router (dùng static route)
ISP:
ip route 200.0.21.128 255.255.255.248 100.0.12.2

  • DHCP server trên Router để cấp IP cho các VLAN 101, VLAN 102, VLAN 103
*Cấu hình:
Router:
ip dhcp pool ===ITDept.===
network 192.168.101.0 255.255.255.0
default-router 192.168.101.254
exit
ip dhcp pool ===HRDept.===
network 192.168.102.0 255.255.255.0
default-router 192.168.102.254
exit
ip dhcp pool ===SalesDept.===
network 192.168.103.0 255.255.255.0
default-router 192.168.103.254
end
write

*Kiểm tra:
IT_01> dhcp
DDORA IP 192.168.101.1/24 GW 192.168.101.254

IT_01> ping 192.168.101.254
84 bytes from 192.168.101.254 icmp_seq=1 ttl=255 time=0.674 ms
84 bytes from 192.168.101.254 icmp_seq=2 ttl=255 time=0.830 ms
84 bytes from 192.168.101.254 icmp_seq=3 ttl=255 time=0.953 ms
84 bytes from 192.168.101.254 icmp_seq=4 ttl=255 time=0.753 ms
84 bytes from 192.168.101.254 icmp_seq=5 ttl=255 time=0.759 ms

HR_01> dhcp
DDORA IP 192.168.102.1/24 GW 192.168.102.254
HR_01> ping 192.168.102.254
84 bytes from 192.168.102.254 icmp_seq=1 ttl=255 time=0.683 ms
84 bytes from 192.168.102.254 icmp_seq=2 ttl=255 time=0.910 ms
84 bytes from 192.168.102.254 icmp_seq=3 ttl=255 time=1.409 ms
84 bytes from 192.168.102.254 icmp_seq=4 ttl=255 time=0.795 ms
84 bytes from 192.168.102.254 icmp_seq=5 ttl=255 time=0.795 ms

HR_02> dhcp
DDORA IP 192.168.102.2/24 GW 192.168.102.254
HR_02> ping 192.168.102.254
84 bytes from 192.168.102.254 icmp_seq=1 ttl=255 time=1.077 ms
84 bytes from 192.168.102.254 icmp_seq=2 ttl=255 time=0.888 ms
84 bytes from 192.168.102.254 icmp_seq=3 ttl=255 time=0.935 ms
84 bytes from 192.168.102.254 icmp_seq=4 ttl=255 time=1.094 ms
84 bytes from 192.168.102.254 icmp_seq=5 ttl=255 time=1.101 ms

Sal_01> dhcp
DDORA IP 192.168.103.1/24 GW 192.168.103.254
Sal_01> ping 192.168.103.254
84 bytes from 192.168.103.254 icmp_seq=1 ttl=255 time=0.830 ms
84 bytes from 192.168.103.254 icmp_seq=2 ttl=255 time=0.783 ms
84 bytes from 192.168.103.254 icmp_seq=3 ttl=255 time=1.487 ms
84 bytes from 192.168.103.254 icmp_seq=4 ttl=255 time=0.931 ms
84 bytes from 192.168.103.254 icmp_seq=5 ttl=255 time=0.964 ms

Sal_02> dhcp
DDORA IP 192.168.103.2/24 GW 192.168.103.254
Sal_02> ping 192.168.103.254
84 bytes from 192.168.103.254 icmp_seq=1 ttl=255 time=1.001 ms
84 bytes from 192.168.103.254 icmp_seq=2 ttl=255 time=1.080 ms
84 bytes from 192.168.103.254 icmp_seq=3 ttl=255 time=1.142 ms
84 bytes from 192.168.103.254 icmp_seq=4 ttl=255 time=0.970 ms
84 bytes from 192.168.103.254 icmp_seq=5 ttl=255 time=0.930 ms

2. Cấu hình NAT trên Router: 
  • Static NAT: Đảm bảo các địa chỉ trên Internet có thể truy cập vào:
                 Web server 192.168.100.12 thông qua IP Public là 200.0.21.129             

*Cấu hình:
Router:
interface Ethernet0/0
ip nat outside
exit
interface Ethernet0/1
ip nat inside
exit
ip nat inside source static 192.168.100.12 200.0.21.129

*Kiểm tra:
Router#clear ip nat translation *
Router#show ip nat translations 
Pro Inside global      Inside local       Outside local      Outside global
--- 200.0.21.129       192.168.100.12     ---                ---

Bảng NAT trên Router đã match IP 200.0.21.129 cho IP 192.168.100.12
ISP#ping 200.0.21.129
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 200.0.21.129, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/2 ms
Từ router ISP đã ping vào IP public 200.0.21.129 thành công
WEB-Server#ping 8.8.8.8
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/2 ms

Web Server đã ping được 8.8.8.8

                  Port 23 (telnet) của HR server 192.168.100.11 thông qua IP public 200.0.21.130
* Cấu hình:
HR Server: (enable telnet không cần password để test)
line vty 0 4
 privilege level 15
 no login
 transport input all

Router: 
ip nat inside source static tcp 192.168.100.11 23 200.0.21.130 23 extendable

*Kiểm tra:

ISP#telnet 200.0.21.130
Trying 200.0.21.130 ... Open 

Từ ISP telnet thành công

Router#sh ip nat translations   
Pro Inside global         Inside local              Outside local      Outside global
tcp 200.0.21.130:23    192.168.100.11:23    ---                ---
--- 200.0.21.129          192.168.100.12         ---                ---


IP 200.0.21.130 đã map vào IP của máy HR server - 192.168.100.11 và sử dụng TCP port 23
  • Dynamic NAT để các IP 192.168.101.1 đến 192.168.101.3 có thể ra internet và dùng dãy IP public là 200.0.21.131 đến 200.0.21.133
* Cấu hình
Router:
access-list 1 permit 192.168.101.0 0.0.0.3
ip nat pool IT_Depl_101.1-3 200.0.21.131 200.0.21.133 prefix-length 29
ip nat inside source list 1 pool IT_Depl_101.1-3
exit
interface Ethernet0/3.101
ip nat inside
end
write

* Kiểm tra

IT_01> ping 8.8.8.8
84 bytes from 8.8.8.8 icmp_seq=1 ttl=254 time=1.742 ms
84 bytes from 8.8.8.8 icmp_seq=2 ttl=254 time=1.289 ms
84 bytes from 8.8.8.8 icmp_seq=3 ttl=254 time=1.392 ms
84 bytes from 8.8.8.8 icmp_seq=4 ttl=254 time=1.168 ms
84 bytes from 8.8.8.8 icmp_seq=5 ttl=254 time=1.274 ms

VLAN 101, IT_01 đã ping đến 8.8.8.8 thành công

Router#show ip nat translations 
Pro Inside global      Inside local       Outside local      Outside global
--- 200.0.21.129       192.168.100.12     ---                ---
icmp 200.0.21.131:62387 192.168.101.1:62387 8.8.8.8:62387    8.8.8.8:62387
icmp 200.0.21.131:62643 192.168.101.1:62643 8.8.8.8:62643    8.8.8.8:62643
icmp 200.0.21.131:62899 192.168.101.1:62899 8.8.8.8:62899    8.8.8.8:62899
icmp 200.0.21.131:63155 192.168.101.1:63155 8.8.8.8:63155    8.8.8.8:63155
icmp 200.0.21.131:63411 192.168.101.1:63411 8.8.8.8:63411    8.8.8.8:63411
--- 200.0.21.131       192.168.101.1      ---                ---

Show bảng NAT thấy IP 192.168.101.1 kết nối với 8.8.8.8 bằng IP public 200.0.21.131

Router:
clear ip nat translation *

IT_01> ip 192.168.101.3/24 192.168.101.254
Checking for duplicate address...
PC1 : 192.168.101.3 255.255.255.0 gateway 192.168.101.254

IT_01> ping 8.8.8.8
84 bytes from 8.8.8.8 icmp_seq=1 ttl=254 time=2.706 ms
84 bytes from 8.8.8.8 icmp_seq=2 ttl=254 time=1.602 ms
84 bytes from 8.8.8.8 icmp_seq=3 ttl=254 time=1.195 ms
84 bytes from 8.8.8.8 icmp_seq=4 ttl=254 time=1.249 ms
84 bytes from 8.8.8.8 icmp_seq=5 ttl=254 time=1.514 ms

Đặt IP tĩnh cho IT_01 là 192.168.101.3 và ping đến 8.8.8.8 cũng thành công

Router#show ip nat translations  
Pro Inside global      Inside local       Outside local      Outside global
--- 200.0.21.129       192.168.100.12     ---                ---
icmp 200.0.21.133:37816 192.168.101.3:37816 8.8.8.8:37816    8.8.8.8:37816
icmp 200.0.21.133:38072 192.168.101.3:38072 8.8.8.8:38072    8.8.8.8:38072
icmp 200.0.21.133:38328 192.168.101.3:38328 8.8.8.8:38328    8.8.8.8:38328
icmp 200.0.21.133:38584 192.168.101.3:38584 8.8.8.8:38584    8.8.8.8:38584
icmp 200.0.21.133:38840 192.168.101.3:38840 8.8.8.8:38840    8.8.8.8:38840
--- 200.0.21.133       192.168.101.3      ---                ---
Show bảng NAT thấy IP 192.168.101.3 kết nối với 8.8.8.8 bằng IP public 200.0.21.133
  • NAT overload/PAT: 
           HR Server được phép truy cập web ngoài internet. Các giao thức khác cấm.
           +  Cấu hình đảm bảo tất cả các PC (ngoại trừ các IP 192.168.101.1-192.168.101.3), Server (ngoại trừ IP từ 192.168.100.11-12) có thể truy cập được internet (ping 8.8.8.8 thành công) với IP đấu nối trên cổng Et0/0 hiện tại, ngoại trừ VLAN 101: 192.168.101.0/24.

* Cấu hình:

ISP: enable http giả lập web server bên ngoài để server HR truy cập test
ip http server
           
Router:
ip access-list extended NATOverload
permit tcp host 192.168.100.11 any eq www
deny ip 192.168.101.0 0.0.0.3 any
deny ip host 192.168.100.11 any
deny ip host 192.168.100.12 any
permit ip 192.168.101.0 0.0.0.255 any
permit ip 192.168.102.0 0.0.0.255 any
permit ip 192.168.103.0 0.0.0.255 any
deny ip any any
!
ip nat inside source list NATOverload interface Ethernet0/0 overload
exit
!
interface Ethernet0/3.102
ip nat inside
exit
interface Ethernet0/3.103
ip nat inside
end
write

Giải thích ACL: vì các host 192.168.101.1-3; 192.168.100.11, 192.168.100.12 đã NAT ở câu trước nên trong ACL NATOverload phải bị cấm để không bị ảnh hưởng đến việc NAT trước đó.

*Kiểm tra


Router:
clear ip nat translation *
HR_01> ping 8.8.8.8 
84 bytes from 8.8.8.8 icmp_seq=1 ttl=254 time=1.555 ms
84 bytes from 8.8.8.8 icmp_seq=2 ttl=254 time=1.399 ms
84 bytes from 8.8.8.8 icmp_seq=3 ttl=254 time=1.282 ms
84 bytes from 8.8.8.8 icmp_seq=4 ttl=254 time=1.501 ms
84 bytes from 8.8.8.8 icmp_seq=5 ttl=254 time=1.453 ms
Sal_02> ping 8.8.8.8
84 bytes from 8.8.8.8 icmp_seq=1 ttl=254 time=1.644 ms
84 bytes from 8.8.8.8 icmp_seq=2 ttl=254 time=1.822 ms
84 bytes from 8.8.8.8 icmp_seq=3 ttl=254 time=1.245 ms
84 bytes from 8.8.8.8 icmp_seq=4 ttl=254 time=1.515 ms
84 bytes from 8.8.8.8 icmp_seq=5 ttl=254 time=2.055 ms

Các PC ở VLAN 102, VLAN 103 có thể ping đến 8.8.8.8 thành công

Router#show ip nat translations 
Pro Inside global      Inside local       Outside local      Outside global
--- 200.0.21.129       192.168.100.12     ---                ---
icmp 100.0.12.2:5823   192.168.102.1:5823 8.8.8.8:5823       8.8.8.8:5823
icmp 100.0.12.2:6079   192.168.102.1:6079 8.8.8.8:6079       8.8.8.8:6079
icmp 100.0.12.2:6335   192.168.102.1:6335 8.8.8.8:6335       8.8.8.8:6335
icmp 100.0.12.2:6591   192.168.102.1:6591 8.8.8.8:6591       8.8.8.8:6591
icmp 100.0.12.2:1024   192.168.102.1:6847 8.8.8.8:6847       8.8.8.8:1024
icmp 100.0.12.2:6847   192.168.103.2:6847 8.8.8.8:6847       8.8.8.8:6847
icmp 100.0.12.2:7103   192.168.103.2:7103 8.8.8.8:7103       8.8.8.8:7103
icmp 100.0.12.2:7359   192.168.103.2:7359 8.8.8.8:7359       8.8.8.8:7359
icmp 100.0.12.2:7615   192.168.103.2:7615 8.8.8.8:7615       8.8.8.8:7615
icmp 100.0.12.2:7871   192.168.103.2:7871 8.8.8.8:7871       8.8.8.8:7871

Ta thấy các PC trong vlan 102, vlan 103 truy cập đến 8.8.8.8 bằng IP đấu nối trên cổng Et0/0 là 100.0.12.2 (cũng có thể dùng thêm debug ip nat detailed để xem chi tiết hơn)


Router#show ip access-lists NATOverload
Extended IP access list NATOverload
10 permit tcp host 192.168.100.11 any eq www
20 deny ip 192.168.101.0 0.0.0.3 any
30 deny ip host 192.168.100.11 any
40 deny ip host 192.168.100.12 any
50 permit ip 192.168.101.0 0.0.0.255 any
60 permit ip 192.168.102.0 0.0.0.255 any (5 matches)
70 permit ip 192.168.103.0 0.0.0.255 any (5 matches)

80 deny ip any any

Và sử dụng access-list NATOverload và match vào seq 60, 70

HR_Server#ping 8.8.8.8
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
HR_Server#telnet 100.0.12.1 80
Trying 100.0.12.1, 80 ... Open

HR Server không ping đến 8.8.8.8 nhưng có thể try cập web đến server 100.0.12.1

Router#show ip access-lists NATOverload
Extended IP access list NATOverload
    10 permit tcp host 192.168.100.11 any eq www (1 matches)
    20 deny ip 192.168.101.0 0.0.0.3 any
    30 deny ip host 192.168.100.11 any (5 matches)
    40 deny ip host 192.168.100.12 any
    50 permit ip 192.168.101.0 0.0.0.255 any
    60 permit ip 192.168.102.0 0.0.0.255 any (5 matches)
    70 permit ip 192.168.103.0 0.0.0.255 any (5 matches)
    80 deny ip any any

3. Cấu hình Access-List trên Router sao cho:
* Standard ACL:
  • Cấm VLAN 102 truy câp vào VLAN 103 (gán theo chiều out của interface Et0/3.103)
*Cấu hình:

Router:
ip access-list standard StdACL102-to-103
 deny   192.168.102.0 0.0.0.255
 permit any
exit
!
interface Ethernet0/3.103
ip access-group StdACL102-to-103 out

*Kiểm tra:
HR_01> ping 192.168.103.1
*192.168.102.254 icmp_seq=1 ttl=255 time=1.037 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.102.254 icmp_seq=2 ttl=255 time=1.219 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.102.254 icmp_seq=3 ttl=255 time=1.112 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.102.254 icmp_seq=4 ttl=255 time=1.114 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.102.254 icmp_seq=5 ttl=255 time=1.246 ms (ICMP type:3, code:13, Communication administratively prohibited)

đã bị cấm bởi ACL

Router#show access-lists StdACL102-to-103
Standard IP access list StdACL102-to-103
    10 deny   192.168.102.0, wildcard bits 0.0.0.255 (10 matches)
    20 permit any

Match dòng đầu tiên của StdACL102-to-103
  • Cấm VLAN 103 truy câp vào VLAN 102 (gán theo chiều out của interface Et0/3.102)
*Cấu hình:
Thực ra chúng ta không cần cấu hình gì cả thì VLAN 103 cũng không thể truy cập vào VLAN 102 rồi vì thừa kế câu trước, tuy nhiên chúng ta có thể cấu hình ACL riêng để đáp ứng yêu cầu đề bài
Router:
ip access-list standard StdACL103-to-102
 deny   192.168.103.0 0.0.0.255
 permit any
exit
!
interface Ethernet0/3.102
ip access-group StdACL103-to-102 out

*Kiểm tra:

Sal_01> ping 192.168.102.1
*192.168.103.254 icmp_seq=1 ttl=255 time=1.114 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.103.254 icmp_seq=2 ttl=255 time=5.390 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.103.254 icmp_seq=3 ttl=255 time=1.078 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.103.254 icmp_seq=4 ttl=255 time=1.035 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.103.254 icmp_seq=5 ttl=255 time=0.895 ms (ICMP type:3, code:13, Communication administratively prohibited)
Router#show access-lists StdACL103-to-102
Standard IP access list StdACL103-to-102
    10 deny   192.168.103.0, wildcard bits 0.0.0.255 (10 matches)
    20 permit any

Tương tự Vlan 103 cũng không thể giao tiếp được vlan 102
  • Gán theo chiều out của interface Et0/3.101 với yêu cầu:
         + Cho phép các IP từ 192.168.102.1 đến 192.168.102.31 có thể truy cập trên VLAN 101 (còn lại cấm)
         + Cho phép các IP từ 192.168.103.240 đến 192.168.103.255 có thể truy cập trên VLAN 101 (còn lại cấm)
*Cấu hình:

Router:
ip access-list standard StdACL_to_Vlan101
 permit 192.168.102.0 0.0.0.31
 deny   192.168.102.0 0.0.0.255
 permit 192.168.103.240 0.0.0.15
 deny   192.168.103.0 0.0.0.255
 permit any
exit
!
interface Ethernet0/3.101
ip access-group StdACL_to_Vlan101 out

*Kiểm tra:

HR_01> ip 192.168.102.31/24 192.168.102.254
Checking for duplicate address...
PC1 : 192.168.102.31 255.255.255.0 gateway 192.168.102.254
HR_01> ping 192.168.101.1
84 bytes from 192.168.101.1 icmp_seq=1 ttl=63 time=3.277 ms
84 bytes from 192.168.101.1 icmp_seq=2 ttl=63 time=1.638 ms
84 bytes from 192.168.101.1 icmp_seq=3 ttl=63 time=1.488 ms
84 bytes from 192.168.101.1 icmp_seq=4 ttl=63 time=1.639 ms
84 bytes from 192.168.101.1 icmp_seq=5 ttl=63 time=1.674 ms

IP 192.168.102.31 có thể ping được vlan 101

HR_02> ip 192.168.102.32/24 192.168.102.254
Checking for duplicate address...
PC1 : 192.168.102.32 255.255.255.0 gateway 192.168.102.254
HR_02> ping 192.168.101.1
*192.168.102.254 icmp_seq=1 ttl=255 time=0.906 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.102.254 icmp_seq=2 ttl=255 time=1.064 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.102.254 icmp_seq=3 ttl=255 time=0.949 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.102.254 icmp_seq=4 ttl=255 time=1.033 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.102.254 icmp_seq=5 ttl=255 time=0.980 ms (ICMP type:3, code:13, Communication administratively prohibited)

tuy nhiên từ Ip 192.168.102.32 sẽ không thể giao tiếp được với vlan 101

Sal_01> ip 192.168.103.239/24 192.168.103.254
Checking for duplicate address...
PC1 : 192.168.103.239 255.255.255.0 gateway 192.168.103.254
Sal_01> ping 192.168.101.1
*192.168.103.254 icmp_seq=1 ttl=255 time=0.768 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.103.254 icmp_seq=2 ttl=255 time=1.003 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.103.254 icmp_seq=3 ttl=255 time=0.887 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.103.254 icmp_seq=4 ttl=255 time=0.807 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.103.254 icmp_seq=5 ttl=255 time=1.085 ms (ICMP type:3, code:13, Communication administratively prohibited)

từ ip 192.168.103.1-239 của vlan 103 sẽ không giao tiếp được vlan 101

Sal_02> ip 192.168.103.240/24 192.168.103.254
Checking for duplicate address...
PC1 : 192.168.103.240 255.255.255.0 gateway 192.168.103.254
Sal_02> ping 192.168.101.1
84 bytes from 192.168.101.1 icmp_seq=1 ttl=63 time=1.854 ms
84 bytes from 192.168.101.1 icmp_seq=2 ttl=63 time=1.868 ms
84 bytes from 192.168.101.1 icmp_seq=3 ttl=63 time=1.728 ms
84 bytes from 192.168.101.1 icmp_seq=4 ttl=63 time=2.055 ms
84 bytes from 192.168.101.1 icmp_seq=5 ttl=63 time=1.502 ms

nhưng từ ip 192.168.103.240 có thể giao tiếp thành công

Router#show access-lists StdACL_to_Vlan101
Standard IP access list StdACL_to_Vlan101
    10 permit 192.168.102.0, wildcard bits 0.0.0.31 (5 matches)
    20 deny   192.168.102.0, wildcard bits 0.0.0.255 (10 matches)
    30 permit 192.168.103.240, wildcard bits 0.0.0.15 (5 matches)
    40 deny   192.168.103.0, wildcard bits 0.0.0.255 (10 matches)
    50 permit any

Kết quả match trên ACL
  • Gán theo chiều in của cổng line vty với yêu cầu:
         + Cho phép tất cả IP trong vlan 101 có thể truy vào Router bằng đường theo telnet
         + Cho tất cả các IP lẻ trong dãy IP từ 192.168.102.1 đến 192.168.102.127 của vlan 102 có thể telnet đến được Router
         + Cho phép duy nhất ip 192.168.100.11 (HR server) trong lớp mạng 192.168.100.0/24 có thể truy cập vào router bằng telnet.
         + Những trường hợp còn lại không được phép

*Cấu hình:

Router:
ip access-list standard StdACL-Telnet_to_Router
 permit 192.168.100.11
 permit 192.168.101.0 0.0.0.255
 permit 192.168.102.1 0.0.0.126
 deny any
exit

Cấu hình ACL theo yêu cầu đề bài. 
Cho phép các IP lẻ (permit 192.168.102.1 0.0.0.126) nên IP đầu tiên phải là 1 và bit cuối cùng của Wildcard bit phải là bit 0. Tham khảo bài Wildcard Bits.

line vty 0 4
 privilege level 15
 no login
access-class StdACL-Telnet_to_Router in

Cho phép telnet không password (trường hợp này chỉ áp dụng cho lab) và gán ACL vừa tạo vào cổng vty

*Kiểm tra:

IT_01> show
NAME   IP/MASK              GATEWAY                             GATEWAY
IT_01  192.168.101.1/24     192.168.101.254
       fe80::250:79ff:fe66:6809/64
IT_01> ping 192.168.101.254 -p 23 -3
Connect   23@192.168.101.254 seq=1 ttl=255 time=1.599 ms
SendData  23@192.168.101.254 seq=1 ttl=255 time=1.129 ms
Close     23@192.168.101.254 timeout(37.005ms)
Connect   23@192.168.101.254 seq=2 ttl=255 time=5.856 ms
SendData  23@192.168.101.254 seq=2 ttl=255 time=1.124 ms
Close     23@192.168.101.254 timeout(20.265ms)
Connect   23@192.168.101.254 seq=3 ttl=255 time=5.774 ms
SendData  23@192.168.101.254 seq=3 ttl=255 time=2.319 ms
Close     23@192.168.101.254 timeout(40.641ms)
Connect   23@192.168.101.254 seq=4 ttl=255 time=6.922 ms
SendData  23@192.168.101.254 seq=4 ttl=255 time=1.787 ms
Close     23@192.168.101.254 timeout(28.303ms)
Connect   23@192.168.101.254 seq=5 ttl=255 time=6.373 ms
SendData  23@192.168.101.254 seq=5 ttl=255 time=1.128 ms
Close     23@192.168.101.254 timeout(33.983ms)

Vlan 101 có thể telnet đến được Router

HR_01> show
NAME   IP/MASK              GATEWAY                             GATEWAY
HR_01  192.168.102.1/24     192.168.102.254
       fe80::250:79ff:fe66:6805/64
HR_01> ping 192.168.102.254 -p 23 -3
Connect   23@192.168.102.254 seq=1 ttl=255 time=1.672 ms
SendData  23@192.168.102.254 seq=1 ttl=255 time=2.505 ms
Close     23@192.168.102.254 timeout(53.340ms)
Connect   23@192.168.102.254 seq=2 ttl=255 time=5.787 ms
SendData  23@192.168.102.254 seq=2 ttl=255 time=1.658 ms
Close     23@192.168.102.254 timeout(51.681ms)
Connect   23@192.168.102.254 seq=3 ttl=255 time=6.703 ms
SendData  23@192.168.102.254 seq=3 ttl=255 time=2.190 ms
Close     23@192.168.102.254 timeout(16.688ms)
Connect   23@192.168.102.254 seq=4 ttl=255 time=6.533 ms
SendData  23@192.168.102.254 seq=4 ttl=255 time=2.782 ms
Close     23@192.168.102.254 timeout(58.546ms)
Connect   23@192.168.102.254 seq=5 ttl=255 time=6.540 ms
SendData  23@192.168.102.254 seq=5 ttl=255 time=2.840 ms
Close     23@192.168.102.254 timeout(9.876ms)

IP lẻ trong khoảng 192.168.102.0 -> 127 của vlan 102 có thể telnet được đến Router

HR_02> show                       
NAME   IP/MASK              GATEWAY                             GATEWAY
HR_02  192.168.102.2/24     192.168.102.254
       fe80::250:79ff:fe66:6806/64
HR_02> ping 192.168.102.254 -p 23 -3
Connect   23@192.168.102.254 RST returned
Connect   23@192.168.102.254 RST returned
Connect   23@192.168.102.254 RST returned
Connect   23@192.168.102.254 RST returned
Connect   23@192.168.102.254 RST returned

tuy nhiên cùng vlan 102 nhưng với IP chẵn trong dãy 192.168.102.0 -> 127 sẽ bị từ chối

HR_Server#telnet 192.168.100.254
Trying 192.168.100.254 ... Open

HR server đã telnet thành công vào Router

WEB-Server#telnet 192.168.100.254
Trying 192.168.100.254 ...
% Connection refused by remote host

Cùng vlan với server HR tuy nhiên web server không thể telnet đến được Router;

ISP#ping 100.0.12.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.0.12.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms

ISP#telnet 100.0.12.2
Trying 100.0.12.2 ...
% Connection refused by remote host

Từ ngoài internet có thể ping đến được Router nhưng telnet thì không thành công.

Router#show access-lists StdACL-Telnet_to_Router
Standard IP access list StdACL-Telnet_to_Router
    10 permit 192.168.100.11 (2 matches)
    20 permit 192.168.101.0, wildcard bits 0.0.0.255 (10 matches)
    30 permit 192.168.102.1, wildcard bits 0.0.0.126 (10 matches)
    40 deny   any (7 matches)

Kết quả match của ACL trên Router

*Extended ACL:
  • Cho phép tất cả các host có  thể truy cập vào web server 192.168.100.12 bằng port 80
  • Cấm tất các traffic xuất phát từ vlan 102, vlan 103 truy cấp đến web server - 192.168.100.12
  • Cho phép vlan 101 có thể truy cập đến web server -192.168.100.12
  • Cho phép VLAN 101, VLAN 103 có thể truy cập đến HR server - 192.168.100.11 bằng port 80
  • Cho phép các IP chẵn trong dãy từ 192.168.101.240 đến 192.168.101.255 có thể truy cập vào HR_Server: 192.168.100.11
  • Cho phép mọi traffic của VLAN 102 có thể truy cập đến HR server - 192.168.100.11
  • Các traffic còn lại của VLAN 101, VLAN 103 đến HR server -192.168.100.11 sẽ bị cấm
  • Còn lại được phép.
  • Chỉ viết 1 ACL này được phép gán vào cổng Et0/1 theo chiều out của Router.

* Cấu hình
Router:
ip access-list extended To_ServerZone
 permit tcp any host 192.168.100.12 eq 80
 deny   ip 192.168.102.0 0.0.0.255 host 192.168.100.12
 deny   ip 192.168.103.0 0.0.0.255 host 192.168.100.12
 permit ip 192.168.101.0 0.0.0.255 host 192.168.100.12
 permit tcp 192.168.101.0 0.0.0.255 host 192.168.100.11 eq 80
 permit tcp 192.168.103.0 0.0.0.255 host 192.168.100.11 eq 80
 permit ip 192.168.101.240 0.0.0.14 host 192.168.100.11
 permit ip 192.168.102.0 0.0.0.255 host 192.168.100.11
 deny   ip 192.168.101.0 0.0.0.255 host 192.168.100.11
 deny   ip 192.168.103.0 0.0.0.255 host 192.168.100.11
 permit ip any any
exit
!
interface Ethernet0/1
ip access-group To_ServerZone out


* Kiểm tra

Router:
clear access-list counters To_ServerZone

Xóa access-list counters

IT_01> ping 192.168.100.12 -p 80 -3
Connect   80@192.168.100.12 seq=1 ttl=254 time=3.388 ms
SendData  80@192.168.100.12 seq=1 ttl=254 time=3.346 ms
Close     80@192.168.100.12 seq=1 ttl=254 time=4.864 ms
Connect   80@192.168.100.12 seq=2 ttl=254 time=3.356 ms
SendData  80@192.168.100.12 seq=2 ttl=254 time=3.526 ms
Close     80@192.168.100.12 seq=2 ttl=254 time=5.009 ms
Connect   80@192.168.100.12 seq=3 ttl=254 time=3.342 ms
SendData  80@192.168.100.12 seq=3 ttl=254 time=2.478 ms
Close     80@192.168.100.12 seq=3 ttl=254 time=3.639 ms
Connect   80@192.168.100.12 seq=4 ttl=254 time=3.544 ms
SendData  80@192.168.100.12 seq=4 ttl=254 time=2.503 ms
Close     80@192.168.100.12 seq=4 ttl=254 time=5.036 ms
Connect   80@192.168.100.12 seq=5 ttl=254 time=2.504 ms
SendData  80@192.168.100.12 seq=5 ttl=254 time=2.421 ms
Close     80@192.168.100.12 seq=5 ttl=254 time=4.946 ms

ping đến Web server với port 80 và protocol là -3 TCP, kết quả ping thành công

HR_01> ping 192.168.100.12 -p 80 -3
Connect   80@192.168.100.12 seq=1 ttl=254 time=4.172 ms
SendData  80@192.168.100.12 seq=1 ttl=254 time=3.491 ms
Close     80@192.168.100.12 seq=1 ttl=254 time=4.214 ms
Connect   80@192.168.100.12 seq=2 ttl=254 time=2.494 ms
SendData  80@192.168.100.12 seq=2 ttl=254 time=2.479 ms
Close     80@192.168.100.12 seq=2 ttl=254 time=4.101 ms
Connect   80@192.168.100.12 seq=3 ttl=254 time=3.320 ms
SendData  80@192.168.100.12 seq=3 ttl=254 time=2.454 ms
Close     80@192.168.100.12 seq=3 ttl=254 time=4.131 ms
Connect   80@192.168.100.12 seq=4 ttl=254 time=3.302 ms
SendData  80@192.168.100.12 seq=4 ttl=254 time=2.449 ms
Close     80@192.168.100.12 seq=4 ttl=254 time=4.098 ms
Connect   80@192.168.100.12 seq=5 ttl=254 time=4.014 ms
SendData  80@192.168.100.12 seq=5 ttl=254 time=2.447 ms
Close     80@192.168.100.12 seq=5 ttl=254 time=4.049 ms
Sal_02> ping 192.168.100.12 -p 80 -3
Connect   80@192.168.100.12 seq=1 ttl=254 time=3.017 ms
SendData  80@192.168.100.12 seq=1 ttl=254 time=3.072 ms
Close     80@192.168.100.12 seq=1 ttl=254 time=4.612 ms
Connect   80@192.168.100.12 seq=2 ttl=254 time=3.119 ms
SendData  80@192.168.100.12 seq=2 ttl=254 time=2.769 ms
Close     80@192.168.100.12 seq=2 ttl=254 time=3.858 ms
Connect   80@192.168.100.12 seq=3 ttl=254 time=3.115 ms
SendData  80@192.168.100.12 seq=3 ttl=254 time=3.099 ms
Close     80@192.168.100.12 seq=3 ttl=254 time=3.874 ms
Connect   80@192.168.100.12 seq=4 ttl=254 time=2.431 ms
SendData  80@192.168.100.12 seq=4 ttl=254 time=2.313 ms
Close     80@192.168.100.12 seq=4 ttl=254 time=3.140 ms
Connect   80@192.168.100.12 seq=5 ttl=254 time=2.411 ms
SendData  80@192.168.100.12 seq=5 ttl=254 time=2.399 ms
Close     80@192.168.100.12 seq=5 ttl=254 time=3.672 ms

Tương tự vlan 101, vlan 102 có thể truy cập vào Web server với port TCP  80

Router#show access-lists To_ServerZone
Extended IP access list To_ServerZone
    10 permit tcp any host 192.168.100.12 eq www (75 matches)
    20 deny ip 192.168.102.0 0.0.0.255 host 192.168.100.12
    30 deny ip 192.168.103.0 0.0.0.255 host 192.168.100.12
    40 permit ip 192.168.101.0 0.0.0.255 host 192.168.100.12
    50 permit tcp 192.168.101.0 0.0.0.255 host 192.168.100.11 eq www
    60 permit tcp 192.168.103.0 0.0.0.255 host 192.168.100.11 eq www
    70 permit ip 192.168.101.240 0.0.0.14 host 192.168.100.11
    80 permit ip 192.168.102.0 0.0.0.255 host 192.168.100.11
    90 deny ip 192.168.101.0 0.0.0.255 host 192.168.100.11
    100 deny ip 192.168.103.0 0.0.0.255 host 192.168.100.11
    110 permit ip any any

Router:
clear access-list counters To_ServerZone

Xóa access-list counters

HR_01> ping 192.168.100.12
*192.168.102.254 icmp_seq=1 ttl=255 time=0.829 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.102.254 icmp_seq=2 ttl=255 time=0.665 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.102.254 icmp_seq=3 ttl=255 time=0.882 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.102.254 icmp_seq=4 ttl=255 time=1.073 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.102.254 icmp_seq=5 ttl=255 time=1.171 ms (ICMP type:3, code:13, Communication administratively prohibited)
Sal_02> ping 192.168.100.12
*192.168.103.254 icmp_seq=1 ttl=255 time=0.777 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.103.254 icmp_seq=2 ttl=255 time=0.769 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.103.254 icmp_seq=3 ttl=255 time=2.555 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.103.254 icmp_seq=4 ttl=255 time=1.231 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.103.254 icmp_seq=5 ttl=255 time=1.348 ms (ICMP type:3, code:13, Communication administratively prohibited)

Ta thấy Vlan 102, vlan 103 có thể truy cập đến web server trên server 192.168.100.12 được, tuy nhiên ping không thành công

IT_01> ping 192.168.100.12     
84 bytes from 192.168.100.12 icmp_seq=1 ttl=254 time=1.708 ms
84 bytes from 192.168.100.12 icmp_seq=2 ttl=254 time=1.871 ms
84 bytes from 192.168.100.12 icmp_seq=3 ttl=254 time=1.829 ms
84 bytes from 192.168.100.12 icmp_seq=4 ttl=254 time=1.660 ms
84 bytes from 192.168.100.12 icmp_seq=5 ttl=254 time=1.686 ms

Vlan 101 có thể giao tiếp được với server 192.168.100.12 bình thường.

Router#show access-lists To_ServerZone
Extended IP access list To_ServerZone
    10 permit tcp any host 192.168.100.12 eq www
    20 deny ip 192.168.102.0 0.0.0.255 host 192.168.100.12 (5 matches)
    30 deny ip 192.168.103.0 0.0.0.255 host 192.168.100.12 (5 matches)
    40 permit ip 192.168.101.0 0.0.0.255 host 192.168.100.12 (5 matches)
    50 permit tcp 192.168.101.0 0.0.0.255 host 192.168.100.11 eq www
    60 permit tcp 192.168.103.0 0.0.0.255 host 192.168.100.11 eq www
    70 permit ip 192.168.101.240 0.0.0.14 host 192.168.100.11
    80 permit ip 192.168.102.0 0.0.0.255 host 192.168.100.11
    90 deny ip 192.168.101.0 0.0.0.255 host 192.168.100.11
    100 deny ip 192.168.103.0 0.0.0.255 host 192.168.100.11
    110 permit ip any any

Kết quả match của ACL trên router

IT_01> ping 192.168.100.11 -p 80 -3
Connect   80@192.168.100.11 seq=1 ttl=254 time=3.529 ms
SendData  80@192.168.100.11 seq=1 ttl=254 time=3.279 ms
Close     80@192.168.100.11 seq=1 ttl=254 time=5.014 ms
Connect   80@192.168.100.11 seq=2 ttl=254 time=3.312 ms
SendData  80@192.168.100.11 seq=2 ttl=254 time=3.110 ms
Close     80@192.168.100.11 seq=2 ttl=254 time=4.175 ms
Connect   80@192.168.100.11 seq=3 ttl=254 time=3.321 ms
SendData  80@192.168.100.11 seq=3 ttl=254 time=3.309 ms
Close     80@192.168.100.11 seq=3 ttl=254 time=4.781 ms
Connect   80@192.168.100.11 seq=4 ttl=254 time=3.306 ms
SendData  80@192.168.100.11 seq=4 ttl=254 time=2.959 ms
Close     80@192.168.100.11 seq=4 ttl=254 time=4.159 ms
Connect   80@192.168.100.11 seq=5 ttl=254 time=2.527 ms
SendData  80@192.168.100.11 seq=5 ttl=254 time=2.487 ms
Close     80@192.168.100.11 seq=5 ttl=254 time=4.174 ms
Sal_02> ping 192.168.100.11 -p 80 -3
Connect   80@192.168.100.11 seq=1 ttl=254 time=2.504 ms
SendData  80@192.168.100.11 seq=1 ttl=254 time=2.521 ms
Close     80@192.168.100.11 seq=1 ttl=254 time=4.155 ms
Connect   80@192.168.100.11 seq=2 ttl=254 time=3.340 ms
SendData  80@192.168.100.11 seq=2 ttl=254 time=2.504 ms
Close     80@192.168.100.11 seq=2 ttl=254 time=4.712 ms
Connect   80@192.168.100.11 seq=3 ttl=254 time=2.671 ms
SendData  80@192.168.100.11 seq=3 ttl=254 time=2.875 ms
Close     80@192.168.100.11 seq=3 ttl=254 time=4.991 ms
Connect   80@192.168.100.11 seq=4 ttl=254 time=3.294 ms
SendData  80@192.168.100.11 seq=4 ttl=254 time=3.319 ms
Close     80@192.168.100.11 seq=4 ttl=254 time=5.036 ms
Connect   80@192.168.100.11 seq=5 ttl=254 time=3.409 ms
SendData  80@192.168.100.11 seq=5 ttl=254 time=3.331 ms
Close     80@192.168.100.11 seq=5 ttl=254 time=5.011 ms

Vlan 101, vlan 103 có thể truy cập web của server 192.168.100.11 được

Router#show access-lists To_ServerZone       
Extended IP access list To_ServerZone
    10 permit tcp any host 192.168.100.12 eq www
    20 deny ip 192.168.102.0 0.0.0.255 host 192.168.100.12
    30 deny ip 192.168.103.0 0.0.0.255 host 192.168.100.12
    40 permit ip 192.168.101.0 0.0.0.255 host 192.168.100.12
    50 permit tcp 192.168.101.0 0.0.0.255 host 192.168.100.11 eq www (25 matches)
    60 permit tcp 192.168.103.0 0.0.0.255 host 192.168.100.11 eq www (25 matches)
    70 permit ip 192.168.101.240 0.0.0.14 host 192.168.100.11
    80 permit ip 192.168.102.0 0.0.0.255 host 192.168.100.11
    90 deny ip 192.168.101.0 0.0.0.255 host 192.168.100.11
    100 deny ip 192.168.103.0 0.0.0.255 host 192.168.100.11
    110 permit ip any any

Kết quả trên access-lists To_ServerZone của router

IT_01> ip 192.168.101.242/24 192.168.101.254
Checking for duplicate address...
PC1 : 192.168.101.242 255.255.255.0 gateway 192.168.101.254
IT_01> ping 192.168.100.11
84 bytes from 192.168.100.11 icmp_seq=1 ttl=254 time=2.314 ms
84 bytes from 192.168.100.11 icmp_seq=2 ttl=254 time=2.047 ms
84 bytes from 192.168.100.11 icmp_seq=3 ttl=254 time=2.472 ms
84 bytes from 192.168.100.11 icmp_seq=4 ttl=254 time=2.146 ms
84 bytes from 192.168.100.11 icmp_seq=5 ttl=254 time=2.151 ms

IP chẵn trong dãy 240-254 của vlan 101 ping thành công

IT_01> ip 192.168.101.243/24 192.168.101.254
Checking for duplicate address...
PC1 : 192.168.101.243 255.255.255.0 gateway 192.168.101.254
IT_01> ping 192.168.100.11               
192.168.100.11 icmp_seq=1 timeout
*192.168.101.254 icmp_seq=2 ttl=255 time=0.962 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.101.254 icmp_seq=3 ttl=255 time=1.068 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.101.254 icmp_seq=4 ttl=255 time=1.128 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.101.254 icmp_seq=5 ttl=255 time=1.011 ms (ICMP type:3, code:13, Communication administratively prohibited)

IP lẽ trong dãy 240-251 của vlan 101 ping KHÔNG thành công

HR_02> ping 192.168.100.11
84 bytes from 192.168.100.11 icmp_seq=1 ttl=254 time=1.993 ms
84 bytes from 192.168.100.11 icmp_seq=2 ttl=254 time=2.040 ms
84 bytes from 192.168.100.11 icmp_seq=3 ttl=254 time=2.186 ms
84 bytes from 192.168.100.11 icmp_seq=4 ttl=254 time=2.304 ms
84 bytes from 192.168.100.11 icmp_seq=5 ttl=254 time=1.978 ms

Bất kỳ IP trong vlan 102 cũng có thể truy cập vào server 192.168.100.11 được

Sal_01> ping 192.168.100.11
*192.168.103.254 icmp_seq=1 ttl=255 time=0.825 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.103.254 icmp_seq=2 ttl=255 time=0.961 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.103.254 icmp_seq=3 ttl=255 time=1.068 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.103.254 icmp_seq=4 ttl=255 time=1.137 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.103.254 icmp_seq=5 ttl=255 time=1.067 ms (ICMP type:3, code:13, Communication administratively prohibited)

Không có IP nào trong vlan 103 có thể truy cập vào server 192.168.100.11

Router#show access-lists To_ServerZone     
Extended IP access list To_ServerZone
    10 permit tcp any host 192.168.100.12 eq www
    20 deny ip 192.168.102.0 0.0.0.255 host 192.168.100.12
    30 deny ip 192.168.103.0 0.0.0.255 host 192.168.100.12
    40 permit ip 192.168.101.0 0.0.0.255 host 192.168.100.12
    50 permit tcp 192.168.101.0 0.0.0.255 host 192.168.100.11 eq www
    60 permit tcp 192.168.103.0 0.0.0.255 host 192.168.100.11 eq www
    70 permit ip 192.168.101.240 0.0.0.14 host 192.168.100.11 (5 matches)
    80 permit ip 192.168.102.0 0.0.0.255 host 192.168.100.11 (5 matches)
    90 deny ip 192.168.101.0 0.0.0.255 host 192.168.100.11 (5 matches)
    100 deny ip 192.168.103.0 0.0.0.255 host 192.168.100.11 (5 matches)
    110 permit ip any any

Kết quả match của ACL To_ServerZone trên Router
Kết luận: Xong bài lab này chúng ta làm được những gì!

  1. Tạo VLAN, gán các cổng vào vlan tương ứng
  2. Cấu hình DHCP để cấp IP cho các thiết bị đầu cuối
  3. Cấu hình NAT để cho các PCs trong LAN ra ngoài internet và ngược lại với các yêu cầu thực tế
  4. Tạo được ACL để cho phép hoặc cấm truy cập qua lại trong hệ thống mạng

Xong!


3 comments:

/*header slide*/