Rerouting VPN Traffic from Cisco AnyConnect

misc

I am connecting to a Client's network via the Cisco AnyConnect VPN. I'm quite impressed with the security of the client, it allows the VPN administrator to have alot of control over how the client can connect.

One problem I was facing though is that I couldn't connect to the internet while I am connected to the client's VPN. The VPN changed my default gateway to route everything through the VPN. Now since I don't want my internet traffic going through the VPN I have to change my default gateway back to my own router (192.168.2.1 in my case), I do that with the command (I'm on a Mac):

sudo route change default 192.168.2.1

Now I need to add a special routing rule to allow me to connect to the servers I need to get to on the VPN server (you may or may not need to do this):

sudo route add 192.168.123.0 10.1.1.1

Where 10.1.1.1 would be the VPN gateway, and 192.168.123.0 is the network the servers I need to connect to are on.

After doing all this you would think everything would be setup for me to work, but I still couldn't connect to the internet! When I tried to ping google this is what I get:

ping: sendto: Permission denied
Request timeout for icmp_seq 0

It turns out after some digging I discovered that the Cisco AnyConnect VPN client was adding rules to my Mac's local firewall (ipfw). You can list the firewall rules using:

sudo ipfw -a list

One of the lines in there was:

01200  667 136583 deny ip from any to any

Which basically blocks all internet traffic except those that were specified explicitly specified by the VPN client. You can delete the rule using this command:

sudo ipfw delete 01200

Where 01200 is the first set of numbers on the line. You may want to add in some additional protection back as well, you can do that as you see fit. The key point of this blog entry though is to point out that the firewall was manipulated by the Cisco AnyConnect client, and in order to customize how it works you need to alter the firewall settings each time you connect.



2 people found this page useful, what do you think?

Trackbacks

Trackback Address: 753/E01FEE9867E6F0BB5B3DE36908585F56

Comments

On 07/13/2010 at 7:40:53 AM EDT deber wrote:
1
hm...I use ProteMac NetMine (protemac.com) as a firewall

On 08/02/2010 at 12:57:24 PM EDT rodoslavov wrote:
2
I would like to exchange links with your site www.petefreitag.com Is this possible?

On 08/09/2010 at 3:19:28 PM EDT Austinn wrote:
3
Creative work around, but all you needed to do was call the VPN administrator and tell him your VPN profile needs to be set up for Split Tunnel. This way, all traffic that does not match one or more specific ranges of IP addresses configured for the split tunnel will follow the same path it would normally take when you are not connected via VPN. Properly configured, split tunnel will give you full access to your normal internet connection while connected to VPN...

Post a Comment




  



Spell Checker by Foundeo

Recent Entries



foundeo


did you hack my cf?