思科路由器ipsecvpn高级配置

在这里插入图片描述
完成:
所有的分支和总部都可以ipsecvpn互防,且都能上公网访问服务器。 分支和分支也能ipsecvpn访问,走的是总部跳转。

总部路由配置:

bj-router#show running-config
Building configuration…

Current configuration : 1627 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname bj-router
!
!
!
!
!
!
!
!
ip cef
no ipv6 cef
!
!
!
!
crypto isakmp policy 1
encr aes 256
authentication pre-share
!
crypto isakmp key adminadmin address 120.1.1.2
crypto isakmp key adminadmin address 200.1.1.2
!
!
!
crypto ipsec transform-set beijing esp-aes 128 esp-sha-hmac
!
crypto map beijing-map 1 ipsec-isakmp
set peer 200.1.1.2
set transform-set beijing
match address 100
!
crypto map beijing-map 2 ipsec-isakmp
set peer 120.1.1.2
set transform-set beijing
match address 103
!
!
!
!
no ip domain-lookup
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface FastEthernet0/0
ip address 100.1.1.1 255.255.255.0
ip nat outside
duplex auto
speed auto
crypto map beijing-map
!
interface FastEthernet0/1
ip address 192.168.1.254 255.255.255.0
ip nat inside
duplex auto
speed auto
!
interface Vlan1
no ip address
shutdown
!
ip nat inside source list 101 interface FastEthernet0/0 overload
ip classless
ip route 0.0.0.0 0.0.0.0 100.1.1.2
!
ip flow-export version 9
!
!
access-list 100 permit ip 192.168.1.0 0.0.0.255 172.16.1.0 0.0.0.255
access-list 100 permit ip 10.1.1.0 0.0.0.255 172.16.1.0 0.0.0.255
access-list 101 deny ip 192.168.1.0 0.0.0.255 10.1.1.0 0.0.0.255
access-list 101 deny ip 192.168.1.0 0.0.0.255 172.16.1.0 0.0.0.255
access-list 101 permit ip any any
access-list 103 permit ip 192.168.1.0 0.0.0.255 10.1.1.0 0.0.0.255
access-list 103 permit ip 172.16.1.0 0.0.0.255 10.1.1.0 0.0.0.255
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
!
!
end

广州分支路由:

gz-route#show running-config
Building configuration…

Current configuration : 1379 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname gz-route
!
!
!
!
!
!
!
!
ip cef
no ipv6 cef
!
!
!
!
crypto isakmp policy 1
encr aes 256
authentication pre-share
!
crypto isakmp key adminadmin address 100.1.1.1
!
!
!
crypto ipsec transform-set guanzhou esp-aes 128 esp-sha-hmac
crypto ipsec transform-set guangzhou esp-aes 128 esp-sha-hmac
!
crypto map guangzhou-map 1 ipsec-isakmp
set peer 100.1.1.1
set transform-set guangzhou
match address 100
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface FastEthernet0/0
ip address 120.1.1.2 255.255.255.0
ip nat outside
duplex auto
speed auto
crypto map guangzhou-map
!
interface FastEthernet0/1
ip address 10.1.1.254 255.255.255.0
ip nat inside
duplex auto
speed auto
!
interface Vlan1
no ip address
shutdown
!
ip nat inside source list 101 interface FastEthernet0/0 overload
ip classless
ip route 0.0.0.0 0.0.0.0 120.1.1.1
!
ip flow-export version 9
!
!
access-list 100 permit ip 10.1.1.0 0.0.0.255 192.168.1.0 0.0.0.255
access-list 100 permit ip 10.1.1.0 0.0.0.255 172.16.1.0 0.0.0.255
access-list 101 deny ip 10.1.1.0 0.0.0.255 172.16.1.0 0.0.0.255
access-list 101 deny ip 10.1.1.0 0.0.0.255 192.168.1.0 0.0.0.255
access-list 101 permit ip any any
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
!
!
end

gz-route#

上海分支路由:

sh-router#show running-config
Building configuration…

Current configuration : 1341 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname sh-router
!
!
!
!
!
!
!
!
ip cef
no ipv6 cef
!
!
!
!
crypto isakmp policy 1
encr aes 256
authentication pre-share
!
crypto isakmp key adminadmin address 100.1.1.1
!
!
!
crypto ipsec transform-set shanghai esp-aes 128 esp-sha-hmac
!
crypto map shanghai-map 1 ipsec-isakmp
set peer 100.1.1.1
set transform-set shanghai
match address 100
!
!
!
!
no ip domain-lookup
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface FastEthernet0/0
ip address 172.16.1.254 255.255.255.0
ip nat inside
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 200.1.1.2 255.255.255.0
ip nat outside
duplex auto
speed auto
crypto map shanghai-map
!
interface Vlan1
no ip address
shutdown
!
ip nat inside source list 101 interface FastEthernet0/1 overload
ip classless
ip route 0.0.0.0 0.0.0.0 200.1.1.1
!
ip flow-export version 9
!
!
access-list 100 permit ip 172.16.1.0 0.0.0.255 192.168.1.0 0.0.0.255
access-list 100 permit ip 172.16.1.0 0.0.0.255 10.1.1.0 0.0.0.255
access-list 101 deny ip 172.16.1.0 0.0.0.255 10.1.1.0 0.0.0.255
access-list 101 deny ip 172.16.1.0 0.0.0.255 192.168.1.0 0.0.0.255
access-list 101 permit ip any any
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
!
!
end

sh-router#

ISP路由配置:

isp#show running-config
Building configuration…

Current configuration : 753 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname isp
!
!
!
!
!
!
!
!
no ip cef
no ipv6 cef
!
!
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface FastEthernet0/0
ip address 100.1.1.2 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 200.1.1.1 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet1/0
ip address 120.1.1.1 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet1/1
ip address 150.1.1.254 255.255.255.0
duplex auto
speed auto
!
interface Vlan1
no ip address
shutdown
!
ip classless
!
ip flow-export version 9
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
!
!
end

isp#

查看协商:

show crypto isakmp sa (这个必须要有ping流量才能看到)
show crypto ipsec sa

查看两边加密算法等配置是否一样:

show crypto isakmp policy
show crypto ipsec than…

  • 2
    点赞
  • 30
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

项目工程师余工

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值