• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
Xin chào ! Nếu đây là lần đầu tiên bạn đến với diễn đàn, xin vui lòng danh ra một phút bấm vào đây để đăng kí và tham gia thảo luận cùng VnPro.

Announcement

Collapse
No announcement yet.

Securing Switch Access – phần 4

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Securing Switch Access – phần 4

    LAB: DHCP Snooping

     
    Yêu cầu:
    1: Đảm bảo xóa toàn bộ cấu hình và Vlan của SW1
    2: R1, R2, Client1, Client2 đều thuộc Vlan 10.
    3: Cấu hình R1, R2 là DHCP Server. Dãy địa chỉ IP mỗi Router sẽ cấp như sau:
    R1:
    IP: 192.168.1.0/24
    Gateway: 192.168.1.253
    R2:
    192.168.1.0/24
    Gateway: 192.168.1.254
    4: Cấu hình Client 1 và Client 2 là DHCP Client
    5: Cấu hình DHCP Snooping trên SW1, đảm bảo các Client sẽ chỉ xin địa chỉ IP từ R2 qua DHCP (kiểm tra default-gateway trên mỗi client phải là IP của R2 192.168.1.254)

    Hướng dẫn:
    1: xóa toàn bộ cấu hình:
    SW1# erase startup-config
    SW1# delete flash:vlan.dat
    2: Cấu hình SW1:
    SW1(config)# interface range f0/1 – 2 , f0/23 – 24
    SW1(config-if-range)# switchport mode access
    SW1(config-if-range)# switchport access vlan 10
    3: Đặt địa chỉ IP cho 2 client và 2 router:
    R1(config)# interface fastEthernet 0/0
    R1(config-if)# ip address 192.168.1.253 255.255.255.0
    R2(config)# interface fastEthernet 0/0
    R2(config-if)# ip address 192.168.1.254 255.255.255.0
    4: Bật DHCP Client trên Client1 và Client2.
    5: Cấu hình DHCP Snooping trên SW1. R1 và R2 là 2 DHCP Server, để đảm bảo client chỉ xin địa chỉ IP từ R2, cấu hình f0/24 (SW1) trust dhcp:
    !Cấu hình DHCP Server cho R1 và R2:
    R1(config)# ip dhcp pool VLAN10
    R1(dhcp-config)# network 192.168.1.0 /24
    R1(dhcp-config)# default-router 192.168.1.253
    R2(config)# ip dhcp pool VLAN10
    R2(dhcp-config)# network 192.168.1.0 /24
    R2(dhcp-config)# default-router 192.168.1.254
    !Cấu hình DHCP Snooping trên SW1:
    SW1(config)# ip dhcp snooping
    SW1(config)# ip dhcp snooping vlan 10
    SW1(config)# no ip dhcp information option
    SW1(config)# interface f0/24
    SW1(config-if)# ip dhcp snooping trust
    SW1(config)# interface f0/23
    SW1(config-if)# no ip dhcp snooping trust

    Cấu hình đầy đủ:
    !R1:
    !
    configure terminal
    !
    interface fastEthernet0/0
    ip address 192.168.1.253 255.255.255.0
    no shutdown
    !
    ip dhcp pool VLAN10
    network 192.168.1.0 /24
    default-router 192.168.1.253
    !
    end


    !R2:
    !
    configure terminal
    !
    interface fastEthernet0/0
    ip address 192.168.1.254 255.255.255.0
    no shutdown
    !
    ip dhcp pool VLAN10
    network 192.168.1.0 /24
    default-router 192.168.1.254
    !
    end


    !SW1:
    !
    configure terminal
    !
    interface range fastEthernet0/1 – 2 , fastEthernet0/23 – 24
    switchport mode access
    switchport access vlan 10
    !
    ip dhcp snooping
    !
    ip dhcp snooping vlan 10
    !
    no ip dhcp information option
    !
    interface fastEthernet0/24
    ip dhcp snooping trust
    !
    interface fastEthernet0/23
    no ip dhcp snooping trust
    !
    end
    !Kiem tra:
    #show ip dhcp snooping

    !display only dynamic configured binding
    #show ip dhcp snooping binding

    !display the dhcp snooping binding database status and statistics
    #show ip dhcp snooping database

    !display the dynamic and static configured binding
    #show ip source binding
    LAB: IP source guard



    Yêu cầu:
    1: Giữ nguyên cấu hình của phần DHCP Snooping
    2: Client 2 sẽ gán địa chỉ static IP như mô hình trên. MAC Address của client2: 00-C0-9F-A5-EF-1A
    3: Cấu hình IP Source Guard trên F0/2(SW1).
    4: Đảm bảo Client 2 ping được Client 1.

    Hướng dẫn:
    1: Xem lại phần cấu hình DHCP Snooping.
    2: Cấu hình địa chỉ IP cho Client2 (không dùng DHCP) 192.168.1.22.
    3: Cấu hình IP Source Guard trên F0/2(SW1):
    SW1(config)# interface fastEthernet f0/2
    SW1(config-if)# ip verify source
    4: Đảm bảo Client2 ping được Client1: vì IP của Client2 được gán tĩnh (static), không lấy qua DHCP nên SW1 không có thông tin của Client2 trong DHCP Snooping database. Nên phải cấu hình để SW1 cho phép Client truy xuất vào mạng:
    SW1(config)# ip source binding 00C0.9FA5.EF1A vlan 10 192.168.1.22 interface fastEthernet 0/2

    Cấu hình đầy đủ:
    !R1:
    !
    configure terminal
    !
    interface fastEthernet0/0
    ip address 192.168.1.253 255.255.255.0
    no shutdown
    !
    ip dhcp pool VLAN10
    network 192.168.1.0 /24
    default-router 192.168.1.253
    !
    end


    !R2:
    !
    configure terminal
    !
    interface fastEthernet0/0
    ip address 192.168.1.254 255.255.255.0
    no shutdown
    !
    ip dhcp pool VLAN10
    network 192.168.1.0 /24
    default-router 192.168.1.254
    !
    end


    !SW1:
    !
    configure terminal
    !
    interface range fastEthernet0/1 – 2 , fastEthernet0/23 – 24
    switchport mode access
    switchport access vlan 10
    !
    ip dhcp snooping
    !
    ip dhcp snooping vlan 10
    !
    no ip dhcp information option
    !
    interface fastEthernet0/24
    ip dhcp snooping trust
    !
    interface fastEthernet0/23
    no ip dhcp snooping trust
    !
    interface fastEthernet0/2
    ip verify source
    !
    ip source binding 00c0.9fa5.ef1a vlan 10 192.168.1.22 interface f0/2
    !
    end
    !display ip source binding on switch
    #show ip source binding

    !display ip source guard configuration on switch
    #show ip verify source
    (còn tiếp)
    VnPro
    Phạm Minh Tuấn

    Email : phamminhtuan@vnpro.org
    Yahoo : phamminhtuan_vnpro
    -----------------------------------------------------------------------------------------------
Trung Tâm Tin Học VnPro
149/1D Ung Văn Khiêm P25 Q.Bình thạnh TPHCM
Tel : (08) 35124257 (5 lines)
Fax: (08) 35124314

Home page: http://www.vnpro.vn
Support Forum: http://www.vnpro.org
- Chuyên đào tạo quản trị mạng và hạ tầng Internet
- Phát hành sách chuyên môn
- Tư vấn và tuyển dụng nhân sự IT
- Tư vấn thiết kế và hỗ trợ kỹ thuật hệ thống mạng

Network channel: http://www.dancisco.com
Blog: http://www.vnpro.org/blog
Working...
X