VPN Router To Router With NAT docx

18 227 0
VPN Router To Router With NAT docx

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

VPN Router To Router With NAT Tác giả Lê Anh Đức Ta có sơ đồ sau: Mô tả: Bài lab thực hiện quá trình tạo một tunnel giữa 2 LAN của 2 chi nhánh qua một môi trường public vớI router Gateway làm router giả lập ISP. Kết hợp ta sử dụng NAT để cho các host bên trong nôi bộ mạng ra internet trừ những traffic được gửI từ 2 LAN để tạo private tunnel. Cấu hình: RA: Building configuration *Mar 1 00:33:37.207: %SYS-5-CONFIG_I: Configured from console by console Current configuration : 1344 bytes ! version 12.2 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname RA ! ! memory-size iomem 10 ip subnet-zero ! ! ! ! crypto isakmp policy 10 hash md5 authentication pre-share crypto isakmp key cisco address 95.95.95.2 ! ! crypto ipsec transform-set vnpro esp-des ! crypto map lee 10 ipsec-isakmp set peer 95.95.95.2 set transform-set vnpro match address 115 ! ! ! voice call carrier capacity active ! ! ! ! ! ! ! ! ! mta receive maximum-recipients 0 ! ! ! ! interface FastEthernet0/0 ip address 10.50.50.50 255.255.255.0 ip nat inside duplex auto speed auto ! interface Serial0/0 ip address 99.99.99.2 255.255.255.0 ip nat outside no fair-queue crypto map lee ! interface FastEthernet0/1 no ip address shutdown duplex auto speed auto ! interface Serial0/1 no ip address shutdown ! ip nat inside source route-map nonat interface Serial0/0 overload  tất cả đều NAT khi đi ra ngoài trừ traffic trong tunnel ip classless ip route 0.0.0.0 0.0.0.0 99.99.99.1 ip http server ! ! access-list 110 deny ip 10.50.50.0 0.0.0.255 10.103.1.0 0.0.0.255 access-list 110 permit ip any any access-list 115 permit tcp 10.50.50.0 0.0.0.255 10.103.1.0 0.0.0.255 ! route-map nonat permit 10 match ip address 110 ! call rsvp-sync ! ! mgcp profile default ! dial-peer cor custom ! ! ! ! ! line con 0 line aux 0 line vty 0 4 ! ! end RB Building configuration Current configuration : 1203 bytes ! version 12.2 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname RB ! ! memory-size iomem 10 ip subnet-zero ! ! ! ! crypto isakmp policy 10 hash md5 authentication pre-share crypto isakmp key cisco address 99.99.99.2 ! ! crypto ipsec transform-set vnpro esp-des ! crypto map lee 10 ipsec-isakmp set peer 99.99.99.2 set transform-set vnpro match address 115 ! ! ! voice call carrier capacity active ! ! ! ! ! ! ! ! ! mta receive maximum-recipients 0 ! ! ! ! interface Ethernet0/0 ip address 10.103.1.75 255.255.255.0 ip nat inside half-duplex ! interface Serial0/0 ip address 95.95.95.2 255.255.255.0 ip nat outside no fair-queue crypto map lee ! ip nat inside source route-map nonat interface Serial0/0 overload ip classless ip route 0.0.0.0 0.0.0.0 95.95.95.1 ip http server ! ! access-list 110 deny ip 10.103.1.0 0.0.0.255 10.50.50.0 0.0.0.255 access-list 110 permit ip any any access-list 115 permit tcp 10.103.1.0 0.0.0.255 10.50.50.0 0.0.0.255 ! route-map nonat permit 10 match ip address 110 ! call rsvp-sync ! ! mgcp profile default ! dial-peer cor custom ! ! ! ! ! line con 0 line aux 0 line vty 0 4 ! ! end RI(Gateway) Building configuration 00:33:46: %SYS-5-CONFIG_I: Configured from console by console Current configuration: ! version 12.1 service timestamps debug uptime service timestamps log uptime no service password-encryption ! hostname RI ! ! ! ! ! ! ip subnet-zero ! ! ! ! interface Ethernet0 no ip address shutdown ! interface Serial0 ip address 99.99.99.1 255.255.255.0 clockrate 64000 ! interface Serial1 ip address 95.95.95.1 255.255.255.0 clockrate 64000 ! interface BRI0 no ip address shutdown [...]... bắt đầu tạo VPN vớI NAT: 1 Bước đầu tiên, ta thực hiện cấu hình VPN trên các router (Tương tự như bài VPN basic): RA: RA(config)#crypto isakmp policy 10 RA(config-isakmp)#hash md5 RA(config-isakmp)#authentication pre-share RA(config-isakmp)#exit RA(config)#crypto isakmp key cisco address 95.95.95.2 RA(config)#crypto ipsec transform-set vnpro esp-des RA(cfg-crypto-trans)#exit RA(config)#crypto map lee... } Interfaces using crypto map lee: Serial0/0 2 Thực hiện debug trên các router và ghi nhận kết quả: Ví dụ: trên RB:Ta thực hiện lệnh ping từ pc bên trong nộI bộ mạng ra ngòai internet và ra chính LAN bên kia: và ghi nhận kết quả lệnh debug ip nat: RB#debug ip nat IP NAT debugging is on RB#debug cry RB#debug crypto ipsec Crypto IPSEC debugging is on RB#debug crypto isakmp Crypto ISAKMP debugging is... configured RB(config-crypto-map)#set peer 99.99.99.2 RB(config-crypto-map)#set transform-set vnpro RB(config-crypto-map)#match address 115 RB(config)#int s0/0 RB(config-if)#crypto map lee RB(config)#access-list 115 permit tcp 10.103.1.0 0.0.0.255 10.50.50.0 0.0.0.255 2 Sau khi đã thực hiện tạo VPN, ta thực hiện NAT trên router: Ta thực hiện NAT overload trên interface nốI vớI Gateway, trừ traffic trong... 110 permit ip any any RB(config)#route-map nonat permit 10 RB(config-route-map)#match ip address 110 RB(config)#ip nat inside source route-map nonat interface s0/0 overload RB(config)#int s0/0 RB(config-if)#ip nat outside RB(config-if)#int e0/0 RB(config-if)#ip nat inside RB(config-if)#exit Kiểm tra: 1 Ta sử dụng các lệnh show trên các router: RA#sh crypto isakmp policy Protection suite of priority... RB(config)#crypto isakmp policy 10 RB(config-isakmp)#hash md5 RB(config-isakmp)#authentication pre-share RB(config)#crypto isakmp key cisco address 99.99.99.2 RB(config)#crypto ipsec transform-set vnpro esp-des RB(cfg-crypto-trans)#exit RB(config)#crypto map lee 10 ipsec-isakmp % NOTE: This new crypto map will remain disabled until a peer and a valid access list have been configured RB(config-crypto-map)#set... RA(config)#crypto map lee 10 ipsec-isakmp % NOTE: This new crypto map will remain disabled until a peer and a valid access list have been configured RA(config-crypto-map)#set peer 95.95.95.2 RA(config-crypto-map)#set transform-set vnpro RA(config-crypto-map)#match address 115 RA(config-crypto-map)#exit RA(config)#int s0/0 RA(config-if)#crypto map lee RA(config)#access-list 115 permit tcp 10.50.50.0 0.0.0.255... trong tunnel không bị NAT: RA: RA(config)#access-list 110 deny ip 10.50.50.0 0.0.0.255 10.103.1.0 0.0.0.255 RA(config)#access-list 110 permit ip any any RA(config)#route-map nonat RA(config-route-map)#match ip address 110 RA(config)#ip nat inside source route-map nonat interface s0/0 overload RA(config)#int s0/0 RA(config-if)#ip nat outside RA(config)#int fa0/0 RA(config-if)#ip nat inside RA(config-if)#exit... *Mar 1 00:41:23.847: NAT: s=10.103.1.1->95.95.95.2, d=99.99.99.1 [1760] *Mar 1 00:41:23.867: NAT* : s=99.99.99.1, d=95.95.95.2->10.103.1.1 [1760] *Mar 1 00:41:24.848: NAT* : s=10.103.1.1->95.95.95.2, d=99.99.99.1 [1761] *Mar 1 00:41:24.868: NAT* : s=99.99.99.1, d=95.95.95.2->10.103.1.1 [1761] *Mar 1 00:41:25.850: NAT* : s=10.103.1.1->95.95.95.2, d=99.99.99.1 [1762] *Mar 1 00:41:25.870: NAT* : s=99.99.99.1,... 1 00:41:26.847: NAT* : s=10.103.1.1->95.95.95.2, d=99.99.99.1 [1763] *Mar 1 00:41:26.872: NAT* : s=99.99.99.1, d=95.95.95.2->10.103.1.1 [1763] RB# *Mar 1 00:41:44.040: NAT: s=10.103.1.1->95.95.95.2, d=95.95.95.1 [1764] *Mar 1 00:41:44.064: NAT* : s=95.95.95.1, d=95.95.95.2->10.103.1.1 [1764] *Mar 1 00:41:45.037: NAT* : s=10.103.1.1->95.95.95.2, d=95.95.95.1 [1765] *Mar 1 00:41:45.057: NAT* : s=95.95.95.1,... 1 00:41:46.039: NAT* : s=10.103.1.1->95.95.95.2, d=95.95.95.1 [1766] *Mar 1 00:41:46.087: NAT* : s=95.95.95.1, d=95.95.95.2->10.103.1.1 [1766] *Mar 1 00:41:47.037: NAT* : s=10.103.1.1->95.95.95.2, d=95.95.95.1 [1767] *Mar 1 00:41:47.061: NAT* : s=95.95.95.1, d=95.95.95.2->10.103.1.1 [1767] RB# *Mar 1 00:42:00.270: NAT: s=10.103.1.1->95.95.95.2, d=99.99.99.2 [1768] *Mar 1 00:42:00.314: NAT* : s=99.99.99.2, . ip nat: RB#debug ip nat IP NAT debugging is on RB#debug cry RB#debug crypto ipsec Crypto IPSEC debugging is on RB#debug crypto isakmp Crypto ISAKMP debugging is on RB# *Mar 1 00:41:23.847: NAT: . VPN Router To Router With NAT Tác giả Lê Anh Đức Ta có sơ đồ sau: Mô tả: Bài lab thực hiện quá trình tạo một tunnel giữa 2 LAN của 2 chi nhánh qua một môi trường public vớI router. mạng thấy được nhau, ta bắt đầu tạo VPN vớI NAT: 1. Bước đầu tiên, ta thực hiện cấu hình VPN trên các router (Tương tự như bài VPN basic): RA: RA(config)#crypto isakmp policy 10 RA(config-isakmp)#hash

Ngày đăng: 25/07/2014, 07:21

Từ khóa liên quan

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan