• 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 7.4: Cấu hình dmvpn cơ bản

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

  • Lab 7.4: Cấu hình dmvpn cơ bản




    A)Mục tiêu


    Thực hiện cấu hình DMVPN (Dynamic Multipoint VPN)
    • Cổng tunnel SAIGON: 10.1.1.1/24
    • Cổng tunnel BINHDUONG: 10.1.1.2/24
    • Cổng tuunel VUNGTAI: 10.1.1.3/24



    Cấu hình giao thức định tuyến OSPF trên SAIGON, BINHDUONG, VUNGTAU, đảm bảo các mạng Lan có thể giao tiếp được.



    Khi mạng Lan BINHDUONG giao tiếp mạng Lan VUNG TAU thì dữ liệu nên đi trực tiếp (không qua SAIGON)

    B) Cấu hình trên Router SAIGON


    Cấu hình chính sách ISAKMP (IKE 1)

    SAIGON(config)#crypto isakmp policy 10

    SAIGON(config-isakmp)#hash md5

    SAIGON(config-isakmp)#encryption des

    SAIGON(config-isakmp)#group 2

    SAIGON(config-isakmp)#authentication pre-share



    Cấu hình thông tin key

    SAIGON(config)#crypto isakmp key vnpro address 0.0.0.0 0.0.0.0

    Cấu hình chính sách IPSec (IKE 2)

    SAIGON(config)#crypto ipsec transform-set MYSET esp-md5-hmac esp-des

    SAIGON(cfg-crypto-trans)#mode transport



    Cấu hình IPsec Profile (thay thế Crypto map)

    SAIGON(config)#crypto ipsec profile MYPROFILE

    SAIGON(ipsec-profile)#set transform-set MYSET



    Tạo cổng tunnel

    SAIGON(config)#interface tunnel 1

    SAIGON(config-if)#ip address 10.1.1.1 255.255.255.0



    Xác định địa chỉ nguồn để thực hiện quá trính đóng gói

    SAIGON(config-if)#tunnel source s0/0



    Xác định mode GRE được sử dụng

    SAIGON(config-if)#tunnel mode gre multipoint

    Gán IPSec Profile vào công tunnel

    SAIGON(config-if)#tunnel protection ipsec profile MYPROFILE



    Kích hoạt NHRP (giá trị network-id chỉ có ý nghĩa cục bộ)

    SAIGON(config-if)#ip nhrp network-id 1



    Trong trường hợp sử dụng giao tiếp định tuyến động (RIP, OSPF, EIRGP) để cho phép multicast được gởi

    SAIGON(config-if)#ip nhrp map multicast dynamic



    Trong một số IOS cũ yêu cầu tunnel key để hoạt động, giá trị tunnel key đóng vai trò xác thực cho gói GRE và cũng được dùng khi có nhiểu công tunnel hoạt động ở mode GRE multipoint

    SAIGON(config-if)#tunnel key 123



    Cấu hình thông tin cho giao thức định tuyến OSPF

    SAIGON(config)#router ospf 1

    SAIGON(config-router)#network 192.168.1.0 0.0.0.255 area 0

    SAIGON(config-router)#network 10.1.1.0 0.0.0.255 area 0



    Lưu ý: Không cho phép cổng s0/0 tham gia vào quá trình định tuyến.

    B) Cấu hình trên Router BINHDUONG




    Cấu hình thông tin ISALMP và IPSec như trên



    BINHDUONG(config)#interface tunnel 1

    BINHDUONG(config-if)#ip address 10.1.1.2 255.255.255.0

    BINHDUONG(config-if)#tunnel source s0/0

    BINHDUONG(config-if)#tunnel mode gre multipoint

    BINHDUONG(config-if)#tunnel protection ipsec profile MYPROFILE

    BINHDUONG(config-if)#ip nhrp network-id 1



    Xác định NHRP Server

    BINHDUONG(config-if)#ip nhrp nhs 10.1.1.1



    Xây dưng ánh xạ tĩnh cho NHRP

    BINHDUONG(config-if)#ip nhrp map 10.1.1.1 150.1.1.1



    Cho phép multicast được gởi đến 150.1.1.1

    BINHDUONG(config-if)#ip nhrp map multicast 150.1.1.1



    Xác định tunnel key

    BINHDUONG(config-if)#tunnel key 123



    Cấu hình thông tin cho giao thức định tuyến OSPF

    BINHDUONG(config)#router ospf 1

    BINHDUONG(config-router)#network 192.168.2.0 0.0.0.255 area 0

    BINHDUONG(config-router)#network 10.1.1.0 0.0.0.255 area 0



    Lưu ý: Không cho phép cổng s0/0 tham gia vào quá trình định tuyến



    Thực hiện cấu hình tương tự trên router VUNGTAU

    C) Cấu hình đầy đủ


    SAIGON

    Building configuration...



    Current configuration : 1635 bytes

    !

    hostname SAIGON

    !

    !

    crypto isakmp policy 10

    hash md5

    authentication pre-share

    group 2

    crypto isakmp key vnpro address 0.0.0.0 0.0.0.0

    no crypto isakmp ccm

    !

    !

    crypto ipsec transform-set MYSET esp-des esp-md5-hmac

    mode transport

    !

    crypto ipsec profile MYPROFILE

    set transform-set MYSET

    !

    interface Tunnel1

    ip address 10.1.1.1 255.255.255.0

    ip nhrp map multicast dynamic

    ip nhrp network-id 1

    ip ospf network broadcast

    tunnel source Serial0/0

    tunnel mode gre multipoint

    tunnel key 123

    tunnel protection ipsec profile MYPROFILE

    !

    interface Loopback0

    ip address 192.168.1.1 255.255.255.0

    !

    interface FastEthernet0/0

    no ip address

    shutdown

    duplex auto

    speed auto

    !

    interface Serial0/0

    ip address 150.1.1.1 255.255.255.0

    clockrate 2000000

    !

    interface FastEthernet0/1

    no ip address

    shutdown

    duplex auto

    speed auto

    !

    interface Serial0/1

    no ip address

    shutdown

    clockrate 2000000

    !

    router ospf 1

    log-adjacency-changes

    network 10.1.1.0 0.0.0.255 area 0

    network 192.168.1.0 0.0.0.255 area 0

    !

    ip classless

    ip route 0.0.0.0 0.0.0.0 150.1.1.2

    !

    line con 0

    exec-timeout 0 0

    line aux 0

    line vty 0 4

    !

    !

    end



    BINHDUONG

    Building configuration...



    Current configuration : 1714 bytes

    !

    version 12.3

    service timestamps debug datetime msec

    service timestamps log datetime msec

    no service password-encryption

    !

    hostname BINHDUONG

    !

    boot-start-marker

    boot-end-marker

    !

    crypto isakmp policy 10

    hash md5

    authentication pre-share

    group 2

    crypto isakmp key vnpro address 0.0.0.0 0.0.0.0

    !

    crypto ipsec transform-set MYSET esp-des esp-md5-hmac

    mode transport

    !

    crypto ipsec profile MYPROFILE

    set transform-set MYSET

    !

    interface Tunnel1

    ip address 10.1.1.2 255.255.255.0

    ip nhrp map 10.1.1.1 150.1.1.1

    ip nhrp map multicast 150.1.1.1

    ip nhrp network-id 1

    ip nhrp nhs 10.1.1.1

    ip ospf network broadcast

    ip ospf priority 0

    tunnel source Serial0/0

    tunnel mode gre multipoint

    tunnel key 123

    tunnel protection ipsec profile MYPROFILE

    !

    interface Loopback0

    ip address 192.168.2.1 255.255.255.0

    !

    interface FastEthernet0/0

    no ip address

    shutdown

    duplex auto

    speed auto

    !

    interface Serial0/0

    ip address 151.1.1.1 255.255.255.0

    clockrate 2000000

    !

    interface FastEthernet0/1

    no ip address

    shutdown

    duplex auto

    speed auto

    !

    interface Serial0/1

    no ip address

    shutdown

    clockrate 2000000

    !

    router ospf 1

    log-adjacency-changes

    network 10.1.1.0 0.0.0.255 area 0

    network 192.168.2.0 0.0.0.255 area 0

    !

    ip classless

    ip route 0.0.0.0 0.0.0.0 151.1.1.2

    !

    line con 0

    exec-timeout 0 0

    line aux 0

    line vty 0 4

    !

    !

    end



    VUNGTAU

    Building configuration...



    Current configuration : 1694 bytes

    !

    hostname VUNGTAU

    !

    !

    crypto isakmp policy 10

    hash md5

    authentication pre-share

    group 2

    crypto isakmp key vnpro address 0.0.0.0 0.0.0.0

    no crypto isakmp ccm

    !

    !

    crypto ipsec transform-set MYSET esp-des esp-md5-hmac

    mode transport

    !

    crypto ipsec profile MYPROFILE

    set transform-set MYSET

    !

    !

    interface Tunnel1

    ip address 10.1.1.3 255.255.255.0

    ip nhrp map 10.1.1.1 150.1.1.1

    ip nhrp map multicast 150.1.1.1

    ip nhrp network-id 1

    ip nhrp nhs 10.1.1.1

    ip ospf network broadcast

    ip ospf priority 0

    tunnel source Serial0/0

    tunnel mode gre multipoint

    tunnel key 123

    tunnel protection ipsec profile MYPROFILE

    !

    interface Loopback0

    ip address 192.168.3.1 255.255.255.0

    !

    interface FastEthernet0/0

    no ip address

    shutdown

    duplex auto

    speed auto

    !

    interface Serial0/0

    ip address 152.1.1.1 255.255.255.0

    clockrate 2000000

    !

    interface FastEthernet0/1

    no ip address

    shutdown

    duplex auto

    speed auto

    !

    interface Serial0/1

    no ip address

    shutdown

    clockrate 2000000

    !

    router ospf 1

    log-adjacency-changes

    network 10.1.1.0 0.0.0.255 area 0

    network 192.168.3.0 0.0.0.255 area 0

    !

    ip classless

    ip route 0.0.0.0 0.0.0.0 152.1.1.2

    !

    !

    end

    D) Kiểm tra các thông số cấu hình




    SAIGON#sh ip ospf interface

    Tunnel1 is up, line protocol is up

    Internet Address 10.1.1.1/24, Area 0

    Process ID 1, Router ID 192.168.1.1, Network Type POINT_TO_POINT, Cost: 11111

    Transmit Delay is 1 sec, State POINT_TO_POINT,

    Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5



    Thông tin bảng NHRP

    SAIGON#sh ip nhrp

    10.1.1.2/32 via 10.1.1.2, Tunnel1 created 00:04:45, expire 01:55:14

    Type: dynamic, Flags: authoritative unique registered

    NBMA address: 151.1.1.1

    10.1.1.3/32 via 10.1.1.3, Tunnel1 created 00:04:32, expire 01:55:27

    Type: dynamic, Flags: authoritative unique registered

    NBMA address: 152.1.1.1



    BINHDUONG#sh ip nhrp

    10.1.1.1/32 via 10.1.1.1, Tunnel1 created 00:00:58, never expire

    Type: static, Flags: authoritative

    NBMA address: 150.1.1.1



    Mặc dù giá trị NHRP đã được xây dựng nhưng thông tin OSPF vẫn chưa được hội tụ



    %OSPF-5-ADJCHG: Process 1, Nbr 152.1.1.1 on Tunnel1 from FULL to DOWN, Neighbor Down: Adjacency forced to reset



    Vì trạng thái Network Type là POINT_TO_POINT, không cho phép ba neighbor được phép hình thành. Trong trường hợp này ta chọn Networt Type là Broadcast



    SAIGON(config)#interface tunnel 1

    SAIGON(config-if)#ip ospf network broadcast



    SAIGON#sh ip ospf interface

    Tunnel1 is up, line protocol is up

    Internet Address 10.1.1.1/24, Area 0

    Process ID 1, Router ID 192.168.1.1, Network Type BROADCAST, Cost: 11111

    Transmit Delay is 1 sec, State DR, Priority 1

    Designated Router (ID) 192.168.1.1, Interface address 10.1.1.1

    No backup designated router on this network



    BINHDUONG(config)#interface tunnel 1

    BINHDUONG(config-if)#ip ospf network broadcast



    Buộc router không được phép tham gia qua trình bầu chọn

    BINHDUONG(config-if)#ip ospf priority 0



    Thực hiện cấu hình tương tự trên router VUNGTAU



    Thông số sau khi thay đổi cấu hình



    SAIGON#sh ip ospf neighbor



    Neighbor ID Pri State Dead Time Address Interface

    192.168.2.1 0 FULL/DROTHER 00:00:38 10.1.1.2 Tunnel1

    192.168.3.1 0 FULL/DROTHER 00:00:38 10.1.1.3 Tunnel1



    BINHDUONG#sh ip ospf neighbor



    Neighbor ID Pri State Dead Time Address Interface

    192.168.1.1 1 FULL/DR 00:00:36 10.1.1.1 Tunnel1



    SAIGON#sh ip route

    Codes: C - connected, S - static, 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

    i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

    ia - IS-IS inter area, * - candidate default, U - per-user static route

    o - ODR, P - periodic downloaded static route



    Gateway of last resort is 150.1.1.2 to network 0.0.0.0



    10.0.0.0/24 is subnetted, 1 subnets

    C 10.1.1.0 is directly connected, Tunnel1

    C 192.168.1.0/24 is directly connected, Loopback0

    192.168.2.0/32 is subnetted, 1 subnets

    O 192.168.2.1 [110/11112] via 10.1.1.2, 00:01:30, Tunnel1

    150.1.0.0/24 is subnetted, 1 subnets

    C 150.1.1.0 is directly connected, Serial0/0

    192.168.3.0/32 is subnetted, 1 subnets

    O 192.168.3.1 [110/11112] via 10.1.1.3, 00:01:30, Tunnel1

    S* 0.0.0.0/0 [1/0] via 150.1.1.2



    BINHDUONG#sh ip route

    Codes: C - connected, S - static, 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

    i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

    ia - IS-IS inter area, * - candidate default, U - per-user static route

    o - ODR, P - periodic downloaded static route



    Gateway of last resort is 151.1.1.2 to network 0.0.0.0



    10.0.0.0/24 is subnetted, 1 subnets

    C 10.1.1.0 is directly connected, Tunnel1

    192.168.1.0/32 is subnetted, 1 subnets

    O 192.168.1.1 [110/11112] via 10.1.1.1, 00:01:02, Tunnel1

    151.1.0.0/24 is subnetted, 1 subnets

    C 151.1.1.0 is directly connected, Serial0/0

    C 192.168.2.0/24 is directly connected, Loopback0

    192.168.3.0/32 is subnetted, 1 subnets

    O 192.168.3.1 [110/11112] via 10.1.1.3, 00:01:02, Tunnel1

    S* 0.0.0.0/0 [1/0] via 151.1.1.2



    Kiểm tra trạng thái ISAKMP



    Có hai kết nối đang hoạt động

    SAIGON#sh crypto isakmp sa

    dst src state conn-id slot

    150.1.1.1 151.1.1.1 QM_IDLE 1 0

    150.1.1.1 152.1.1.1 QM_IDLE 2 0



    SAIGON#sh crypto session

    Crypto session current status



    Interface: Tunnel1

    Session status: UP-ACTIVE

    Peer: 151.1.1.1/500

    IKE SA: local 150.1.1.1/500 remote 151.1.1.1/500 Active

    IPSEC FLOW: permit 47 host 150.1.1.1 host 151.1.1.1

    Active SAs: 2, origin: crypto map



    Interface: Tunnel1

    Session status: UP-ACTIVE

    Peer: 152.1.1.1/500

    IKE SA: local 150.1.1.1/500 remote 152.1.1.1/500 Active

    IPSEC FLOW: permit 47 host 150.1.1.1 host 152.1.1.1

    Active SAs: 2, origin: crypto map



    Có một kết nối đang hoạt động

    BINHDUONG#sh crypto isakmp sa

    dst src state conn-id slot

    150.1.1.1 151.1.1.1 QM_IDLE 1 0



    BINHDUONG#sh crypto session

    Crypto session current status



    Interface: Tunnel1

    Session status: UP-ACTIVE

    Peer: 150.1.1.1/500

    IKE SA: local 151.1.1.1/500 remote 150.1.1.1/500 Active

    IPSEC FLOW: permit 47 host 151.1.1.1 host 150.1.1.1

    Active SAs: 2, origin: crypto map



    Giao tiếp thành công giữa LAN SAIGON và BINHDUONG

    BINHDUONG#ping 192.168.1.1 source 192.168.2.1



    Type escape sequence to abort.

    Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:

    Packet sent with a source address of 192.168.2.1

    !!!!!

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





    BINHDUONG#sh crypto ipsec sa



    interface: Tunnel1

    Crypto map tag: Tunnel1-head-0, local addr. 151.1.1.1



    protected vrf:

    local ident (addr/mask/prot/port): (151.1.1.1/255.255.255.255/47/0)

    remote ident (addr/mask/prot/port): (150.1.1.1/255.255.255.255/47/0)

    current_peer: 150.1.1.1:500

    PERMIT, flags={origin_is_acl,}

    #pkts encaps: 204, #pkts encrypt: 204, #pkts digest: 204

    #pkts decaps: 384, #pkts decrypt: 384, #pkts verify: 384

    #pkts compressed: 0, #pkts decompressed: 0

    #pkts not compressed: 0, #pkts compr. failed: 0

    #pkts not decompressed: 0, #pkts decompress failed: 0

    #send errors 0, #recv errors 0



    Giao tiếp thành công giữa hai mạng Lan BINHDUONG và VUNGTAU

    BINHDUONG#ping 192.168.3.1 source 192.168.2.1



    Type escape sequence to abort.

    Sending 5, 100-byte ICMP Echos to 192.168.3.1, timeout is 2 seconds:

    Packet sent with a source address of 192.168.2.1

    !!!!!

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



    Kết nối mới được thiết lập



    BINHDUONG#sh crypto isakmp sa

    dst src state conn-id slot status

    152.1.1.1 151.1.1.1 QM_IDLE 3 0 ACTIVE

    151.1.1.1 152.1.1.1 QM_IDLE 2 0 ACTIVE

    150.1.1.1 151.1.1.1 QM_IDLE 1 0 ACTIVE



    BINHDUONG#sh crypto ipsec sa peer 152.1.1.1



    interface: Tunnel1

    Crypto map tag: Tunnel1-head-0, local addr 151.1.1.1



    protected vrf: (none)

    local ident (addr/mask/prot/port): (151.1.1.1/255.255.255.255/47/0)

    remote ident (addr/mask/prot/port): (152.1.1.1/255.255.255.255/47/0)

    current_peer 152.1.1.1 port 500

    PERMIT, flags={origin_is_acl,}

    #pkts encaps: 10, #pkts encrypt: 10, #pkts digest: 10

    #pkts decaps: 10, #pkts decrypt: 10, #pkts verify: 10

    #pkts compressed: 0, #pkts decompressed: 0

    #pkts not compressed: 0, #pkts compr. failed: 0

    #pkts not decompressed: 0, #pkts decompress failed: 0

    #send errors 0, #recv errors 0







    Giá trị ánh xạ mới được xây dựng



    BINHDUONG#sh ip nhrp

    10.1.1.1/32 via 10.1.1.1, Tunnel1 created 00:11:48, never expire

    Type: static, Flags: authoritative used

    NBMA address: 150.1.1.1

    10.1.1.3/32 via 10.1.1.3, Tunnel1 created 00:10:53, expire 01:47:48

    Type: dynamic, Flags: router

    NBMA address: 152.1.1.1



    VUNGTAU# sh ip nhrp

    10.1.1.1/32 via 10.1.1.1, Tunnel1 created 00:12:01, never expire

    Type: static, Flags: authoritative used

    NBMA address: 150.1.1.1

    10.1.1.2/32 via 10.1.1.2, Tunnel1 created 00:10:41, expire 01:48:36

    Type: dynamic, Flags: router

    NBMA address: 151.1.1.1
    Email : vnpro@vnpro.org
    ---------------------------------------------------------------------------------------------------------------
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