Solved

IPSEC vpn tunnel setup

Posted on 2009-04-05
9
736 Views
Last Modified: 2012-05-06
I am trying to learn how to setup IPSEC tunnel between routers connected via cable (emulating the cloud). I can ping the two ends fine, but the ping fails if the interesting traffic tries to flow thro' it. Please see the conf below for the setup.

ping to 3.1 from remote is ok
ping to 2.1/2.2 from remote not ok
ping to 1.1/1.2 from remote ok

ping to 3.2 from local is ok
ping to 1.1/1/2 from local not ok
ping to 2.1/2.2 from local ok

Remote

----------

crypto isakmp policy 10

 encr aes

 authentication pre-share

 group 2

crypto isakmp key cisco address 192.168.3.1

!

crypto ipsec security-association lifetime seconds 86400

!

crypto ipsec transform-set 10 esp-3des esp-sha-hmac 

!

crypto map to-cisco_local 10 ipsec-isakmp 

 set peer 192.168.3.1

 set transform-set 10 

 match address 100
 

interface GigabitEthernet0/0

 description inside_to_procurve

 ip address 192.168.2.1 255.255.255.0

 duplex auto

 speed auto

 crypto map to-cisco_local

!         

interface GigabitEthernet0/1

 description to-cisco_local

 ip address 192.168.3.2 255.255.255.252

 duplex auto

 speed auto

!         

ip route 192.168.1.0 255.255.255.0 GigabitEthernet0/1
 

access-list 100 permit ip 192.168.2.0 0.0.0.255 any

access-list 100 permit ip 192.168.3.0 0.0.0.255 any

Local:

--------

crypto isakmp policy 10

 encr aes

 authentication pre-share

 group 2  

crypto isakmp key cisco address 192.168.3.2

!         

crypto ipsec security-association lifetime seconds 86400

!         

crypto ipsec transform-set 10 esp-3des esp-sha-hmac 

!         

crypto map to-cisco_remote 10 ipsec-isakmp 

 set peer 192.168.3.2

 set transform-set 10 

 match address 100

!         

!         

!         

!         

interface GigabitEthernet0/0

 description Inside_Interface

 ip address 192.168.1.1 255.255.255.0

 duplex auto

 speed auto

 crypto map to-cisco_remote

!         

interface GigabitEthernet0/1

 description to-cisco_remote

 ip address 192.168.3.1 255.255.255.252

 duplex auto

 speed auto 
 

interface Vlan1

 no ip address

!         

ip route 192.168.2.0 255.255.255.252 GigabitEthernet0/1

!         

!         

ip http server

no ip http secure-server

!         

access-list 100 permit ip 192.168.1.0 0.0.0.255 any

access-list 100 permit ip 192.168.3.0 0.0.0.255 any

Open in new window

0
Comment
Question by:totaram
  • 5
  • 4
9 Comments
 
LVL 7

Expert Comment

by:mitrushi
ID: 24074534
Apply the crypto map to-cisco_remote to outside interface GigabitEthernet0/1 instead of the inside interface
0
 
LVL 7

Expert Comment

by:mitrushi
ID: 24074557
The same on the remote router apply the crypto route map to-cisco_local on the ouside interface i.e. the interface facing the other side router
0
 

Author Comment

by:totaram
ID: 24090154
After putting the crypto route map to-cisco_local on the ouside interface, I chnged the access-list as

Remote:
access-list 100 permit ip any 192.168.3.0 0.0.0.255
Local:
access-list 100 permit ip 192.168.3.0 0.0.0.255 any

The pings are possible now, but have couple of questions:
1. Don't understand why any & 3.0/24 would need to switched? Also, the interesting traffic is between the switches, should that network subnet (1.0 & 2.0) be part of the access-lists??
2. How to make sure that the ping traffic is flowing thro' the tunnel or if the tunnel is getting setup to begin with??
0
 
LVL 7

Expert Comment

by:mitrushi
ID: 24090455
192.168.3.0/24 subnet must not be part of acl 100. this acl is used to define which subnets are going to be encrypted and routed through the tunnel. In your example you want to encrypt and send through the tunnel traffic from  .1/24 to .2/24 and vice versa. you can use show crypto isakmp sa and show crypto ipsec sa to get info on the status of vpns. you can use debug crypto isakmp and debug crypto ipsec to see syslog messages generated during the vpn setup procedure.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:totaram
ID: 24091159
Hi Mitrushi;
I changed the ACL, so the new acl looks like
(Pl conform if it is OK?)

For Remote:  (included the other subnet )
 10 permit ip 192.168.1.0 0.0.0.255 any

For Local:  (included the other subnet )
 10 permit ip 192.168.2.0 0.0.0.255 any

Also, with the command that you provided:
2851_remote#show crypto isakmp sa                      
dst             src             state          conn-id slot status
192.168.3.2     192.168.3.1     QM_IDLE              1    0 ACTIVE

The output is same on both routers, so who decided dst & src???
0
 
LVL 7

Expert Comment

by:mitrushi
ID: 24091416
On site to site vpn both endpoints can initiate the vpn tunnel if interesting traffic has been generated. It would be better to restrict your acls to have as destination the remote subnet not any.
Follow this link to find a good series of article on site to site vpn. http://www.nil.com/ipcorner
0
 

Author Comment

by:totaram
ID: 24103662
I agree with what you are saying, but both routers have the same dst & src, who is controlling it?
They should have been switched based on the ACLs on the two...

2851_remote#show crypto isakmp sa                      
dst             src             state          conn-id slot status
192.168.3.2     192.168.3.1     QM_IDLE              1    0 ACTIVE
0
 
LVL 7

Accepted Solution

by:
mitrushi earned 500 total points
ID: 24104785
No one is controlling it. both routers have to build SA (security associations) for each phase. If the IKE phase 1 starts from r1 the isakmp sa will have as source r1 and as destination r2. if IKE phase 1 is triggered by traffic from r2 it will have r2 as source and r1 as destination.
0
 

Author Closing Comment

by:totaram
ID: 31566891
Thanks, it works.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Article by: btan
Provide an easy one stop to quickly get the relevant information on common asked question on Ransomware in Expert Exchange.
This paper addresses the security of Sennheiser DECT Contact Center and Office (CC&O) headsets. It describes the DECT security chain comprised of “Pairing”, “Per Call Authentication” and “Encryption”, which are all part of the standard DECT protocol.
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now