cisco GRE over ipsec -NAT环境(外网接口和loopback二种模式)

一、IPSEC:二边静态和NAT-1-1

1.GRE Over IPSEC

Ipterm3:172.99.99.2/24 GW:172.99.99.1
Ipterm4:172.99.98.2/24 GW:172.99.98.1
R3:F0/0 10.0.0.1 /24 nat inside F0/1:172.99.99.1/24 nat outside
R4:F0/0 10.1.1.2 /24 nat inside F0/1:172.99.98.1/24 nat outside
Fortigate:port1 10.0.0.254/24 port2:10.1.1.254/24
term-3-eth0----f0/1 R3 f0/0---port1- Fortigate-port2-F0/0-R4-f0/1—eth0-term4
(in-NAT-out) (in-NAT-Out) (out-NAT-in)

Fortigate 10.1.1.1---?10.0.0.1 vip map

1.1 类型
IPSEC---outside-outside(GRE端点)
Tunnel—outside---outside(GRE)

R3:配置
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R3
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
no ip icmp rate-limit unreachable
ip cef
no ip domain lookup
!
multilink bundle-name authenticated
!
archive
log config
hidekeys
!
!
crypto isakmp policy 10
hash md5
authentication pre-share
group 2
crypto isakmp key ccie address 10.1.1.2
!
!
crypto ipsec transform-set GRETrans esp-des esp-md5-hmac
mode transport
!
crypto map mymap 10 ipsec-isakmp
set peer 10.1.1.2
set transform-set GRETrans
set pfs group2
match address 110
!
!
!
ip tcp synwait-time 5
!
!
!
!
interface Tunnel0
ip address 172.16.2.1 255.255.255.0
tunnel source FastEthernet0/0
tunnel destination 10.1.1.2
!
interface FastEthernet0/0
ip address 10.0.0.1 255.255.255.0
ip nat outside
ip virtual-reassembly
duplex auto
speed auto
crypto map mymap
!
interface Serial0/0
no ip address
shutdown
clock rate 2000000
!
interface FastEthernet0/1
ip address 172.99.99.1 255.255.255.0
ip nat inside
ip virtual-reassembly
duplex auto
speed auto
!
interface Serial0/1
no ip address
shutdown
clock rate 2000000
!
interface FastEthernet1/0
no ip address
shutdown
duplex auto
speed auto
!
ip forward-protocol nd
ip route 0.0.0.0 0.0.0.0 10.0.0.254
ip route 172.99.98.0 255.255.255.0 Tunnel0
!
!
no ip http server
no ip http secure-server
ip nat inside source list 100 interface FastEthernet0/0 overload
!
access-list 100 permit ip any any
access-list 110 permit gre host 10.0.0.1 host 10.1.1.2
no cdp log mismatch duplex
!
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
line vty 0 4
login
!
!
end

!

R4:配置
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R4
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
no ip icmp rate-limit unreachable
ip cef
!
!
!
!
no ip domain lookup
!
multilink bundle-name authenticated
!
!
!
archive
log config
hidekeys
!
!
crypto isakmp policy 10
hash md5
authentication pre-share
group 2
crypto isakmp key ccie address 10.1.1.1
!
!
crypto ipsec transform-set GRETrans esp-des esp-md5-hmac
mode transport
!
crypto map mymap 10 ipsec-isakmp
set peer 10.1.1.1
set transform-set GRETrans
set pfs group2
match address 110
!
!
!
ip tcp synwait-time 5
!
!
!
!
interface Tunnel0
ip address 172.16.2.2 255.255.255.0
tunnel source FastEthernet0/0
tunnel destination 10.1.1.1
!
interface FastEthernet0/0
ip address 10.1.1.2 255.255.255.0
ip nat outside
ip virtual-reassembly
duplex auto
speed auto
crypto map mymap
!
interface Serial0/0
no ip address
shutdown
clock rate 2000000
!
interface FastEthernet0/1
ip address 172.99.98.1 255.255.255.0
ip nat inside
ip virtual-reassembly
duplex auto
speed auto
!
interface Serial0/1
no ip address
shutdown
clock rate 2000000
!
interface FastEthernet1/0
no ip address
shutdown
duplex auto
speed auto
!
ip forward-protocol nd
ip route 0.0.0.0 0.0.0.0 10.1.1.254
ip route 172.99.99.0 255.255.255.0 Tunnel0
!
!
no ip http server
no ip http secure-server
ip nat inside source list 100 interface FastEthernet0/0 overload
!
access-list 100 deny gre host 10.1.1.2 host 10.1.1.1
access-list 100 permit ip any any
access-list 110 permit gre host 10.1.1.2 host 10.1.1.1
no cdp log mismatch duplex
!
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
line vty 0 4
login
!
!
end

1.2 类型

Term-1-eth0-F0/1-R1-F0/0-F0/0-R2-Term-2
in-NAT-out out-NAT-in
IPSEC—R1-loopback0-loopback0(GRE端点)-R2
Tunnel—R1-loopback0-loopback0(GRE端点)-R2(GRE)

R1:配置
!
!

!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
enable password cisco
!
no aaa new-model
memory-size iomem 5
no ip icmp rate-limit unreachable
ip cef
!
!
!
!
no ip domain lookup
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
archive
log config
hidekeys
!
!
crypto isakmp policy 1
encr 3des
authentication pre-share
group 2
lifetime 28800
crypto isakmp key 123456 address 10.1.1.2
crypto isakmp nat keepalive 3600
!
!
crypto ipsec transform-set set1 esp-3des esp-sha-hmac
!
crypto map mymap 1 ipsec-isakmp
set peer 10.1.1.2
set security-association lifetime seconds 28800
set transform-set set1
set pfs group2
match address 110
!
!
!
ip tcp synwait-time 5
!
!
!
!
interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
interface Tunnel10
ip address 172.16.6.1 255.255.255.252
tunnel source Loopback0
tunnel destination 1.1.1.2
!
interface FastEthernet0/0
ip address 10.1.1.1 255.255.255.0
ip nat outside
ip virtual-reassembly
duplex auto
speed auto
crypto map mymap
!
interface Serial0/0
no ip address
shutdown
clock rate 2000000
!
interface FastEthernet0/1
ip address 172.99.99.1 255.255.255.0
ip nat inside
ip virtual-reassembly
duplex auto
speed auto
!
interface Serial0/1
no ip address
shutdown
clock rate 2000000
!
interface FastEthernet1/0
no ip address
shutdown
duplex auto
speed auto
!
ip forward-protocol nd
ip route 0.0.0.0 0.0.0.0 10.1.1.254
ip route 172.99.98.0 255.255.255.0 Tunnel10
!
!
no ip http server
no ip http secure-server
ip nat inside source list 100 interface FastEthernet0/0 overload
!
access-list 100 deny ip host 1.1.1.1 host 1.1.1.2
access-list 100 permit ip any any
access-list 110 permit ip host 1.1.1.1 host 1.1.1.2
no cdp log mismatch duplex
!
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
line vty 0 4
password cisco
login
!
!
end

R2:配置
!
!

!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
enable password cisco
!
no aaa new-model
memory-size iomem 5
no ip icmp rate-limit unreachable
ip cef
!
!
!
!
no ip domain lookup
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
archive
log config
hidekeys
!
!
crypto isakmp policy 1
encr 3des
authentication pre-share
group 2
lifetime 28800
crypto isakmp key 123456 address 10.1.1.1
!
!
crypto ipsec transform-set set1 esp-3des esp-sha-hmac
!
crypto map mymap 1 ipsec-isakmp
set peer 10.1.1.1
set security-association lifetime seconds 28800
set transform-set set1
set pfs group2
match address 110
!
!
!
ip tcp synwait-time 5
!
!
!
!
interface Loopback0
ip address 1.1.1.2 255.255.255.255
!
interface Tunnel10
ip address 172.16.6.2 255.255.255.252
tunnel source Loopback0
tunnel destination 1.1.1.1
!
interface FastEthernet0/0
ip address 10.1.1.2 255.255.255.0
ip nat outside
ip virtual-reassembly
duplex auto
speed auto
crypto map mymap
!
interface Serial0/0
no ip address
shutdown
clock rate 2000000
!
interface FastEthernet0/1
ip address 172.99.98.1 255.255.255.0
ip nat inside
ip virtual-reassembly
duplex auto
speed auto
!
interface Serial0/1
no ip address
shutdown
clock rate 2000000
!
interface FastEthernet1/0
no ip address
shutdown
duplex auto
speed auto
!
ip forward-protocol nd
ip route 0.0.0.0 0.0.0.0 10.1.1.254
ip route 172.99.99.0 255.255.255.0 Tunnel10
!
!
no ip http server
no ip http secure-server
ip nat inside source list 100 interface FastEthernet0/0 overload
!
access-list 100 deny ip host 1.1.1.2 host 1.1.1.1
access-list 100 permit ip any any
access-list 110 permit ip host 1.1.1.2 host 1.1.1.1
no cdp log mismatch duplex
!
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
line vty 0 4
password cisco
login
!
!
end

1.3 类型(IPSEC NAT穿越)1.2类延伸
2.
Term-1-eth0-F0/1-R1-F0/0-port1-Fortigate-port2-F0/0-R2-Term-2
in-NAT-out in-NAT-out out-NAT-in
IPSEC—R1-loopback0-loopback0(GRE端点)-R2
Tunnel—R1-loopback0-loopback0(GRE端点)-R2(GRE)

R5配置:
!

!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R5
!
boot-start-marker
boot-end-marker
!
enable password cisco
!
no aaa new-model
memory-size iomem 5
no ip icmp rate-limit unreachable
ip cef
!
!
!
!
no ip domain lookup
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
archive
log config
hidekeys
!
!
crypto isakmp policy 1
encr 3des
authentication pre-share
group 2
lifetime 28800
crypto isakmp key 123456 address 10.1.1.2
crypto isakmp nat keepalive 3600
!
!
crypto ipsec transform-set set1 esp-3des esp-sha-hmac
!
crypto map mymap 1 ipsec-isakmp
set peer 10.1.1.2
set security-association lifetime seconds 28800
set transform-set set1
set pfs group2
match address 110
!
!
!
ip tcp synwait-time 5
!
!
!
!
interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
interface Tunnel10
ip address 172.16.6.1 255.255.255.252
tunnel source Loopback0
tunnel destination 1.1.1.2
!
interface FastEthernet0/0
ip address 10.0.0.1 255.255.255.0
ip nat outside
ip virtual-reassembly
duplex auto
speed auto
crypto map mymap
!
interface Serial0/0
no ip address
shutdown
clock rate 2000000
!
interface FastEthernet0/1
ip address 172.99.99.1 255.255.255.0
ip nat inside
ip virtual-reassembly
duplex auto
speed auto
!
interface Serial0/1
no ip address
shutdown
clock rate 2000000
!
interface FastEthernet1/0
no ip address
shutdown
duplex auto
speed auto
!
ip forward-protocol nd
ip route 0.0.0.0 0.0.0.0 10.0.0.254
!
!
no ip http server
no ip http secure-server
ip nat inside source list 100 interface FastEthernet0/0 overload
!
access-list 100 deny ip host 1.1.1.1 host 1.1.1.2
access-list 100 permit ip any any
access-list 110 permit ip host 1.1.1.1 host 1.1.1.2
no cdp log mismatch duplex
!
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
line vty 0 4
password cisco
login
!
!
end

R6:配置
!

!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R6
!
boot-start-marker
boot-end-marker
!
enable password cisco
!
no aaa new-model
memory-size iomem 5
no ip icmp rate-limit unreachable
ip cef
!
!
!
!
no ip domain lookup
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
archive
log config
hidekeys
!
!
crypto isakmp policy 1
encr 3des
authentication pre-share
group 2
lifetime 28800
crypto isakmp key 123456 address 10.1.1.1
!
!
crypto ipsec transform-set set1 esp-3des esp-sha-hmac
!
crypto map mymap 1 ipsec-isakmp
set peer 10.1.1.1
set security-association lifetime seconds 28800
set transform-set set1
set pfs group2
match address 110
!
!
!
ip tcp synwait-time 5
!
!
!
!
interface Loopback0
ip address 1.1.1.2 255.255.255.255
!
interface Tunnel10
ip address 172.16.6.2 255.255.255.252
tunnel source Loopback0
tunnel destination 1.1.1.1
!
interface FastEthernet0/0
ip address 10.1.1.2 255.255.255.0
ip nat outside
ip virtual-reassembly
duplex auto
speed auto
crypto map mymap
!
interface Serial0/0
no ip address
shutdown
clock rate 2000000
!
interface FastEthernet0/1
ip address 172.99.98.1 255.255.255.0
ip nat inside
ip virtual-reassembly
duplex auto
speed auto
!
interface Serial0/1
no ip address
shutdown
clock rate 2000000
!
interface FastEthernet1/0
no ip address
shutdown
duplex auto
speed auto
!
ip forward-protocol nd
ip route 0.0.0.0 0.0.0.0 10.1.1.254
ip route 172.99.99.0 255.255.255.0 Tunnel10
!
!
no ip http server
no ip http secure-server
ip nat inside source list 100 interface FastEthernet0/0 overload
!
access-list 100 deny ip host 1.1.1.2 host 1.1.1.1
access-list 100 permit ip any any
access-list 110 permit ip host 1.1.1.2 host 1.1.1.1
no cdp log mismatch duplex
!
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
line vty 0 4
password cisco
login
!
!
end

二、IPSEC:一边静态、一边动态或没有NAT1-1

原文地址:http://blog.51cto.com/372560/2177839

时间: 2024-10-08 02:48:14

cisco GRE over ipsec -NAT环境(外网接口和loopback二种模式)的相关文章

用静态NAT实现外网PC访问内网服务器

在我们的生产环境中常常处于安全考虑将服务器置于内网环境中,但同时得向外网提供各种服务功能,此时就需要用到NAT技术.下面是我用思科的仿真软件搭建的一个实验环境,实现外网PC访问内网服务器. 先说明一下实验环境: 路由器R0左边为内网环境,右边为外网环境,内网服务器IP地址为192.168.1.2,网关为R0接口地址192.168.1.1,外网PC机IP地址为211.211.211.2,网关为路由器R1接口地址211.211.211.1,现在要求实现外网PC访问内网服务器. 数据配置如下: 路由器

嵌入式专题: 双网卡wifi组建NAT上外网

条件: 开发板上双网卡,其中一个是usb wifi,提供wifi路由功能.另一个网口可以上外网. 目标:普通PC/手机能够连此wifi路由,上外网. 1. Wifi AP USB Wifi部分:勿用多言,此使用Realtek 8188 UC版本,这款Wifi的官方软件自带了驱动程序相应的应用软件.应该就是RTL8188C_8192C_USB_linux_v4.0.2_9000.20130911.zip这个程序包,里面有3个部分,一个是驱动,一个是hostapd,一个是wpa_supplicant

外网登陆SAP的两种方式

1.用SAP router实现从外网登录SAP服务器(方式一) 自已搭建的局域网结构如下: SAP服务器IP: 192.168.0.2, 路由器中设为DMZ区 在SAP服务器上启用SAP router,即可 SAP router的搭建非常简单: 1.找到SAP的安装目录(例如D:\usr\sap\ECC\DVEBMGS00\exe\),可以看到saprouter.exe文件 2. 用记事本建立一个名为SAPROUTTAB的文件(没有扩展名), 输入 P * * * 后保存 3.打开c:\syst

巧用双向NAT实现外网端口映射

  环境介绍 1. FW1有固定公网IP(默认走internet1),FW2通过拨号上网(默认走internet2),地址不固定 2. 部门A通过fw1作为出口(SNAT),部门B通过fw2作为出口(SNAT) 3. 外网用户想直接访问内部业务系统192.168.1.100的9000端口 网络拓扑如下: 配置过程: 涉及到多层NAT的地址转换,外网要访问内网的端口,首先考虑到了DNAT,如在fw1中配置DNAT地址映射,100.1.1.10:9000----->192.168.0.11:9000

关于虚拟机NAT连接外网!!!

点开Virtual Network Editor(开始->VMware),选择vmnet8, NAT setting就可以知道了. 1.  虚拟机NAT和主机的通讯方式,是通过虚拟网关(即NAT服务192.168.164.2)来实现的,只要NAT服务虚拟出来的网关,虚拟机IP地址及vmnet8在同一个IP段中就可以相互通讯; 2.  VMnet8网卡用于主机与NAT服务通信,就像虚拟机的网卡和NAT服务通讯一样; 3. VMnet8是不用经过VMnet0的. 如果你主机有两张物理网卡的话,验证这

VMware NAT连接外网

背景:在企业中由于经常做实验需要实验机上外网,自己又不是管理员,没有那么多可以上外网的IP,所以需要设置虚拟机共享上网,有同事问我怎么操作,把设置记录如下: 安装完VMware后选择本地联接: 设置共享: 查看VMnet8状态: 设置VMware: 设置虚拟机网卡模式为VMware(NAT8) 进系统把网卡设置成DHCP 观察IP变化: 测试网络: Linux系统: 同样设置虚拟机网卡模式为VMware(NAT8) 进入系统:设置网卡为DHCP启动模式 vim /etc/sysconfig/ne

阿里云服务器安装Apache环境外网不能访问

今天在阿里云上配置Apache+mysql+PHP,发现使用浏览器一直访问不了 我在网上找了好多方法都没有用,然后我想是不是因为服务器是阿里云的关系. 因为我以前帮同事搭建过环境,都没有出现这个问题. 最后找到还真是阿里云的问题:因为安全组默认没有放行网站使用的端口(如80端口).你需要自行放行该端口 设置之后,访问就正常了.

VM虚拟机NAT链接外网

1.vi /etc/sysconfig/networkNETWORKING=yesHOSTNAME=localhost.localdomainGATEWAY=192.168.110.2 2.vi /etc/resolv.confsearch localdomainnameserver 192.168.110.2 3.vi /etc/sysconfig/network-scripts/ifcfg-eth0DEVICE=eth0HWADDR=00:0C:29:0D:CE:14TYPE=Etherne

IPsec VPN详解--nat穿越内网

四. NAT穿越内网路由VPN设置 如图1所示,Router A为某机构总部网关,Router D和Router E是两个分支网关,Router B和Router C为分支提供NAT转换.要求:为了接受协商发起端的访问控制列表设置,Router A采用安全模板方式分别与Router D和Router E建立IPsec VPN,为总部和分支流量进行加密传输. 图1 IPSec VPN多分支安全模板NAT穿越功能的配置举例组网图 设备 接口 IP地址 设备 接口 IP地址 Router  A Eth