• 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 : IBGP và EBGP Session, Local Preference và MED

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

  • BGP : IBGP và EBGP Session, Local Preference và MED

    Cấu hình IBGP và EBGP Session,
    Local Preference và MED


    1. Mục tiêu
    Trong bài lab này, chúng ta sẽ cấu hình IBGP và EBGP. Để cho các IBGP peers trao đổi thông tin định tuyến chính xác, ta sẽ dùng lệnh next-hop-self. Các thuộc tính Local Preference và MED cũng sẽ được sử dụng.

    2. Hoàn cảnh

    Mạng của Công ty ABC ở Sài Gòn, chạy EBGP trên 2 router SaiGon1 và SaiGon2 với ISP thuộc AS 200. IBGP cũng được sử dụng giữa SaiGon1 và SaiGon2. Công việc đặt ra là phải cấu hình IBGP, EBGP và phải có redundancy. Công ty ABC đã chọn bạn để thực hiện công việc này, bạn muốn thực hiện trên Testlab trước khi bắt đầu làm việc trên thực tế.

    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, interface 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 EIGRP giữa router SaiGon1 và SaiGon2:

    SaiGon1(config)#router eigrp 64512
    SaiGon1(config-router)#network 172.16.0.0
    SaiGon2(config)#router eigrp 64512
    SaiGon2(config-router)#network 172.16.0.0

    c. Bước 3
    Cấu hình IBGP giữa router SaiGon1 và SaiGon2. Trên router SaiGon1, ta cấu hình:

    SaiGon1(config-router)#router bgp 64512
    SaiGon1(config-router)#no auto-summary
    SaiGon1(config-router)#neighbor 172.16.32.1 remote-as 64512
    SaiGon1(config-router)#neighbor 172.16.32.1 update-source loopback 0

    Topology này, ta dùng VLSM. Do đó, ta phải bỏ auto summary theo classful bằng lệnh no auto-summary.

    Nếu có nhiều đường đi đến neighbor, router sẽ chọn địa chỉ IP của bất kỳ interface nào để liên lạc qua BGP. Lệnh update-source loopback 0 sẽ làm cho router chọn interface loopback 0 cho các kết nối TCP. Lệnh này sẽ cho khả năng chịu fault tolerance hiệu quả nếu một trong các kết nối WAN của EIGRP xảy ra sự cố.

    Do BGP chỉ quảng bá các network bên ngoài các thành phần không phải của EIGRP, ta cấu hình lệnh sau trên router SaiGon1 và SaiGon2:

    SaiGon1(config-router)#router bgp 64512
    SaiGon1(config-router)#no synchronization

    SaiGon2(config-router)#router bgp 64512
    SaiGon2(config-router)#no synchronization

    Lệnh no synchronization sẽ cho phép BGP quảng bá các mạng mà không cần quan tâm đến EIGRP có biết đến các mạng đó hay không. Thông thường, BGP sẽ không quảng bá network cho một external neighbor trừ khi route đó là local hay tồn tại trong IGP.

    d. Bước 4
    Hoàn thành cấu hình IBGP trên router SaiGon2 bắng các lệnh sau:

    SaiGon2(config)#router bgp 64512
    SaiGon2(config-router)#no auto-summary
    SaiGon2(config-router)#neighbor 172.16.64.1 remote-as 64512
    SaiGon2(config-router)#neighbor 172.16.64.1 update-source lo0

    Kiểm tra router SaiGon1 và SaiGon2 đã là neighbor hay chưa bằng lệnh show ip bgp neighbor trên router SaiGon2. Xem đoạn output sau, nếu trạng thái BGP không là Established, kiểm tra lại cấu hình.

    SaiGon2#show ip bgp neighbors
    BGP neighbor is 172.16.64.1, remote AS 64512, internal link
    Index 1, Offset 0, Mask 0x2
    BGP version 4, remote router ID 172.16.64.1
    BGP state = Established, table version = 1, up for 00:04:27

    e. Bước 5:
    Cấu hình router ISP chạy EBGP với router SaiGon1 và SaiGon2. Trên router ISP, ta cấu hình:

    ISP(config)#router bgp 200
    ISP(config-router)#no auto-summary
    ISP(config-router)#neighbor 192.168.1.6 remote-as 64512
    ISP(config-router)#neighbor 192.168.1.2 remote-as 64512
    ISP(config-router)#network 192.168.100.0

    Do các EBGP session chỉ thiết lập qua các kết nối point-to-point, ta không sử dụng update-source trong cấu hình này. Chỉ có một đường tới các peers, khi đường này gặp sự cố, không còn đường nào khác.

    f. Bước 6:
    Cấu hình router SaiGon1 là một EBGP peer đến ISP như sau:

    SaiGon1(config)#ip route 172.16.0.0 255.255.0.0 null0
    SaiGon1(config)#router bgp 64512
    SaiGon1(config-router)#neighbor 192.168.1.5 remote-as 200
    SaiGon1(config-router)#network 172.16.0.0

    Dùng lệnh show ip bgp neighbors kiểm tra xem router SaiGon1 và router ISP đã tới trạng thái Establish hay chưa, chẩn đoán lỗi nếu cần thiết.

    g. Bước 7
    Cấu hình router SaiGon2 là một EBGP peer đến ISP:

    SaiGon2(config)#ip route 172.16.0.0 255.255.0.0 null0
    SaiGon2(config)#router bgp 64512
    SaiGon2(config-router)#neighbor 192.168.1.1 remote-as 200
    SaiGon2(config-router)#network 172.16.0.0

    Trong bước 6, ta dùng lệnh show ip bgp neighbor để kiểm tra các router đã đạt trạng thái Establish hay chưa, một lệnh khác cho kết quả tương tự là lệnh show ip bgp summary

    h. Bước 8
    Kiểm tra xem ISP có thể ping được địa chỉ Loopback 0 172.16.64.1 của router SaiGon1 cũng như kết nối serial giữa SaiGon1 và SaiGon2, 172.16.1.1.

    Kiểm tra xem ISP có thể ping được địa chỉ Loopback 0 172.16.32.1 của router SaiGon2 cũng như kết nối serial giữa SaiGon1 và SaiGon2, lần này là 172.16.1.2.

    Lệnh ping đến các địa chỉ trên router SaiGon1 sẽ thành công, nhưng đến các địa chỉ 172.16.32.1 và 172.16.1.2 sẽ thất bại.

    ISP#ping 172.16.64.1

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

    ISP#ping 172.16.32.1

    Type escape sequence to abort.
    Sending 5, 100-byte ICMP Echos to 172.16.32.1, timeout is 2 seconds:
    .....
    Success rate is 0 percent (0/5)

    Dùng lệnh show ip bgp trên router ISP để kiểm tra các BGP route và metric:

    ISP#show ip bgp
    BGP table version is 3, local router ID is 192.168.100.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.16.0.0 192.168.1.2 0 0 64512 i
    *> 192.168.1.6 0 0 64512 i
    *> 192.168.100.0 0.0.0.0 0 32768 i

    Chú ý rằng ISP hiện có hai đường đến mạng 172.16.0.0, được biểu thị bởi dấu *. Tuy nhiên, chỉ có đường qua SaiGon1, đường T1, được lựa chọn là đường tốt nhất, được biểu thị bởi dấu >.

    BGP hoạt động khác hẳn các giao thức định tuyến khác. Các giao thức định tuyến thông thường sử dụng các thuật toán phức tạp gồm các yếu tố về băng thông, độ trễ, độ tin cậy, … để tính toán metric, còn BGP là một dạng policy-based. BGP sẽ xác định đường đi tốt nhất dựa vào một số tham số như AS-Path. Weight, Local Preference, MED, …

    Lúc này, router ISP có thể ping được các địa chỉ của các router SaiGon1 và SaiGon2 bằng địa chỉ Ethernet 192.168.100.1

    ISP#ping
    Protocol [ip]:
    Target IP address: 172.16.32.1
    Repeat count [5]:
    Datagram size [100]:
    Timeout in seconds [2]:
    Extended commands [n]: y
    Source address or interface: 192.168.100.1
    Type of service [0]:
    Set DF bit in IP header? [no]:
    Validate reply data? [no]:
    Data pattern [0xABCD]:
    Loose, Strict, Record, Timestamp, Verbose[none]:
    Sweep range of sizes [n]:
    Type escape sequence to abort.
    Sending 5, 100-byte ICMP Echos to 172.16.32.1, timeout is 2 seconds:
    !!!!!
    Success rate is 100 percent (5/5), round-trip min/avg/max = 41/43/44 ms

    Ta thực hiện lại lệnh ping đến 172.16.32.1 từ ISP:

    ISP#ping 172.16.32.1

    Type escape sequence to abort.
    Sending 5, 100-byte ICMP Echos to 172.16.32.1, timeout is 2 seconds:
    .....
    Success rate is 0 percent (0/5)

    Tại sao không ping tới 172.16.32.1 được? Ta dùng lệnh debug ip packet trên router SaiGon2 và ping lại lần nữa để xem kết quả:

    SaiGon2#debug ip packet
    IP packet debugging is on

    ISP#ping 172.16.32.1

    SaiGon2#
    00:56:06: IP: s=192.168.1.5 (Serial0/0), d=172.16.32.1, len 100, rcvd 4
    00:56:06: IP: s=172.16.32.1 (local), d=192.168.1.5, len 100, unroutable
    00:56:06: IP: s=192.168.1.1 (Serial0/1), d=192.168.1.2, len 59, rcvd 0
    SaiGon2#
    00:56:08: IP: s=192.168.1.5 (Serial0/0), d=172.16.32.1, len 100, rcvd 4
    00:56:08: IP: s=172.16.32.1 (local), d=192.168.1.5, len 100, unroutable
    00:56:08: IP: s=172.16.32.1 (local), d=224.0.0.10 (Loopback0), len 60, sending broad/multicast
    00:56:08: IP: s=172.16.32.1 (Loopback0), d=224.0.0.10, len 60, rcvd 2
    SaiGon2#
    00:56:09: IP: s=172.16.1.2 (local), d=224.0.0.10 (Serial0/0), len 60, sending broad/multicast
    00:56:09: IP: s=172.16.1.1 (Serial0/0), d=224.0.0.10, len 60, rcvd 2
    00:56:10: IP: s=192.168.1.5 (Serial0/0), d=172.16.32.1, len 100, rcvd 4
    00:56:10: IP: s=172.16.32.1 (local), d=192.168.1.5, len 100, unroutable

    Kết quả từ debug cho ta thấy packet đến 192.168.1.5 không route được, ta kiểm tra bảng định tuyến của router SaiGon2:

    SaiGon2#show ip route

    Gateway of last resort is not set

    172.16.0.0/16 is variably subnetted, 4 subnets, 3 masks
    C 172.16.32.0/24 is directly connected, Loopback0
    S 172.16.0.0/16 is directly connected, Null0
    C 172.16.1.0/30 is directly connected, Serial0/0
    D 172.16.64.0/24 [90/2297856] via 172.16.1.1, 00:31:46, Serial0/0
    192.168.1.0/30 is subnetted, 1 subnets
    C 192.168.1.0 is directly connected, Serial0/1
    B 192.168.100.0/24 [20/0] via 192.168.1.1, 00:17:46

    i. Bước 9
    Để router ISP có thể ping được thành công, ta phải giải quyết 2 vấn đề. Thứ nhất, router SaiGon1 không biết có liên kết giữa ISP và SaiGon2. Thứ hai, router SaiGon2 không biết có liên kết giữa ISP và SaiGon1. Chúng ta có thể giải quyết việc này bằng cách quảng bá các mạng trên các liên kết serial vào BGP, hoặc bằng cách quảng bá các mạng nội bộ trong EIGRP. Chúng ta sẽ sử dụng cách cho ISP quảng bá các mạng kết nối trực tiếp, bởi vì, nếu dùng cách còn lại sẽ có nguy cơ làm mạng của chúng ta là transit AS.

    Trên router ISP, ta cấu hình:

    ISP(config)#router bgp 200
    ISP(config-router)#network 192.168.1.0 mask 255.255.255.252
    ISP(config-router)#network 192.168.1.4 mask 255.255.255.252

    Xóa các liên kết BGP trên router ISP bằng lệnh clear ip bgp *, chờ một thời gian, sau đó dùng lệnh show ip bgp trên router ISP để xem các liên kết BGP hiện hữu trên router này.

    ISP#show ip bgp
    BGP table version is 5, local router ID is 192.168.100.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.16.0.0 192.168.1.2 0 0 64512 i
    *> 192.168.1.6 0 0 64512 i
    *> 192.168.1.0/30 0.0.0.0 0 32768 i
    *> 192.168.1.4/30 0.0.0.0 0 32768 i
    *> 192.168.100.0 0.0.0.0 0 32768 i

    Kiểm tra các route trên router SaiGon1 và SaiGon2 để thấy được các network đã xuất hiện đầy đủ. Ví dụ như output sau, network 192.168.1.4 phải xuất hiện trong bảng định tuyến của router SaiGon2:

    SaiGon2#show ip route

    Gateway of last resort is not set

    172.16.0.0/16 is variably subnetted, 4 subnets, 3 masks
    C 172.16.32.0/24 is directly connected, Loopback0
    S 172.16.0.0/16 is directly connected, Null0
    C 172.16.1.0/30 is directly connected, Serial0/0
    D 172.16.64.0/24 [90/2297856] via 172.16.1.1, 00:51:27, Serial0/0
    192.168.1.0/30 is subnetted, 2 subnets
    C 192.168.1.0 is directly connected, Serial0/1
    B 192.168.1.4 [20/0] via 192.168.1.1, 00:03:56
    B 192.168.100.0/24 [20/0] via 192.168.1.1, 00:03:56

    Vấn đề cần làm tiếp theo là cấu hình BGP policy routing giữa các AS. Các BGP router sẽ không tăng địa chỉ next hop cho các IBGP khác. Router SaiGon2 sẽ trao đổi BGP policy với router SaiGon1. Policy ở đây là cách định tuyến từ AS 64512 đến AS 200 mà cụ thể là cách đưa các packet đến mạng 192.168.1.0/30 và 192.168.1.4/30. Trong trường hợp một liên kết WAN gặp sự cố, liên kết còn lại phải đóng vai trò chủ đạo làm gateway. Điểu này chỉ có thể đạt được bằng cách cấu hình lệnh next-hop-self trên router SaiGon1 và SaiGon2.

    Trước khi cấu hình lệnh next-hop-self:

    SaiGon2#show ip bgp
    BGP table version is 11, local router ID is 172.16.32.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.16.0.0 0.0.0.0 0 32768 i
    * i 172.16.64.1 0 100 0 i
    *> 192.168.1.0/30 192.168.1.1 0 0 200 i
    * i 192.168.1.5 0 100 0 200 i
    *> 192.168.1.4/30 192.168.1.1 0 0 200 i
    * i 192.168.1.5 0 100 0 200 i
    *> 192.168.100.0 192.168.1.1 0 0 200 i
    * i 192.168.1.5 0 100 0 200 i

    Cấu hình lệnh next-hop-self:

    SaiGon2(config)#router bgp 64512
    SaiGon2(config-router)#neighbor 172.16.64.1 next-hop-self

    SaiGon1(config)#router bgp 64512
    SaiGon1(config-router)#neighbor 172.16.32.1 next-hop-self

    Xóa các liên kết BGP bằng lệnh clear ip bgp *, chờ một thời gian, sau đó dùng lệnh show ip bgp để xem các liên kết BGP hiện hữu trên router SaiGon2.

    SaiGon2#show ip bgp
    BGP table version is 9, local router ID is 172.16.32.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.16.0.0 0.0.0.0 0 32768 i
    * i 172.16.64.1 0 100 0 i
    *> 192.168.1.0/30 192.168.1.1 0 0 200 i
    * i 172.16.64.1 0 100 0 200 i
    *> 192.168.1.4/30 192.168.1.1 0 0 200 i
    * i 172.16.64.1 0 100 0 200 i
    *> 192.168.100.0 192.168.1.1 0 0 200 i
    * i 172.16.64.1 0 100 0 200 i

    j. Bước 10
    Cho đến lúc này, mọi thứ đều có vẻ hoạt động tốt, ngoại trừ các cấu hình cho default route, inbound và outbound cho các packet và data.
    Do giá trị Local Preference được chia sẻ giữa các IBGP, ta cấu hình một route map đơn giản giữa router SaiGon1 và SaiGon2. Policy này sẽ điều chỉnh các outbound traffic đi trên router SaiGon1 thay vì trên router SaiGon2:

    SaiGon1(config)#route-map PRIMARY_IN permit 10
    SaiGon1(config-route-map)#set local-preference 150
    SaiGon1(config-route-map)#exit
    SaiGon1(config)#router bgp 64512
    SaiGon1(config-router)#neighbor 192.168.1.5 route-map PRIMARY_IN in

    SaiGon2(config)#route-map SECONDARY_IN permit 10
    SaiGon2(config-route-map)#set local-preference 125
    SaiGon2(config-route-map)#exit
    SaiGon2(config)#router bgp 64512
    SaiGon2(config-router)#neighbor 192.168.1.1 route-map SECONDARY_IN in

    Xóa các liên kết BGP bằng lệnh clear ip bgp *, chờ một thời gian, sau đó dùng lệnh show ip bgp để xem các liên kết BGP hiện hữu trên router SaiGon2.

    SaiGon2#show ip bgp
    BGP table version is 8, local router ID is 172.16.32.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
    * i172.16.0.0 172.16.64.1 0 100 0 i
    *> 0.0.0.0 0 32768 i
    *>i192.168.1.0/30 172.16.64.1 0 150 0 200 i
    * 192.168.1.1 0 125 0 200 i
    *>i192.168.1.4/30 172.16.64.1 0 150 0 200 i
    * 192.168.1.1 0 125 0 200 i
    *>i192.168.100.0 172.16.64.1 0 150 0 200 i
    * 192.168.1.1 0 125 0 200 i

    Output trên cho ta thấy packet đến network 192.168.100.0/24 sẽ đi theo đường qua router SaiGon1 để đến router ISP.
    Ta kiểm tra packet từ router SaiGon2 khi đến router ISP có thực sự đi qua router SaiGon1 hay không bằng extend ping:

    SaiGon2#ping
    Protocol [ip]:
    Target IP address: 192.168.100.1
    Repeat count [5]:
    Datagram size [100]:
    Timeout in seconds [2]:
    Extended commands [n]: y
    Source address or interface: 172.16.32.1
    Type of service [0]:
    Set DF bit in IP header? [no]:
    Validate reply data? [no]:
    Data pattern [0xABCD]:
    Loose, Strict, Record, Timestamp, Verbose[none]: record
    Number of hops [ 9 ]:
    Loose, Strict, Record, Timestamp, Verbose[RV]:
    Sweep range of sizes [n]:
    Type escape sequence to abort.
    Sending 5, 100-byte ICMP Echos to 192.168.100.1, timeout is 2 seconds:
    Packet has IP options: Total option bytes= 39, padded length=40
    Record route: <*> 0.0.0.0 0.0.0.0 0.0.0.0 0.0.0.0
    0.0.0.0 0.0.0.0 0.0.0.0 0.0.0.0 0.0.0.0

    Reply to request 0 (44 ms). Received packet has options
    Total option bytes= 40, padded length=40
    Record route: 172.16.1.2 192.168.1.6 192.168.100.1 192.168.1.1
    172.16.32.1 <*> 0.0.0.0 0.0.0.0 0.0.0.0 0.0.0.0
    End of list

    Reply to request 1 (45 ms). Received packet has options
    Total option bytes= 40, padded length=40
    Record route: 172.16.1.2 192.168.1.6 192.168.100.1 192.168.1.1
    172.16.32.1 <*> 0.0.0.0 0.0.0.0 0.0.0.0 0.0.0.0
    End of list

    Reply to request 2 (44 ms). Received packet has options
    Total option bytes= 40, padded length=40
    Record route: 172.16.1.2 192.168.1.6 192.168.100.1 192.168.1.1
    172.16.32.1 <*> 0.0.0.0 0.0.0.0 0.0.0.0 0.0.0.0
    End of list

    Reply to request 3 (44 ms). Received packet has options
    Total option bytes= 40, padded length=40
    Record route: 172.16.1.2 192.168.1.6 192.168.100.1 192.168.1.1
    172.16.32.1 <*> 0.0.0.0 0.0.0.0 0.0.0.0 0.0.0.0
    End of list

    Reply to request 4 (44 ms). Received packet has options
    Total option bytes= 40, padded length=40
    Record route: 172.16.1.2 192.168.1.6 192.168.100.1 192.168.1.1
    172.16.32.1 <*> 0.0.0.0 0.0.0.0 0.0.0.0 0.0.0.0
    End of list

    Success rate is 100 percent (5/5), round-trip min/avg/max = 44/44/45 ms

    SaiGon1#ping
    Protocol [ip]:
    Target IP address: 192.168.100.1
    Repeat count [5]:
    Datagram size [100]:
    Timeout in seconds [2]:
    Extended commands [n]: y
    Source address or interface: 172.16.64.1
    Type of service [0]:
    Set DF bit in IP header? [no]:
    Validate reply data? [no]:
    Data pattern [0xABCD]:
    Loose, Strict, Record, Timestamp, Verbose[none]: record
    Number of hops [ 9 ]:
    Loose, Strict, Record, Timestamp, Verbose[RV]:
    Sweep range of sizes [n]:
    Type escape sequence to abort.
    Sending 5, 100-byte ICMP Echos to 192.168.100.1, timeout is 2 seconds:
    Packet has IP options: Total option bytes= 39, padded length=40
    Record route: <*>
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)

    Reply to request 0 (44 ms). Received packet has options
    Total option bytes= 40, padded length=40
    Record route:
    (192.168.1.6)
    (192.168.100.1)
    (192.168.1.1)
    (172.16.1.2)
    (172.16.64.1) <*>
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)
    End of list

    Reply to request 1 (44 ms). Received packet has options
    Total option bytes= 40, padded length=40
    Record route:
    (192.168.1.6)
    (192.168.100.1)
    (192.168.1.1)
    (172.16.1.2)
    (172.16.64.1) <*>
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)
    End of list

    Reply to request 2 (44 ms). Received packet has options
    Total option bytes= 40, padded length=40
    Record route:
    (192.168.1.6)
    (192.168.100.1)
    (192.168.1.1)
    (172.16.1.2)
    (172.16.64.1) <*>
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)
    End of list

    Reply to request 3 (44 ms). Received packet has options
    Total option bytes= 40, padded length=40
    Record route:
    (192.168.1.6)
    (192.168.100.1)
    (192.168.1.1)
    (172.16.1.2)
    (172.16.64.1) <*>
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)
    End of list

    Reply to request 4 (44 ms). Received packet has options
    Total option bytes= 40, padded length=40
    Record route:
    (192.168.1.6)
    (192.168.100.1)
    (192.168.1.1)
    (172.16.1.2)
    (172.16.64.1) <*>
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)
    End of list

    Success rate is 100 percent (5/5), round-trip min/avg/max = 44/44/44 ms

    k. Bước 11
    Bước kế tiếp là ta cấu hình router ISP gửi trả lại tất cả packet đều qua router SaiGon1. Cấu hình một route map dùng MED, thông số được sử dụng giữa các EBGP:

    SaiGon1(config)#route-map PRIMARY_MED_OUT permit 10
    SaiGon1(config-route-map)#set metric 50
    SaiGon1(config-route-map)#exit
    SaiGon1(config)#router bgp 64512
    SaiGon1(config-router)#neighbor 192.168.1.5 route-map PRIMARY_MED_OUT out

    SaiGon2(config)#route-map SECONDARY_MED_OUT permit 10
    SaiGon2(config-route-map)#set metric 75
    SaiGon2(config-route-map)#exit
    SaiGon2(config)#router bgp 64512
    SaiGon2(config-router)#neighbor 192.168.1.1 route-map SECONDARY_MED_OUT out

    Xóa các liên kết BGP trên router SaiGon1 bằng lệnh clear ip bgp *, chờ một thời gian, sau đó dùng lệnh show ip bgp để xem các liên kết BGP hiện hữu trên router SaiGon1:

    SaiGon1#show ip bgp
    BGP table version is 9, local router ID is 172.16.64.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.16.0.0 0.0.0.0 0 32768 i
    * i 172.16.32.1 0 100 0 i
    *> 192.168.1.0/30 192.168.1.5 0 150 0 200 i
    *> 192.168.1.4/30 192.168.1.5 0 150 0 200 i
    *> 192.168.100.0 192.168.1.5 0 150 0 200 i

    Sử dụng extend ping từ router SaiGon2 và router SaiGon1:

    SaiGon2#ping
    Protocol [ip]:
    Target IP address: 192.168.100.1
    Repeat count [5]:
    Datagram size [100]:
    Timeout in seconds [2]:
    Extended commands [n]: y
    Source address or interface: 172.16.32.1
    Type of service [0]:
    Set DF bit in IP header? [no]:
    Validate reply data? [no]:
    Data pattern [0xABCD]:
    Loose, Strict, Record, Timestamp, Verbose[none]: record
    Number of hops [ 9 ]:
    Loose, Strict, Record, Timestamp, Verbose[RV]:
    Sweep range of sizes [n]:
    Type escape sequence to abort.
    Sending 5, 100-byte ICMP Echos to 192.168.100.1, timeout is 2 seconds:
    Packet has IP options: Total option bytes= 39, padded length=40
    Record route: <*> 0.0.0.0 0.0.0.0 0.0.0.0 0.0.0.0
    0.0.0.0 0.0.0.0 0.0.0.0 0.0.0.0 0.0.0.0

    Reply to request 0 (60 ms). Received packet has options
    Total option bytes= 40, padded length=40
    Record route: 172.16.1.2 192.168.1.6 192.168.100.1 192.168.1.5
    172.16.1.1 172.16.32.1 <*> 0.0.0.0 0.0.0.0 0.0.0.0
    End of list

    Reply to request 1 (60 ms). Received packet has options
    Total option bytes= 40, padded length=40
    Record route: 172.16.1.2 192.168.1.6 192.168.100.1 192.168.1.5
    172.16.1.1 172.16.32.1 <*> 0.0.0.0 0.0.0.0 0.0.0.0
    End of list

    Reply to request 2 (96 ms). Received packet has options
    Total option bytes= 40, padded length=40
    Record route: 172.16.1.2 192.168.1.6 192.168.100.1 192.168.1.5
    172.16.1.1 172.16.32.1 <*> 0.0.0.0 0.0.0.0 0.0.0.0
    End of list

    Reply to request 3 (56 ms). Received packet has options
    Total option bytes= 40, padded length=40
    Record route: 172.16.1.2 192.168.1.6 192.168.100.1 192.168.1.5
    172.16.1.1 172.16.32.1 <*> 0.0.0.0 0.0.0.0 0.0.0.0
    End of list

    Reply to request 4 (60 ms). Received packet has options
    Total option bytes= 40, padded length=40
    Record route: 172.16.1.2 192.168.1.6 192.168.100.1 192.168.1.5
    172.16.1.1 172.16.32.1 <*> 0.0.0.0 0.0.0.0 0.0.0.0
    End of list

    Success rate is 100 percent (5/5), round-trip min/avg/max = 56/66/96 ms

    SaiGon1#ping
    Protocol [ip]:
    Target IP address: 192.168.100.1
    Repeat count [5]:
    Datagram size [100]:
    Timeout in seconds [2]:
    Extended commands [n]: y
    Source address or interface: 172.16.64.1
    Type of service [0]:
    Set DF bit in IP header? [no]:
    Validate reply data? [no]:
    Data pattern [0xABCD]:
    Loose, Strict, Record, Timestamp, Verbose[none]: record
    Number of hops [ 9 ]:
    Loose, Strict, Record, Timestamp, Verbose[RV]:
    Sweep range of sizes [n]:
    Type escape sequence to abort.
    Sending 5, 100-byte ICMP Echos to 192.168.100.1, timeout is 2 seconds:
    Packet has IP options: Total option bytes= 39, padded length=40
    Record route: <*>
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)

    Reply to request 0 (28 ms). Received packet has options
    Total option bytes= 40, padded length=40
    Record route:
    (192.168.1.6)
    (192.168.100.1)
    (192.168.1.5)
    (172.16.64.1) <*>
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)
    End of list

    Reply to request 1 (28 ms). Received packet has options
    Total option bytes= 40, padded length=40
    Record route:
    (192.168.1.6)
    (192.168.100.1)
    (192.168.1.5)
    (172.16.64.1) <*>
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)
    End of list

    Reply to request 2 (28 ms). Received packet has options
    Total option bytes= 40, padded length=40
    Record route:
    (192.168.1.6)
    (192.168.100.1)
    (192.168.1.5)
    (172.16.64.1) <*>
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)
    End of list

    Reply to request 3 (32 ms). Received packet has options
    Total option bytes= 40, padded length=40
    Record route:
    (192.168.1.6)
    (192.168.100.1)
    (192.168.1.5)
    (172.16.64.1) <*>
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)
    End of list

    Reply to request 4 (32 ms). Received packet has options
    Total option bytes= 40, padded length=40
    Record route:
    (192.168.1.6)
    (192.168.100.1)
    (192.168.1.5)
    (172.16.64.1) <*>
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)
    (0.0.0.0)
    End of list

    Success rate is 100 percent (5/5), round-trip min/avg/max = 28/29/32 ms

    l. Bước 12
    Bước cuối cùng là cấu hình default route. Ta sẽ cấu hình trên router SaiGon1 và SaiGon2 dùng network 192.168.100.0/24 là default network. Sau đây là bảng định tuyến trên router SaiGon1 trước và sau khi cấu hình default network. cấu hình trên router SaiGon2 tương tự như router SaiGon1.

    SaiGon1#show ip route

    Gateway of last resort is not set

    172.16.0.0/16 is variably subnetted, 4 subnets, 3 masks
    D 172.16.32.0/24 [90/2297856] via 172.16.1.2, 02:32:40, Serial0/1
    S 172.16.0.0/16 is directly connected, Null0
    C 172.16.1.0/30 is directly connected, Serial0/1
    C 172.16.64.0/24 is directly connected, Loopback0
    192.168.1.0/30 is subnetted, 2 subnets
    B 192.168.1.0 [20/0] via 192.168.1.5, 00:14:45
    C 192.168.1.4 is directly connected, Serial0/0
    B 192.168.100.0/24 [20/0] via 192.168.1.5, 00:14:45


    SaiGon1(config)#ip default-network 192.168.100.0

    SaiGon1#show ip route

    Gateway of last resort is 192.168.1.5 to network 192.168.100.0

    172.16.0.0/16 is variably subnetted, 4 subnets, 3 masks
    D 172.16.32.0/24 [90/2297856] via 172.16.1.2, 02:34:37, Serial0/1
    S 172.16.0.0/16 is directly connected, Null0
    C 172.16.1.0/30 is directly connected, Serial0/1
    C 172.16.64.0/24 is directly connected, Loopback0
    192.168.1.0/30 is subnetted, 2 subnets
    B 192.168.1.0 [20/0] via 192.168.1.5, 00:16:42
    C 192.168.1.4 is directly connected, Serial0/0
    B* 192.168.100.0/24 [20/0] via 192.168.1.5, 00:16:42


    4. Cấu hình

    SaiGon1#show running-config
    Building configuration...

    Current configuration : 1540 bytes
    !
    version 12.1
    !
    hostname SaiGon1
    !
    ip subnet-zero
    !
    no ip domain-lookup
    !
    interface Loopback0
    ip address 172.16.64.1 255.255.255.0
    !
    interface Serial0/0
    ip address 192.168.1.6 255.255.255.252
    !
    interface Serial0/1
    ip address 172.16.1.1 255.255.255.252
    !
    router eigrp 64512
    network 172.16.0.0
    auto-summary
    no eigrp log-neighbor-changes
    !
    router bgp 64512
    no synchronization
    bgp log-neighbor-changes
    network 172.16.0.0
    neighbor 172.16.32.1 remote-as 64512
    neighbor 172.16.32.1 update-source Loopback0
    neighbor 172.16.32.1 next-hop-self
    neighbor 192.168.1.5 remote-as 200
    neighbor 192.168.1.5 route-map PRIMARY_IN in
    neighbor 192.168.1.5 route-map PRIMARY_MED_OUT out
    no auto-summary
    !
    ip classless
    ip default-network 192.168.100.0
    ip route 172.16.0.0 255.255.0.0 Null0
    !
    route-map PRIMARY_IN permit 10
    set local-preference 150
    !
    route-map PRIMARY_MED_OUT permit 10
    set metric 50
    !
    line con 0
    logging synchronous
    transport input none
    line aux 0
    line vty 0 4
    privilege level 15
    no login
    !
    no scheduler allocate
    end

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

    SaiGon2#show running-config
    Building configuration...

    Current configuration:
    !
    version 11.3
    !
    hostname SaiGon2
    !
    ip subnet-zero
    no ip domain-lookup
    !
    interface Loopback0
    ip address 172.16.32.1 255.255.255.0
    !
    interface Serial0/0
    ip address 172.16.1.2 255.255.255.252
    clockrate 64000
    !
    interface Serial0/1
    ip address 192.168.1.2 255.255.255.252
    !
    router eigrp 64512
    network 172.16.0.0
    !
    router bgp 64512
    no synchronization
    network 172.16.0.0
    neighbor 172.16.64.1 remote-as 64512
    neighbor 172.16.64.1 update-source Loopback0
    neighbor 172.16.64.1 next-hop-self
    neighbor 192.168.1.1 remote-as 200
    neighbor 192.168.1.1 route-map SECONDARY_IN in
    neighbor 192.168.1.1 route-map SECONDARY_MED_OUT out
    no auto-summary
    !
    ip classless
    ip route 172.16.0.0 255.255.0.0 Null0
    !
    route-map SECONDARY_IN permit 10
    set local-preference 125
    !
    route-map SECONDARY_MED_OUT permit 10
    set metric 75
    !
    line con 0
    logging synchronous
    line aux 0
    line vty 0 4
    privilege level 15
    no login
    !
    no scheduler allocate
    end

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

    ISP#show running-config
    Building configuration...

    Current configuration:
    !
    version 12.0
    !
    hostname ISP
    !
    ip subnet-zero
    no ip domain-lookup
    !
    interface Ethernet0/0
    ip address 192.168.100.1 255.255.255.0
    no ip directed-broadcast
    no keepalive
    !
    interface Serial0/0
    ip address 192.168.1.5 255.255.255.252
    no ip directed-broadcast
    no ip mroute-cache
    no fair-queue
    clockrate 64000
    !
    interface Serial0/1
    ip address 192.168.1.1 255.255.255.252
    no ip directed-broadcast
    clockrate 64000
    !
    router bgp 200
    network 192.168.1.0 mask 255.255.255.252
    network 192.168.1.4 mask 255.255.255.252
    network 192.168.100.0
    neighbor 192.168.1.2 remote-as 64512
    neighbor 192.168.1.6 remote-as 64512
    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
    !
    no scheduler allocate
    end

  • #2
    các bác cho em xin cái hình bài lab này với ,sao em thấy trang web toàn thiếu hình các bài lab vậy ?

    Comment


    • #3
      ductri download BSCI LabGuide ở đây nhé:

      Code:
      http://rapidshare.com/files/50067035/BSCIv50LabGuide_en.rar
      Đặng Quang Minh, CCIEx2#11897 (Enterprise Infrastructure, Wireless), DEVNET, CCSI#31417

      Email : dangquangminh@vnpro.org
      https://www.facebook.com/groups/vietprofessional/

      Comment


      • #4
        em cảm ơn anh Minh nhiều,nhưng em cần hình các bài lab trong forum này anh ạ
        Last edited by ductri; 26-09-2007, 10:22 PM.

        Comment


        • #5
          bài này của bác em ko xem được hình ảnh, tiếc quá

          Comment


          • #6
            chán nhất là mấy ông này đây, viết lab mà chẳng có hình ảnh làm sao mà hiểu, bó tay, đã viết mà không mang hiệu quả cho người khác thì đừng có viết thì tốt hơn.

            Comment


            • #7
              Các bạn đừng nói thế.Hình vẽ mình có thể dựa vào cấu hình các router mình có thể tự vẽ được mà.Nhưng nếu có hình luôn thì sẽ dễ nhìn hơn.À anh oi cho e hỏi một câu được không ạ.Trong câu lệnh cấu hình ebgp của SG1 và SG2 a thêm lệnh " ip route 172.16.0.0 255.255.0.0 null0" để làm gì vậy.Bạn nào biết nói cho mình với.Thank

              Comment


              • #8
                static route

                Comment


                • #9
                  mình biết đấy là cấu hình đường mặc định rồi nhưng ý nghĩ sử dụng để làm gì.Mà sao phải cấu hình lệnh đấy nếu không cấu hình thì sẽ ra sao.

                  Comment


                  • #10
                    mình biết đấy là cấu hình tĩnh rồi.Nhưng mình không hiểu là tại sao phải sử dụng lệnh đấy và cấu hình như vậy co ý nghĩa gì bạn à.Mình tự học lên không hiểu được nhiều mong các bạn chỉ giáo cho.:D

                    Comment


                    • #11
                      Chào bạn,

                      Để hiểu vì sao route lớp mạng 172.16.0.0/16 vào null 0 thì xem bài viết này.
                      Building Scalable Cisco Internetworks-Implementing Cisco IP Routing
                      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


                    • #12
                      Hi Klepski,

                      Ban co the post cai so do lab len cho moi nguoi cung xem duoc ko?

                      Thanks ban.
                      System Engineer
                      MIT
                      Cert: CCNP, DCNI, MCSE & RCSA

                      Thanh cong la biet dung day sau that bai :57::)>-

                      Comment


                      • #13
                        Chào bạn,

                        Bạn tham khảo các thảo luận dưới đây
                        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


                        • #14
                          Click image for larger version

Name:	bgp.jpg
Views:	1
Size:	9.4 KB
ID:	205515
                          các bác xem hình đi nha.

                          Comment


                          • #15
                            không có hình vậy bác,cho e xin cái topo đi

                            Comment

                            • Working...
                              X