• 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.

Lab : Cấu Hình Policy Base Routing

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

  • Lab : Cấu Hình Policy Base Routing

    Cấu Hình Policy Base Routing




    - Trong sơ đồ, tại router Gateway, ta qui định đường link trên cổng Serial 2/0 là đường link cao cấp và đường link Serial 2/1 là đường link bình thường. Ta sẽ dùng PC và Server trong sơ đồ là những router.
    - Tại router gateway ta đưa ra những chính sách sau:
    + Giả sử traffic telnet từ mạng Lan ---> ISP là Mission Critical Service (1)
    + Traffic khác từ mạng Lan ---> ISP thì đi trên đường link bình thường
    + Traffic từ mạng Lan ---> Farm Server đi thông qua bảng định tuyến global của router gateway
    + Traffic từ Farm Server ---> ISP thông qua đường link cao cấp. (2)
    - Ta sẽ cấu hình Policy Base Routing cho traffic ta đã đánh dấu là (1) và (2), tiếp tục kết hợp với quá trình PAT để chuyển hướng traffic đi đến ISP theo đúng yêu cầu của mình.

    1. Cấu hình IP và Định tuyến cho các thiết bị đóng vai trò là ISP, PC, Server.
    - Cấu hình IP và định tuyến cho router ISP
    ISP>enable
    ISP#conf t
    ISP(config)#hostname ISP
    ISP(config)#int s 2/0
    ISP(config-if)#description Duong_link_thuong
    ISP(config-if)#ip add 2.2.2.2 255.255.255.252
    ISP(config-if)#no sh
    ISP(config-if)#exit
    ISP(config)#int s 2/1
    ISP(config-if)#description Duong_link_cao_cap
    ISP(config-if)#ip add 3.3.3.2 255.255.255.252
    ISP(config-if)#no sh
    ISP(config)#exit
    ISP(config)#int lo 0
    ISP(config)#ip add 4.4.4.4 255.255.255.0
    ISP(config)#exit
    ISP(config)#ip route 203.162.4.0 255.255.255.248 serial 2/0
    ISP(config-line)#line vty 0 4
    ISP(config-line)#login local
    ISP(config-line)#exit
    ISP(config)#username cisco privilege 15 secret cisco
    - Cấu hình IP và định tuyến cho router đóng vai trò PC và Server
    PC>enable
    PC#conf t
    PC(config)#hostname PC
    PC(config)#int fa 0/0
    PC(config-if)#ip add 192.168.1.1 255.255.255.0
    PC(config-if)#no sh
    PC(config-if)#exit
    PC(config)#ip route 0.0.0.0 0.0.0.0 192.168.1.254

    Server>enable
    Server#conf t
    Server(config)#hostname Server
    Server(config)#int fa 0/1
    Server(config-if)#ip add 203.162.4.2 255.255.255.248
    Server(config-if)#no sh
    Server(config-if)#exit
    Server(config)#ip route 0.0.0.0 0.0.0.0 203.162.4.1
    2. Cấu hình IP và định tuyến cho Gateway.
    GW#enable
    GW#conf t
    GW(config)#hostname GW
    GW(config-if)#int serial 2/0
    GW(config-if)#description Duong_link_Thuong
    GW(config-if)#ip address 2.2.2.1 255.255.255.252
    GW(config-if)#no shutdown
    GW(config-if)#exit
    GW(config)#int s 2/1
    GW(config-if)#description Duong_link_Cao_Cap
    GW(config-if)#ip address 3.3.3.1 255.255.255.252
    GW(config-if)#no shutdown
    GW(config-if)#exit
    GW(config)#int fast 0/0
    GW(config-if)#description Mang_Lan
    GW(config-if)#ip address 192.168.1.254 255.255.255.0
    GW(config-if)#no shutdown
    GW(config-if)#exit
    GW(config)#int fast 0/1
    GW(config-if)#description Vung_Server_Farm
    GW(config-if)#ip address 203.162.4.1 255.255.255.248
    GW(config-if)#no shutdown
    GW(config-if)#exit
    GW(config)#ip route 0.0.0.0 0.0.0.0 serial 2/0
    GW(config)#ip route 0.0.0.0 0.0.0.0 serial 2/1 10
    3. Cấu hình Route-map và Policy Base Routing cho traffic (1)
    GW(config)#ip access-list extended Telnet
    GW(config-ext-acl)#deny ip any 203.162.4.0 0.0.0.7
    GW(config-ext-acl)#permit tcp any any eq 23
    GW(config-ext-acl)#deny ip any any log
    GW(config-ext-acl)#exit

    GW(config)#route-map PBR_Telnet permit 10
    GW(config-route-map)#match ip address Telnet
    GW(config-route-map)#set interface serial 2/1 serial 2/0
    ! cấu hình set interface serial 2/1 là ngõ ra nếu như serial 2/1 down thì chuyển sang dùng serial 2/0 !
    GW(config-route-map)#exit

    GW(config)#int fa 0/0
    GW(config-if)#ip policy route-map PBR_Telnet
    GW(config)#exit
    4. Cấu hình Route-map và Policy Base Routing cho traffic (2)
    GW(config)#ip access-list extended ServerFarm
    GW(config-ext-acl)#deny ip 203.162.4.0 0.0.0.7 192.168.1.0 0.0.0.255
    GW(config-ext-acl)#permit ip any any
    GW(config-ext-acl)#exit

    GW(config)#route-map PBR_ServerFarm permit 10
    GW(config-route-map)#match ip address ServerFarm
    GW(config-route-map)#set interface serial 2/1
    GW(config-route-map)#exit

    GW(config)#int fa 0/1
    GW(config-if)#ip policy route-map PBR_ServerFarm
    GW(config)#exit
    4. Cấu hình PAT ứng với policy base routing ta đã cấu hình
    GW(config)#int serial 2/0
    GW(config-if)#ip nat outside
    GW(config-if)#exit
    GW(config)#int serial 2/1
    GW(config-if)#ip nat outside
    GW(config-if)#exit
    GW(config)#int fa 0/0
    GW(config-if)#ip nat inside
    GW(config-if)#exit
    GW(config)#access-list 110 permit ip 192.168.1.0 0.0.0.255 any
    GW(config)#access-list 110 deny ip any any log
    GW(config)#ip nat pool net203 203.162.4.1 203.162.4.1 netmask 255.255.255.248

    GW(config)#route-map Nat_Cao_Cap permit 10
    GW(config-route-map)#match ip address 110
    GW(config-route-map)#match interface serial 2/1
    GW(config-route-map)#exit
    GW(config)#ip nat inside source route-map Nat_Cao_Cap pool net203 overload

    GW(config)#route-map Nat_Thuong permit 10
    GW(config-route-map)#match ip address 110
    GW(config-route-map)#match interface serial 2/0
    GW(config-route-map)#exit
    GW(config)#ip nat inside source route-map Nat_Thuong interface serial 2/0 overload
    5. Kiểm tra cấu hình
    - Đứng từ PC ta ping đến 4.4.4.4 và kiểm tra bảng NAT trên GW thì ta sẽ thấy đi thông qua IP 2.2.2.1 nghĩa là thông qua đường link Serial 2/0
    - Đứng từ PC telnet 4.4.4.4 NAT thành IP 203.162.4.1 đi trên đường link Serial 2/1
    - Đứng từ Server traceroute 4.4.4.4 sẽ đi thông qua IP 3.3.3.1 nghĩa là thông qua đường link Serial 2/1.

    www.thegioimang.org
    Last edited by lyquangthien; 22-11-2010, 01:54 PM.
    HỌC QUẢN TRỊ MẠNG - HOCQUANTRIMANG.COM

    LÝ QUANG THIỆN - MASAN'S NETWORK ADMIN
Working...
X