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

ODR (On Demand Routing)

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

  • ODR (On Demand Routing)

    SỬ DỤNG ODR (On Demand Routing)


    1. Mục tiêu
    Trong bài lab này, chúng ta sẽ cấu hình router sử dụng ODR

    2. Tóm tắt lý thuyết
    ODR là một giao thức định tuyến sử dụng CDP (Cisco Discovery Protocol), một giao thức dùng để khám phá các thiết bị của cisco trên môi trường broadcast và non-broadcast. CDP hoạt động ở lớp liên kết (layer 2) giúp cho một thiết bị của cisco khám phá những thông tin của những thiết bị kế cận như: loại thiết bị, địa chỉ IP, phiên bản IOS, và khả năng của những thiết bị này v..v. Từ phiên bản 11.2 trở đi, ODR được thêm vào CDP để quảng bá những mạng kết nối trực tiếp của một stub router thông qua CDP. CDP phải dùng thêm 5 byte cho mỗi network: 4 byte cho địa chỉ IP và 1 byte để quảng cáo subnet mask. ODR đồng thời cũng có khả năng mang thông tin VLSM (Variable Length Subnet Mask).

    3. Hoàn cảnh

    Mạng nội bộ của Công ty ABC ở Sài Gòn sử dụng giao thức định tuyến OSPF để trao đổi thông tin định tuyến tại các router SaiGon1, SaiGon2 và SaiGon3. Do không muốn stub network tại router SaiGon4 tham gia vào OSPF, công ty ABC đã quyết định sử dụng ODR. Bạn đã được công ty giao phó thực hiện công việc này, và bạn muốn thử trên test lab trước khi thực hiện trên thực tế.

    4. 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 OSPF cho các router SaiGon1, SaiGon2, SaiGon3:

    SaiGon1(config)#router ospf 1
    SaiGon1(config-router)#network 10.0.1.0 0.0.0.255 area 1
    SaiGon1(config-router)#network 192.168.1.0 0.0.0.255 area 0

    SaiGon2(config)#router ospf 1
    SaiGon2(config-router)#network 192.168.1.0 0.0.0.255 area 0
    SaiGon2(config-router)#network 192.168.2.0 0.0.0.255 area 0

    SaiGon3(config)#router ospf 1
    SaiGon3(config-router)#network 192.168.2.0 0.0.0.255 area 0
    SaiGon3(config-router)#network 192.168.3.0 0.0.0.255 area 0

    Tại router SaiGon1, kiểm tra bảng định tuyến:
    SaiGon1#show ip route

    Gateway of last resort is not set

    10.0.0.0/24 is subnetted, 1 subnets
    C 10.0.1.0 is directly connected, Loopback0
    C 192.168.1.0/24 is directly connected, Ethernet0/0
    O 192.168.2.0/24 [110/20] via 192.168.1.2, 00:06:46, Ethernet0/0
    O 192.168.3.0/24 [110/84] via 192.168.1.2, 00:06:46, Ethernet0/0

    Lúc này do router SaiGon4 không tham gia vào OSPF nên bảng route của router SaiGon1 không có đường đến network 11.0.0.0

    c. Bước 3:
    Cấu hình default route trên router SaiGon4 để nó có thể đến các mạng trong OSPF

    SaiGon4(config)#ip route 0.0.0.0 0.0.0.0 192.168.3.1

    Kiểm tra bảng route và ping thử tại router SaiGon4:
    SaiGon4#show ip route

    Gateway of last resort is 192.168.3.1 to network 0.0.0.0

    C 11.0.0.0/8 is directly connected, Loopback0
    C 192.168.3.0/24 is directly connected, Serial0/1
    S* 0.0.0.0/0 [1/0] via 192.168.3.1


    SaiGon4#ping 10.0.1.1

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

    Router SaiGon4 đã đến được tất cả các network trong OSPF, nhưng bên trong OSPF thì vẫn chưa đến được network 11.0.0.0

    SaiGon1#ping 11.0.0.1

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

    d. Bước 4:
    Cấu hình ODR trên router SaiGon3

    SaiGon3(config)#router odr

    Kiểm tra bảng route tại router SaiGon3:

    SaiGon3#show ip route
    Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
    D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
    N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
    E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
    i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
    U - per-user static route, o - ODR

    Gateway of last resort is not set

    10.0.0.0/32 is subnetted, 1 subnets
    O IA 10.0.1.1 [110/21] via 192.168.2.1, 00:23:55, Ethernet0/0
    o 11.0.0.0/8 [160/1] via 192.168.3.2, 00:00:10, Serial0/1
    O 192.168.1.0/24 [110/20] via 192.168.2.1, 00:23:55, Ethernet0/0
    C 192.168.2.0/24 is directly connected, Ethernet0/0
    C 192.168.3.0/24 is directly connected, Serial0/1

    Lúc này, router SaiGon3 đã đến được network 11.0.0.0. tiếp theo, ta sẽ redistribute đưa ODR vào miền OSPF để các router khác trong OSPF cũng có thể đến đưọc network 11.0.0.0:

    SaiGon3(config)#router ospf 1
    SaiGon3(config-router)#redistribute odr subnets

    Kiểm tra bảng route tại router SaiGon1:
    SaiGon1#show ip route

    Gateway of last resort is not set

    10.0.0.0/24 is subnetted, 1 subnets
    C 10.0.1.0 is directly connected, Loopback0
    O E2 11.0.0.0/8 [110/20] via 192.168.1.2, 00:00:31, Ethernet0/0
    C 192.168.1.0/24 is directly connected, Ethernet0/0
    O 192.168.2.0/24 [110/20] via 192.168.1.2, 00:00:31, Ethernet0/0
    O 192.168.3.0/24 [110/84] via 192.168.1.2, 00:00:31, Ethernet0/0

    Bảng route của router SaiGon1 đã có network và hiển nhiên từ nó có thể ping được mạng 11.0.0.0
    SaiGon1#ping 11.0.0.1

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

    5. Cấu hình

    SaiGon1#show running-config
    Building configuration...

    Current configuration : 923 bytes
    !
    version 12.1
    no service single-slot-reload-enable
    service timestamps debug uptime
    service timestamps log uptime
    no service password-encryption
    !
    hostname SaiGon1
    !
    ip subnet-zero
    !
    no ip domain-lookup
    !
    interface Loopback0
    ip address 10.0.1.1 255.255.255.0
    !
    interface Ethernet0/0
    ip address 192.168.1.1 255.255.255.0
    half-duplex
    !
    router ospf 1
    log-adjacency-changes
    network 10.0.1.0 0.0.0.255 area 1
    network 192.168.1.0 0.0.0.255 area 0
    !
    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

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

    SaiGon2#show running-config
    Building configuration...

    Current configuration : 1097 bytes
    !
    version 12.1
    no service single-slot-reload-enable
    service timestamps debug uptime
    service timestamps log uptime
    no service password-encryption
    !
    hostname SaiGon2
    !
    ip subnet-zero
    !
    interface FastEthernet0/0
    ip address 192.168.2.1 255.255.255.0
    duplex auto
    speed auto
    !
    interface FastEthernet0/1
    ip address 192.168.1.2 255.255.255.0
    duplex auto
    speed auto
    !
    router ospf 1
    log-adjacency-changes
    network 192.168.1.0 0.0.0.255 area 0
    network 192.168.2.0 0.0.0.255 area 0
    !
    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

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

    SaiGon3#show running-config
    Building configuration...

    Current configuration:
    !
    version 11.3
    service timestamps debug uptime
    service timestamps log uptime
    no service password-encryption
    !
    hostname SaiGon3
    !

    interface Ethernet0/0
    ip address 192.168.2.2 255.255.255.0
    !
    interface Serial0/1
    ip address 192.168.3.1 255.255.255.0
    !
    router odr
    !
    router ospf 1
    redistribute odr subnets
    network 192.168.2.0 0.0.0.255 area 0
    network 192.168.3.0 0.0.0.255 area 0
    !
    ip classless
    !
    line con 0
    logging synchronous
    line aux 0
    line vty 0 4
    privilege level 15
    no login
    !
    no scheduler allocate
    end

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

    SaiGon4#show running-config
    Building configuration...

    Current configuration : 961 bytes
    !
    version 12.1
    no service single-slot-reload-enable
    service timestamps debug uptime
    service timestamps log uptime
    no service password-encryption
    !
    hostname SaiGon4
    !
    ip subnet-zero
    !
    interface Loopback0
    ip address 11.0.0.1 255.0.0.0
    !
    interface Ethernet0/0
    no ip address
    shutdown
    half-duplex
    !
    interface Serial0/1
    ip address 192.168.3.2 255.255.255.0
    clockrate 64000
    !
    ip classless
    ip route 0.0.0.0 0.0.0.0 192.168.3.1
    !
    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
    hi

    sao cái file này mất hình mất rồi. ai có hình post lên cho tham khảo với nhé. thanks nhiều nhiều

    Comment


    • #3
      Originally posted by klepski View Post
      SỬ DỤNG ODR (On Demand Routing)


      1. Mục tiêu
      Trong bài lab này, chúng ta sẽ cấu hình router sử dụng ODR

      2. Tóm tắt lý thuyết
      ODR là một giao thức định tuyến sử dụng CDP (Cisco Discovery Protocol), một giao thức dùng để khám phá các thiết bị của cisco trên môi trường broadcast và non-broadcast. CDP hoạt động ở lớp liên kết (layer 2) giúp cho một thiết bị của cisco khám phá những thông tin của những thiết bị kế cận như: loại thiết bị, địa chỉ IP, phiên bản IOS, và khả năng của những thiết bị này v..v. Từ phiên bản 11.2 trở đi, ODR được thêm vào CDP để quảng bá những mạng kết nối trực tiếp của một stub router thông qua CDP. CDP phải dùng thêm 5 byte cho mỗi network: 4 byte cho địa chỉ IP và 1 byte để quảng cáo subnet mask. ODR đồng thời cũng có khả năng mang thông tin VLSM (Variable Length Subnet Mask).

      3. Hoàn cảnh

      Mạng nội bộ của Công ty ABC ở Sài Gòn sử dụng giao thức định tuyến OSPF để trao đổi thông tin định tuyến tại các router SaiGon1, SaiGon2 và SaiGon3. Do không muốn stub network tại router SaiGon4 tham gia vào OSPF, công ty ABC đã quyết định sử dụng ODR. Bạn đã được công ty giao phó thực hiện công việc này, và bạn muốn thử trên test lab trước khi thực hiện trên thực tế.

      4. 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 OSPF cho các router SaiGon1, SaiGon2, SaiGon3:

      SaiGon1(config)#router ospf 1
      SaiGon1(config-router)#network 10.0.1.0 0.0.0.255 area 1
      SaiGon1(config-router)#network 192.168.1.0 0.0.0.255 area 0

      SaiGon2(config)#router ospf 1
      SaiGon2(config-router)#network 192.168.1.0 0.0.0.255 area 0
      SaiGon2(config-router)#network 192.168.2.0 0.0.0.255 area 0

      SaiGon3(config)#router ospf 1
      SaiGon3(config-router)#network 192.168.2.0 0.0.0.255 area 0
      SaiGon3(config-router)#network 192.168.3.0 0.0.0.255 area 0

      Tại router SaiGon1, kiểm tra bảng định tuyến:
      SaiGon1#show ip route

      Gateway of last resort is not set

      10.0.0.0/24 is subnetted, 1 subnets
      C 10.0.1.0 is directly connected, Loopback0
      C 192.168.1.0/24 is directly connected, Ethernet0/0
      O 192.168.2.0/24 [110/20] via 192.168.1.2, 00:06:46, Ethernet0/0
      O 192.168.3.0/24 [110/84] via 192.168.1.2, 00:06:46, Ethernet0/0

      Lúc này do router SaiGon4 không tham gia vào OSPF nên bảng route của router SaiGon1 không có đường đến network 11.0.0.0

      c. Bước 3:
      Cấu hình default route trên router SaiGon4 để nó có thể đến các mạng trong OSPF

      SaiGon4(config)#ip route 0.0.0.0 0.0.0.0 192.168.3.1

      Kiểm tra bảng route và ping thử tại router SaiGon4:
      SaiGon4#show ip route

      Gateway of last resort is 192.168.3.1 to network 0.0.0.0

      C 11.0.0.0/8 is directly connected, Loopback0
      C 192.168.3.0/24 is directly connected, Serial0/1
      S* 0.0.0.0/0 [1/0] via 192.168.3.1


      SaiGon4#ping 10.0.1.1

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

      Router SaiGon4 đã đến được tất cả các network trong OSPF, nhưng bên trong OSPF thì vẫn chưa đến được network 11.0.0.0

      SaiGon1#ping 11.0.0.1

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

      d. Bước 4:
      Cấu hình ODR trên router SaiGon3

      SaiGon3(config)#router odr

      Kiểm tra bảng route tại router SaiGon3:

      SaiGon3#show ip route
      Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
      D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
      N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
      E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
      i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
      U - per-user static route, o - ODR

      Gateway of last resort is not set

      10.0.0.0/32 is subnetted, 1 subnets
      O IA 10.0.1.1 [110/21] via 192.168.2.1, 00:23:55, Ethernet0/0
      o 11.0.0.0/8 [160/1] via 192.168.3.2, 00:00:10, Serial0/1
      O 192.168.1.0/24 [110/20] via 192.168.2.1, 00:23:55, Ethernet0/0
      C 192.168.2.0/24 is directly connected, Ethernet0/0
      C 192.168.3.0/24 is directly connected, Serial0/1

      Lúc này, router SaiGon3 đã đến được network 11.0.0.0. tiếp theo, ta sẽ redistribute đưa ODR vào miền OSPF để các router khác trong OSPF cũng có thể đến đưọc network 11.0.0.0:

      SaiGon3(config)#router ospf 1
      SaiGon3(config-router)#redistribute odr subnets

      Kiểm tra bảng route tại router SaiGon1:
      SaiGon1#show ip route

      Gateway of last resort is not set

      10.0.0.0/24 is subnetted, 1 subnets
      C 10.0.1.0 is directly connected, Loopback0
      O E2 11.0.0.0/8 [110/20] via 192.168.1.2, 00:00:31, Ethernet0/0
      C 192.168.1.0/24 is directly connected, Ethernet0/0
      O 192.168.2.0/24 [110/20] via 192.168.1.2, 00:00:31, Ethernet0/0
      O 192.168.3.0/24 [110/84] via 192.168.1.2, 00:00:31, Ethernet0/0

      Bảng route của router SaiGon1 đã có network và hiển nhiên từ nó có thể ping được mạng 11.0.0.0
      SaiGon1#ping 11.0.0.1

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

      5. Cấu hình

      SaiGon1#show running-config
      Building configuration...

      Current configuration : 923 bytes
      !
      version 12.1
      no service single-slot-reload-enable
      service timestamps debug uptime
      service timestamps log uptime
      no service password-encryption
      !
      hostname SaiGon1
      !
      ip subnet-zero
      !
      no ip domain-lookup
      !
      interface Loopback0
      ip address 10.0.1.1 255.255.255.0
      !
      interface Ethernet0/0
      ip address 192.168.1.1 255.255.255.0
      half-duplex
      !
      router ospf 1
      log-adjacency-changes
      network 10.0.1.0 0.0.0.255 area 1
      network 192.168.1.0 0.0.0.255 area 0
      !
      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

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

      SaiGon2#show running-config
      Building configuration...

      Current configuration : 1097 bytes
      !
      version 12.1
      no service single-slot-reload-enable
      service timestamps debug uptime
      service timestamps log uptime
      no service password-encryption
      !
      hostname SaiGon2
      !
      ip subnet-zero
      !
      interface FastEthernet0/0
      ip address 192.168.2.1 255.255.255.0
      duplex auto
      speed auto
      !
      interface FastEthernet0/1
      ip address 192.168.1.2 255.255.255.0
      duplex auto
      speed auto
      !
      router ospf 1
      log-adjacency-changes
      network 192.168.1.0 0.0.0.255 area 0
      network 192.168.2.0 0.0.0.255 area 0
      !
      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

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

      SaiGon3#show running-config
      Building configuration...

      Current configuration:
      !
      version 11.3
      service timestamps debug uptime
      service timestamps log uptime
      no service password-encryption
      !
      hostname SaiGon3
      !

      interface Ethernet0/0
      ip address 192.168.2.2 255.255.255.0
      !
      interface Serial0/1
      ip address 192.168.3.1 255.255.255.0
      !
      router odr
      !
      router ospf 1
      redistribute odr subnets
      network 192.168.2.0 0.0.0.255 area 0
      network 192.168.3.0 0.0.0.255 area 0
      !
      ip classless
      !
      line con 0
      logging synchronous
      line aux 0
      line vty 0 4
      privilege level 15
      no login
      !
      no scheduler allocate
      end

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

      SaiGon4#show running-config
      Building configuration...

      Current configuration : 961 bytes
      !
      version 12.1
      no service single-slot-reload-enable
      service timestamps debug uptime
      service timestamps log uptime
      no service password-encryption
      !
      hostname SaiGon4
      !
      ip subnet-zero
      !
      interface Loopback0
      ip address 11.0.0.1 255.0.0.0
      !
      interface Ethernet0/0
      no ip address
      shutdown
      half-duplex
      !
      interface Serial0/1
      ip address 192.168.3.2 255.255.255.0
      clockrate 64000
      !
      ip classless
      ip route 0.0.0.0 0.0.0.0 192.168.3.1
      !
      line con 0
      logging synchronous
      transport input none
      line aux 0
      line vty 0 4
      privilege level 15
      no login
      !
      no scheduler allocate
      end
      bị mất hình rồi, ko xem được topo mạng, bác trình bày lại hoàn cảnh đi :D
      no car...no house...no money, but have only a sharing and friendly heart. What's the most important thing in this life "Heart or Money ?". Anything else can stead money ?

      :32::53::X:106:

      Nothing last forever...

      Comment

      Working...
      X