Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to forward only necessary traffic through a VPN

Status
Not open for further replies.

soklear

IS-IT--Management
Jan 13, 2004
38
US
I have been banging my head against the wall now for about a day.... It's been a VERY long time since I have worked with the PIX and even longer since I have configured a VPN. I was wondering if someone could help me with a question.

I have a client who needs to route ONLY specific traffic through a VPN and all other traffic out through what I would like to see as a default route (which is the first route statement).

Can anyone help? Please?

interface ethernet0 auto
interface ethernet1 100full
nameif ethernet0 outside security0
nameif ethernet1 inside security100
enable password i2mmSEIvL2qNRdul encrypted
passwd i2mmSEIvL2qNRdul encrypted
hostname shhpix
domain-name ciscopix.com
fixup protocol dns maximum-length 512
fixup protocol ftp 21
fixup protocol h323 h225 1720
fixup protocol h323 ras 1718-1719
fixup protocol http 80
fixup protocol rsh 514
fixup protocol rtsp 554
fixup protocol sip 5060
fixup protocol sip udp 5060
fixup protocol skinny 2000
fixup protocol smtp 25
fixup protocol sqlnet 1521
fixup protocol tftp 69
names
access-list outside_cryptomap_20 permit ip any any
access-list inside_access_in permit tcp any any
access-list inside_access_in permit udp any any
access-list inside_access_in permit ip any any
access-list inside_nat0_outbound permit ip any any
access-list inside_nat0_outbound permit ip host 192.168.1.128 host 12.0.0.0
access-list outside_cryptomap_21 permit ip any any
pager lines 24
logging console alerts
mtu outside 1500
mtu inside 1500
ip address outside 67.48.17.71 255.255.255.248
ip address inside 192.168.1.1 255.255.255.0
ip audit info action alarm
ip audit attack action alarm
pdm location 0.0.0.0 255.255.255.248 outside
pdm location 209.182.225.1 255.255.255.255 outside
pdm location 192.168.0.0 255.255.255.255 outside
pdm location 12.0.0.0 255.255.255.255 outside
pdm location 192.168.1.128 255.255.255.255 inside
pdm location 192.168.1.128 255.255.255.255 outside
pdm logging informational 100
pdm history enable
arp timeout 14400
global (outside) 1 interface
nat (inside) 0 access-list inside_nat0_outbound
nat (inside) 1 0.0.0.0 0.0.0.0 0 0
access-group inside_access_in in interface inside
route outside 0.0.0.0 0.0.0.0 67.40.71.22 1
route outside 12.0.0.0 255.255.255.255 209.182.225.1 1
route outside 192.168.0.0 255.255.255.255 209.182.225.1 1
route outside 192.168.1.128 255.255.255.255 67.40.71.22 1
timeout xlate 0:05:00
timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 rpc 0:10:00 h225 1:00:00
timeout h323 0:05:00 mgcp 0:05:00 sip 0:30:00 sip_media 0:02:00
timeout sip-disconnect 0:02:00 sip-invite 0:03:00
timeout uauth 0:05:00 absolute
aaa-server TACACS+ protocol tacacs+
aaa-server TACACS+ max-failed-attempts 3
aaa-server TACACS+ deadtime 10
aaa-server RADIUS protocol radius
aaa-server RADIUS max-failed-attempts 3
aaa-server RADIUS deadtime 10
aaa-server LOCAL protocol local
http server enable
http 192.168.1.0 255.255.255.0 inside
no snmp-server location
no snmp-server contact
snmp-server community public
no snmp-server enable traps
floodguard enable
sysopt connection permit-ipsec
crypto ipsec transform-set ESP-3DES-MD5 esp-3des esp-md5-hmac
crypto map outside_map 20 ipsec-isakmp
crypto map outside_map 20 match address outside_cryptomap_20
crypto map outside_map 20 set pfs
crypto map outside_map 20 set peer 209.182.225.1
crypto map outside_map 20 set transform-set ESP-3DES-MD5
crypto map outside_map 20 set security-association lifetime seconds 86400 kilobytes 460800
crypto map outside_map 21 ipsec-isakmp
crypto map outside_map 21 match address outside_cryptomap_21
crypto map outside_map 21 set peer 12.65.89.8
crypto map outside_map 21 set transform-set ESP-3DES-MD5
crypto map outside_map interface outside
isakmp enable outside
isakmp key ******** address 209.182.225.1 netmask 255.255.255.255 no-xauth no-config-mode
isakmp policy 20 authentication pre-share
isakmp policy 20 encryption 3des
isakmp policy 20 hash md5
isakmp policy 20 group 1
isakmp policy 20 lifetime 86400
telnet 0.0.0.0 0.0.0.0 inside
telnet timeout 5
ssh timeout 5
console timeout 0
vpdn username shhservices password ********* store-local
dhcpd address 192.168.1.2-192.168.1.254 inside
dhcpd lease 3600
dhcpd ping_timeout 750
dhcpd auto_config outside
terminal width 80
Cryptochecksum:61e424482336a63b3919aea782a5251d
: end
[OK]
Thanks.
Bob
 
These two access-lists need to be more specific:
Code:
access-list outside_cryptomap_20 permit ip any any
access-list outside_cryptomap_21 permit ip any any
They should look something like this:
Code:
access-list outside_cryptomap_2 permit ip 192.168.1.0 255.255.255.0 <remote_network> <subnet>
access-list outside_cryptomap_21 permit ip 192.168.1.0 255.255.255.0 <remote_network2> <subnet>

I hate all Uppercase... I don't want my groups to seem angry at me all the time! =)
- ColdFlame (vbscript forum)
 
So, if I change what you suggest - which by the way makes complete sense - do I need to change the route outside statement or will the access list(s) take care of that because it the traffic specified will go directly through the VPN tunnel?
 
yeah, typically you will only have a default route like so:
Code:
route outside 0.0.0.0 0.0.0.0 67.40.71.22 1
although the next hop address does not look to be correct based on your outside interface address. Is everything else working for you??

I hate all Uppercase... I don't want my groups to seem angry at me all the time! =)
- ColdFlame (vbscript forum)
 
Thanks for your response.

I scrubbed the IP's so as to not expose the actual networks, but - everything is working OK otherwise.

However, the change to the access list didnt work? I assumed it would considering what I have read and what you posted.

When I change the access list to show:
access-list outside_cryptomap_20 permit ip 192.168.1.0 255.255.255.0 192.168.27.0 255.255.255.0
No traffic is routed to the remote network at all, BUT the tunnel stays up. I cant ping the remote end of the tunnel after I change the acl nor can I access the remote network.

Any other suggestions?

Below is the new code:
(I eliminated the unnecessary routes and one of the ACL's).

interface ethernet0 auto
interface ethernet1 100full
nameif ethernet0 outside security0
nameif ethernet1 inside security100
enable password i2mmSEIvL2qNRdul encrypted
passwd i2mmSEIvL2qNRdul encrypted
hostname shhpix
domain-name ciscopix.com
fixup protocol dns maximum-length 512
fixup protocol ftp 21
fixup protocol h323 h225 1720
fixup protocol h323 ras 1718-1719
fixup protocol http 80
fixup protocol rsh 514
fixup protocol rtsp 554
fixup protocol sip 5060
fixup protocol sip udp 5060
fixup protocol skinny 2000
fixup protocol smtp 25
fixup protocol sqlnet 1521
fixup protocol tftp 69
names
access-list outside_cryptomap_20 permit ip any any
access-list inside_access_in permit tcp any any
access-list inside_access_in permit udp any any
access-list inside_access_in permit ip any any
access-list inside_nat0_outbound permit ip any any
access-list outside_cryptomap_21 permit ip any any
pager lines 24
logging console alerts
mtu outside 1500
mtu inside 1500
ip address outside 67.48.17.71 255.255.255.248
ip address inside 192.168.1.1 255.255.255.0
ip audit info action alarm
ip audit attack action alarm
pdm location 0.0.0.0 255.255.255.248 outside
pdm location 209.182.225.1 255.255.255.255 outside
pdm location 192.168.0.0 255.255.255.255 outside
pdm location 12.0.0.0 255.255.255.255 outside
pdm location 192.168.1.128 255.255.255.255 inside
pdm location 192.168.1.128 255.255.255.255 outside
pdm logging informational 100
pdm history enable
arp timeout 14400
global (outside) 1 interface
nat (inside) 0 access-list inside_nat0_outbound
nat (inside) 1 0.0.0.0 0.0.0.0 0 0
access-group inside_access_in in interface inside
route outside 0.0.0.0 0.0.0.0 67.40.71.22 1
timeout xlate 0:05:00
timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 rpc 0:10:00 h225 1:00:00
timeout h323 0:05:00 mgcp 0:05:00 sip 0:30:00 sip_media 0:02:00
timeout sip-disconnect 0:02:00 sip-invite 0:03:00
timeout uauth 0:05:00 absolute
aaa-server TACACS+ protocol tacacs+
aaa-server TACACS+ max-failed-attempts 3
aaa-server TACACS+ deadtime 10
aaa-server RADIUS protocol radius
aaa-server RADIUS max-failed-attempts 3
aaa-server RADIUS deadtime 10
aaa-server LOCAL protocol local
http server enable
http 192.168.1.0 255.255.255.0 inside
no snmp-server location
no snmp-server contact
snmp-server community public
no snmp-server enable traps
floodguard enable
sysopt connection permit-ipsec
crypto ipsec transform-set ESP-3DES-MD5 esp-3des esp-md5-hmac
crypto map outside_map 20 ipsec-isakmp
crypto map outside_map 20 match address outside_cryptomap_20
crypto map outside_map 20 set pfs
crypto map outside_map 20 set peer 209.182.225.1
crypto map outside_map 20 set transform-set ESP-3DES-MD5
crypto map outside_map 20 set security-association lifetime seconds 86400 kilobytes 460800
crypto map outside_map 21 ipsec-isakmp
crypto map outside_map 21 match address outside_cryptomap_21
crypto map outside_map 21 set peer 12.65.89.8
crypto map outside_map 21 set transform-set ESP-3DES-MD5
crypto map outside_map interface outside
isakmp enable outside
isakmp key ******** address 209.182.225.1 netmask 255.255.255.255 no-xauth no-config-mode
isakmp policy 20 authentication pre-share
isakmp policy 20 encryption 3des
isakmp policy 20 hash md5
isakmp policy 20 group 1
isakmp policy 20 lifetime 86400
telnet 0.0.0.0 0.0.0.0 inside
telnet timeout 5
ssh timeout 5
console timeout 0
vpdn username shhservices password ********* store-local
dhcpd address 192.168.1.2-192.168.1.254 inside
dhcpd lease 3600
dhcpd ping_timeout 750
dhcpd auto_config outside
terminal width 80
Cryptochecksum:61e424482336a63b3919aea782a5251d

 
This ACL needs to be more specific:
Code:
access-list inside_nat0_outbound permit ip any any
it should be something like this:
Code:
access-list inside_nat0_outbound permit ip 192.168.1.0 255.255.255.0 192.168.20.0 255.255.255.0
Your crypto map ACL's need to be the exact same on both sides with the source on one side will be the destination on the other and vice versa
Code:
PIX1:
access-list crypto_map_20 permit ip 192.168.1.0 255.255.255.0 192.168.27.0 255.255.255.0

PIX2:
access-list crypto_map_20 permit ip 192.168.27.0 255.255.255.0 192.168.1.0
What device are you attempting to ping from, a host on the .1 network or the ASA itself??

I hate all Uppercase... I don't want my groups to seem angry at me all the time! =)
- ColdFlame (vbscript forum)
 
I am trying to ping from both the ASA and a host from the .1 network.

As far as the access list above goes, that makes sense if I wanted to route traffic to a specific network out the NAT access list - but, I want to route all traffic not going to the .27 network through the NAT ACL.

I hope that makes sense????
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top