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

BGP Rout Reflector and Route Filter

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

  • BGP Rout Reflector and Route Filter

    BGP Route Reflector and Route filter

    1. Mục tiêu
    Trong bài lab này, chúng ta sẽ cấu hình IBGP giữa các router sử dụng route reflector và cấu hình route filter đơn giản

    2. Hoàn cảnh



    SaiGon2: có mạng 199.9.9.0/24
    SaiGon3: có mạng 200.100.50/24

    Mạng của Công ty ABC ở Sài Gòn có cấu hình như hình vẽ. Công ty muốn thiết lập IBGP full mesh giữa các router. Giải pháp được công ty chọn là cấu hình route reflector.

    3. Thực hiện
    a. Bước 1
    Kết nối mạng theo sơ đồ như trên. Cấu hình hostname, địa chỉ IP các interface serial, loopback theo đúng sơ đồ. Chưa cấu hình routing protocol. Kiểm tra các kết nối trực tiếp bằng lệnh ping và show cdp neighbor.

    b. Bước 2
    Cấu hình định tuyến IBGP cho các router:

    SaiGon3(config)#router bgp 100
    SaiGon3(config-router)#neighbor 192.168.1.5 remote-as 100
    SaiGon3(config-router)#neighbor 172.24.1.18 remote-as 100
    SaiGon3(config-router)#no auto-summary
    SaiGon3(config-router)#no synchronization
    SaiGon3(config-router)#network 172.24.1.16 mask 255.255.255.252
    SaiGon3(config-router)#network 192.168.1.4 mask 255.255.255.252

    Sau khi cấu hình router SaiGon3, cấu hình hai router còn lại đóng vai trò là route reflector client. Chú ý khi cấu hình các client, chỉ cần cấu hình peering giữa các client và server. IBGP không cần thiết phải được cấu hình full mesh.

    Cấu hình trên router SaiGon1:

    SaiGon1(config)#router bgp 100
    SaiGon1(config-router)#neighbor 192.168.1.6 remote-as 100
    SaiGon1(config-router)#no synchronization
    SaiGon1(config-router)#no auto-summary

    Cấu hình trên router SaiGon2:

    SaiGon2(config)#router bgp 100
    SaiGon2(config-router)#neighbor 172.24.1.17 remote-as 100
    SaiGon2(config-router)#no synchronization
    SaiGon2(config-router)#no auto-summary

    Kiểm tra rằng router SaiGon3 có quan hệ peering với cả router SaiGon1 và SaiGon2:

    SaiGon3#show ip bgp
    BGP table version is 4, local router ID is 200.100.50.1
    Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
    Origin codes: i - IGP, e - EGP, ? - incomplete

    Network Next Hop Metric LocPrf Weight Path
    *> 172.24.1.16/30 0.0.0.0 0 32768 i
    *> 192.168.1.4/30 0.0.0.0 0 32768 i
    *> 200.100.50.0 0.0.0.0 0 32768 i

    c. Bước 3
    Để hiểu rõ tác dụng của việc sử dụng route reflector, ta cấu hình router SaiGon2 quảng bá một mạng vào trong BGP như sau:

    SaiGon2(config)#int loopback 0
    SaiGon2(config-if)#ip address 199.9.9.1 255.255.255.0
    SaiGon2(config-if)#router bgp 100
    SaiGon2(config-router)#network 199.9.9.0

    Cấu hình trên sẽ đưa network 199.9.9.0 vào BGP. Dùng lệnh show ip route để kiểm tra router SaiGon3 đã có route đến network 199.9.9.0 hay chưa:

    SaiGon3#show ip bgp
    BGP table version is 5, local router ID is 200.100.50.1
    Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
    Origin codes: i - IGP, e - EGP, ? - incomplete

    Network Next Hop Metric LocPrf Weight Path
    *> 172.24.1.16/30 0.0.0.0 0 32768 i
    *> 192.168.1.4/30 0.0.0.0 0 32768 i
    *>i199.9.9.0 172.24.1.18 0 100 0 i
    *> 200.100.50.0 0.0.0.0 0 32768 i

    SaiGon3#show ip route

    Gateway of last resort is not set

    B 199.9.9.0/24 [200/0] via 172.24.1.18, 00:02:07
    C 200.100.50.0/24 is directly connected, Ethernet0
    172.24.0.0/30 is subnetted, 1 subnets
    C 172.24.1.16 is directly connected, Serial1
    192.168.1.0/30 is subnetted, 1 subnets
    C 192.168.1.4 is directly connected, Serial0

    Kiểm tra bảng route của router SaiGon1:

    SaiGon1#show ip route

    Gateway of last resort is not set

    B 200.100.50.0/24 [200/0] via 192.168.1.6, 00:08:10
    172.24.0.0/30 is subnetted, 1 subnets
    B 172.24.1.16 [200/0] via 192.168.1.6, 00:08:10
    192.168.1.0/30 is subnetted, 1 subnets
    C 192.168.1.4 is directly connected, Serial0

    Do router SaiGon1 không có quan hệ peering với router SaiGon2 nên trong bảng route không xuất hiện route đến network 199.9.9.0
    Để tránh thiết lập cấu hình full mesh, ta phải cấu hình router SaiGon3 đóng vai trò là một route reflector server:

    SaiGon3(config)#router bgp 100
    SaiGon3(config-router)#neighbor 192.168.1.5 route-reflector-client
    SaiGon3(config-router)#neighbor 172.24.1.18 route-reflector-client


    Kiểm tra bảng BGP trên router SaiGon1:

    SaiGon1#show ip bgp
    BGP table version is 11, local router ID is 192.168.1.5
    Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
    Origin codes: i - IGP, e - EGP, ? - incomplete

    Network Next Hop Metric LocPrf Weight Path
    *>i172.24.1.16/30 192.168.1.6 0 100 0 i
    *>i192.168.1.4/30 192.168.1.6 0 100 0 i
    *>i199.9.9.0 172.24.1.18 0 100 0 i
    *>i200.100.50.0 192.168.1.6 0 100 0 i

    Chú ý : next hop của route 199.9.9.0 là 172.24.1.18 chứ không phải là 192.168.1.6. Tức là route 199.9.9.0 trên router SaiGon1 học được trực tiếp từ router SaiGon2

    SaiGon1#ping 199.9.9.1

    Type escape sequence to abort.
    Sending 5, 100-byte ICMP Echos to 199.9.9.1, timeout is 2 seconds:
    !!!!!
    Success rate is 100 percent (5/5), round-trip min/avg/max = 64/68/88 ms

    d. Bước 4:
    Ta cấu hình BGP summary address trên router SaiGon2

    SaiGon2(config)#router bgp 100
    SaiGon2(config-router)#aggregate-address 199.0.0.0 255.0.0.0

    BGP sẽ gửi supernet 199.0.0.0/8 cho router SaiGon3 với bit ATOMIC_AGGREGATE được set lên 1

    SaiGon3#show ip bgp
    BGP table version is 8, local router ID is 200.100.50.1
    Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
    Origin codes: i - IGP, e - EGP, ? - incomplete

    Network Next Hop Metric LocPrf Weight Path
    *> 172.24.1.16/30 0.0.0.0 0 32768 i
    *> 192.168.1.4/30 0.0.0.0 0 32768 i
    *>i199.0.0.0/8 172.24.1.18 100 0 i
    *>i199.9.9.0 172.24.1.18 0 100 0 i
    *> 200.100.50.0 0.0.0.0 0 32768 i

    SaiGon3#show ip bgp 199.0.0.0
    BGP routing table entry for 199.0.0.0/8, version 8
    Paths: (1 available, best #1)
    Advertised to non peer-group peers:
    192.168.1.5
    Local, (aggregated by 100 172.24.1.18 ), (Received from a RR-client)
    172.24.1.18 from 172.24.1.18 (172.24.1.18 )
    Origin IGP, localpref 100, valid, internal, atomic-aggregate, best, ref 2

    Router SaiGon3 sau đó sẽ reflect route này cho router SaiGon1, kiểm tra bảng route của router SaiGon1:

    SaiGon1#show ip route

    Gateway of last resort is not set

    B 199.9.9.0/24 [200/0] via 172.24.1.18, 00:07:55
    B 200.100.50.0/24 [200/0] via 192.168.1.6, 00:08:12
    172.24.0.0/30 is subnetted, 1 subnets
    B 172.24.1.16 [200/0] via 192.168.1.6, 00:08:12
    192.168.1.0/30 is subnetted, 1 subnets
    C 192.168.1.4 is directly connected, Serial0
    B 199.0.0.0/8 [200/0] via 172.24.1.18, 00:03:31

    Theo yêu cầu của công ty, route 199.9.9.0/24 cần phải được lọc không cho đến router SaiGon1, ta cấu hình trên router SaiGon3 như sau:

    SaiGon3(config)#ip prefix-list Super_Net_Only permit 199.0.0.0/8
    SaiGon3(config)#ip prefix-list Super_Net_Only permit 172.24.1.0/24
    SaiGon3(config)#ip prefix-list Super_Net_Only permit 200.100.50.0/24
    SaiGon3(config)#router bgp 100
    SaiGon3(config-router)#neighbor 192.168.1.5 prefix-list Super_Net_Only out


    Trở lại router SaiGon1, reset các kết nối BGP bằng lệnh clear ip bgp *. Sau đó một thời gian, kiểm tra bảng BGP của router SaiGon1:

    SaiGon1#show ip bgp
    BGP table version is 3, local router ID is 192.168.1.5
    Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
    Origin codes: i - IGP, e - EGP, ? - incomplete

    Network Next Hop Metric LocPrf Weight Path
    *>i199.0.0.0/8 172.24.1.18 100 0 i
    *>i200.100.50.0 192.168.1.6 0 100 0 i
    Lúc này, router SaiGon1 chỉ còn supernet 199.0.0.0/8 trên bảng BGP của nó.
    4. Cấu hình
    SaiGon1#show running-config
    Building configuration...

    Current configuration:
    !
    version 12.0
    service timestamps debug uptime
    service timestamps log uptime
    no service password-encryption
    !
    hostname SaiGon1
    !
    ip subnet-zero
    no ip domain-lookup
    !
    interface Serial0
    ip address 192.168.1.5 255.255.255.252
    no ip directed-broadcast
    no ip mroute-cache
    clockrate 64000
    !
    router bgp 100
    no synchronization
    neighbor 192.168.1.6 remote-as 100
    no auto-summary
    !
    ip classless
    !
    line con 0
    logging synchronous
    transport input none
    line aux 0
    line vty 0 4
    privilege level 15
    no login
    !
    end

    -------------------------------------------------------------------------------

    SaiGon3#show running-config
    Building configuration...

    Current configuration:
    !
    version 12.0
    service timestamps debug uptime
    service timestamps log uptime
    no service password-encryption
    !
    hostname SaiGon3
    !
    ip subnet-zero
    !
    interface Ethernet0
    ip address 200.100.50.1 255.255.255.0
    no ip directed-broadcast
    no keepalive
    !
    interface Serial0
    ip address 192.168.1.6 255.255.255.252
    no ip directed-broadcast
    no ip mroute-cache
    !
    interface Serial1
    ip address 172.24.1.17 255.255.255.252
    no ip directed-broadcast
    clockrate 64000
    !
    router bgp 100
    no synchronization
    network 172.24.1.16 mask 255.255.255.252
    network 192.168.1.4 mask 255.255.255.252
    network 200.100.50.0
    neighbor 172.24.1.18 remote-as 100
    neighbor 172.24.1.18 route-reflector-client
    neighbor 192.168.1.5 remote-as 100
    neighbor 192.168.1.5 route-reflector-client
    neighbor 192.168.1.5 prefix-list Super_Net_Only out
    no auto-summary
    !
    ip classless
    no ip http server
    !
    ip prefix-list Super_Net_Only seq 5 permit 199.0.0.0/8
    ip prefix-list Super_Net_Only seq 10 permit 172.24.1.0/24
    ip prefix-list Super_Net_Only seq 15 permit 200.100.50.0/24
    !
    line con 0
    logging synchronous
    transport input none
    line aux 0
    line vty 0 4
    privilege level 15
    no login
    !
    end

    -------------------------------------------------------------------------------

    SaiGon2#show running-config
    Building configuration...

    Current configuration:
    !
    version 12.0
    service timestamps debug uptime
    service timestamps log uptime
    no service password-encryption
    !
    hostname SaiGon2
    !
    ip subnet-zero
    !
    interface Loopback0
    ip address 199.9.9.1 255.255.255.0
    no ip directed-broadcast
    !
    interface Serial0
    ip address 172.24.1.18 255.255.255.252
    no ip directed-broadcast
    no ip mroute-cache
    no fair-queue
    !
    router bgp 100
    no synchronization
    network 199.9.9.0
    aggregate-address 199.0.0.0 255.0.0.0
    neighbor 172.24.1.17 remote-as 100
    no auto-summary
    !
    ip classless
    !
    line con 0
    logging synchronous
    transport input none
    line aux 0
    line vty 0 4
    privilege level 15
    no login
    !
    end
    Last edited by phamminhtuan; 20-09-2009, 04:49 PM.

  • #2
    hjx hjx, up lại hình cho mình xem cái Topo với.
    trying....

    Comment


    • #3
      Ban oi vui long upload hinh de moi nguoi cung xem ban oi .thankssssssssssssssssssssssssss:105::105::105::10 5::105::105::105:

      Comment


      • #4
        Chào bạn,
        Hình đã được upload lại, chúc bạn vui.
        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

      Comment

        Working...
        X