日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

思科 IPSec ***配置2:

發布時間:2024/4/14 编程问答 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 思科 IPSec ***配置2: 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

要求:

1. 研發小組可以通過×××訪問總公司研發服務器,但不能訪問internet 2. 分公司的其他客戶端可以訪問internet

實驗topo構想:

終端配置:



ip地址配置:

R0配置:

Router>enable
Router#conf t
Router(config)#no ip domain lookup
Router(config)#line console 0
Router(config-line)#exec-timeout 0
Router(config-line)#^Z
Router#conf t
Router(config)#hostname R0
R0(config)#inter f0/0
R0(config-if)#no shutdown
R0(config-if)#ip add 176.16.10.254 255.255.255.0
R0(config-if)#inter f0/1
R0(config-if)#no shutdown
R0(config-if)#ip address 172.16.20.254 255.255.255.0
R0(config)#inter f1/0
R0(config-if)#no shut
R0(config-if)#ip add 192.168.1.1 255.255.255.252
R0(config-if)#^Z
測試連通性:
R0#ping 172.16.10.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.10.1, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 0/0/3 ms
R0#ping 172.16.20.1

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

R1配置:

Router>en
Router#conf t
Router(config)#hostname R1
Router(config)#no ip domain lookup
R1(config)#line console 0
R1(config-line)#exec-timeout 0
R1(config-line)#exit
R1(config)#inter f0/1
R1(config-if)#no shutdown
R1(config-if)#ip add 192.168.1.2 255.255.255.252
R1(config-if)#inter f0/0
R1(config-if)#no shutdown
R1(config-if)#ip add 100.0.0.1 255.255.255.252
R1(config-if)#^Z
測試連通性:
R1#ping 192.168.1.1

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

ISP配置:

Router>enable
Router#conf t
Router(config)#no ip domain lookup
Router(config)#hostname ISP
ISP(config)#line console 0
ISP(config-line)#exec-timeout 0
ISP(config-line)#^Z
ISP#conf t
ISP(config)#inter f0/1
ISP(config-if)#no shutdown
ISP(config-if)#ip address 100.0.0.2 255.255.255.252
ISP(config-if)#inter f0/0
ISP(config-if)#no shutdown
ISP(config-if)#ip add 200.0.0.1 255.255.255.252
ISP(config-if)#^Z
測試連通性:
ISP#ping 100.0.0.1

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

R2配置:

Router>enable
Router#conf t
Router(config)#hostname R2
R2(config)#no ip domain lookup
R2(config)#line console 0
R2(config-line)#exec-timeout 0
R2(config-line)#exit
R2(config)#inter f0/1
R2(config-if)#no shutdown
R2(config-if)#ip add 200.0.0.2 255.255.255.252
R2(config-if)#inter f0/0
R2(config-if)#no shutdown
R2(config-if)#ip add 10.10.33.254 255.255.255.0
R2(config-if)#^Z
測試連通性:
R2#ping 200.0.0.1

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

R2#ping 10.10.33.1

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

配置路由:

R0#conf t
R0(config)#ip route 0.0.0.0 0.0.0.0 192.168.1.2
R0(config)#^Z

R1#conf t
R1(config)#ip route 0.0.0.0 0.0.0.0 192.168.1.1
R1(config)#ip route 0.0.0.0 0.0.0.0 100.0.0.2

R2#conf t
R2(config)#ip route 0.0.0.0 0.0.0.0 200.0.0.1

配置ISAKMP策略:

R1(config)#crypto isakmp policy 1
R1(config-isakmp)#encryption 3des
R1(config-isakmp)#hash sha
R1(config-isakmp)#authentication pre-share
R1(config-isakmp)#group 2
R1(config-isakmp)#exit
R1(config)#crypto isakmp key hahui address 200.0.0.2

R2#conf t
R2(config)#crypto isakmp policy 1
R2(config-isakmp)#encryption 3des
R2(config-isakmp)#hash sha
R2(config-isakmp)#authentication pre-share
R2(config-isakmp)#group 2
R2(config)#crypto isakmp key hahui address 100.0.0.1

配置ACL:

R1(config)#access-list 100 permit ip 172.16.10.0 0.0.0.255 10.10.33.0 0.0.0.255
R1(config)#ip nat inside source list 1 interface f0/0 overload
R1(config)#inter f0/0
R1(config-if)#ip nat outside
R1(config-if)#inter f0/1
R1(config-if)#ip nat inside
R1(config-if)#exit

R2(config)#access-list 100 permit ip 10.10.33.0 0.0.0.255 172.16.10.0 0.0.0.255

配置 IPSec 策略(轉換集)

R1(config)#crypto ipsec transform-set hh-set ah-sha-hmac esp-des

R2(config)#crypto ipsec transform-set hh-set ah-sha-hmac esp-des

配置加密映射集

R1(config)#crypto map hh-map 1 ipsec-isakmp
R1(config-crypto-map)#set peer 200.0.0.2
R1(config-crypto-map)#set transform-set hh-set
R1(config-crypto-map)#match address 100

R2(config)#crypto map hh-map 1 ipsec-isakmp
R2(config-crypto-map)#set peer 100.0.0.1
R2(config-crypto-map)#set transform-set hh-set
R2(config-crypto-map)#match address 100

將映射集應用到接口

R1(config)#inter f0/0
R1(config-if)#crypto map hh-map

R2(config)#inter f0/1
R2(config-if)#crypto map hh-map

查看第一階段狀態:
首先要用 流量觸發IPSec

R1#show crypto isakmp sa

R2#show crypto isakmp sa

測試:

  • 研發小組訪問不了internet,可以訪問研發服務器。

其他客戶端就可以訪問internet,就沒有權限訪問研發服務器了。


開啟debug ip nat 查看地址是否轉換

在R2上開啟debug ip packet,觀察包的信息,看看地址是否轉換

要求二:

1. 研發小組的流量走PAT,不走××× 2. 研發小組流量可以走PAT,也可以走×××

具體配置步驟:

1. 研發小組的流量走PAT,不走×××(意思就是可以上網,不能訪問研發服務器)

在R1上添加配置:
R1(config)#access-list 1 permit 172.16.10.0 0.0.0.255
R1(config)#ip nat inside source list 1 interface f0/0 overload
測試:

查看地址轉換

  • 研發小組流量可以走PAT,也可以走×××(意思就是既可以上internet,還可以訪問研發服務器:實際中,個人覺得很少有公司會這么做,因為要考慮到信息的安全性;通常就是只通過×××訪問,如果還可以通過internet,那么***就可以在internet上輕松的截取信息)
  • R1添加配置:
    要刪除access-list 1 permit 172.16.10.0 0.0.0.255這條命令
    R1(config)#no access-list 1 permit 172.16.10.0 0.0.0.255
    R1(config)#access-list 110 deny ip 172.16.10.0 0.0.0.255 10.10.33.0 0.0.0.255
    R1(config)#access-list 110 permit ip any any
    R1(config)#ip nat inside source list 110 interface f0/0 overload
    測試:

    轉載于:https://blog.51cto.com/13555515/2069160

    總結

    以上是生活随笔為你收集整理的思科 IPSec ***配置2:的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。