Cisco ISR IPSEC to IPSEC (GNS3)



This is a basic  config for IPsec to IPsec tunneling between two cisco ISRs. I prefer to use GRE tunneling for Lan to Lan but this is commonly used when connecting to 3rd parties or where GRE tunneling is not available.



###############################
## NYC ##
###############################

conf t

router ospf 1
network 30.0.0.0 0.0.0.255 area 0
network 1.1.1.0 0.0.0.255 area 0

ip access-list ext 101
 permit icmp host 1.1.1.1 host 3.3.3.3


crypto isakmp policy 10
 encr aes 256
 authentication pre-share
 group 5
 lifetime 1300

crypto isakmp key 0 vault address 40.0.0.1 

crypto ipsec security-association lifetime seconds 1800
crypto ipsec transform-set MYSET esp-aes esp-sha-hmac

crypto map MYMAP 10 ipsec-isakmp
 set peer 40.0.0.1
 set transform-set MYSET
 match address 101

int fa0/0
 ip addr 30.0.0.1 255.255.255.0
 crypto map MYMAP
 no shut

int lo1
ip addr 1.1.1.1 255.255.255.0


###############################
## SAN FRAN##
###############################

conf t

router ospf 1
network 40.0.0.0 0.0.0.255 area 0
network 3.3.3.0 0.0.0.255 area 0

ip access-list ext 101
permit icmp host 3.3.3.3 host 1.1.1.1

crypto isakmp policy 10
encr aes 256
authentication pre-share
group 5
lifetime 1300

crypto isakmp key 0 vault address 30.0.0.1 

crypto ipsec security-association lifetime seconds 1800
crypto ipsec transform-set MYSET esp-aes esp-sha-hmac

crypto map MYMAP 10 ipsec-isakmp
set peer 30.0.0.1
set transform-set MYSET
match address 101

int fa0/0
ip addr 40.0.0.1 255.255.255.0
crypto map MYMAP
no shut

int lo1
ip addr 3.3.3.3 255.255.255.0


###############################
## INTERNET ##
###############################

conf t

int fa0/0
ip addr 30.0.0.2 255.255.255.0
no shut

int fa0/1
ip addr 40.0.0.2 255.255.255.0
no shut

router ospf 1
network 30.0.0.0 0.0.0.255 area 0
network 40.0.0.0 0.0.0.255 area 0

###############################
## TESTING ##
###############################

## Ping from NY to SF ##
ping 3.3.3.3 source lo1

## Ping from SF to NY ##
ping 1.1.1.1 source lo1

## Debug commands ##
debug crypto isakmp 



Comments

Popular posts from this blog

Configure OSPF Juniper SRX

Upgrading JUNOS via USB