{"id":50,"date":"2014-08-18T20:28:22","date_gmt":"2014-08-18T18:28:22","guid":{"rendered":"http:\/\/iosnow.net\/?p=50"},"modified":"2014-08-18T20:29:29","modified_gmt":"2014-08-18T18:29:29","slug":"cisco-ipsec-vpn-and-native-mac-support","status":"publish","type":"post","link":"http:\/\/iosnow.net\/?p=50","title":{"rendered":"Cisco IPSec VPN and native Mac support"},"content":{"rendered":"<p>This post is intented to be a merge of two of the technologies of my life. In one hand Cisco networking with the old IPSec VPN, and on the other hand OSX, which has been a good friend in my iOS development career.<\/p>\n<p>I was using Cisco anyconnect in the past (let&#8217;s say &#8220;the new&#8221; or &#8220;the good&#8221; solution), but dealing with updates on the client of the router on each OSX new version is something that can keep more than one out of the anyconnect option.<\/p>\n<p>Here we will address two configuration, firstly we will explain the data needed to configure a Cisco IPSec VPN, and then we will go further explaining the steps needed to configure one, in the first step, we will address Cisco router configuration, and then we will be able to configure it on the MAC.<\/p>\n<p>The IPSec has two steps to start, in first step manages the ISAKMP tunnel, and on the second step is created the IPSec tunnel for the data. The data to know before start is:<\/p>\n<ul>\n<li>GROUP name<\/li>\n<li>GROUP password<\/li>\n<li>Username<\/li>\n<li>Password<\/li>\n<li>Local network<\/li>\n<li>Remote VPN network<\/li>\n<\/ul>\n<p>All the rest of the configuration can be fine-tuned, but isn&#8217;t important to the client (will work if not modified, but Apple does not support all the options on hashing does not support header compression).<\/p>\n<h2>Network traffic and NAT configuration<\/h2>\n<p>First we will specify clearly which IP addresses will be used localy, which address will be used remotely, and the traffic we will encrypt, for the example, the network will be:<\/p>\n<ul>\n<li>Local network (*): 192.168.1.0\/24<\/li>\n<li>Remote VPN network (*): 192.168.2.0\/24<\/li>\n<li>VPN Pool name: VPN-POOL<\/li>\n<li>VPN Pool address: 192.168.2.1-192.168.2.100<\/li>\n<\/ul>\n<p>(*) Please note it would be a good idea to use another IP addresses, as many local networks are default configured with these adresses, and can make the VPN unusable, any 192.168.x.0\/24 keeping x greater than 2 could be a good option.<\/p>\n<p>We will configure the VPN Pool with the VPN remote addresses, the access-list to define traffic to encrypt and will modify the current NAT access-list to avoid NATing of the VPN traffic (**), we will assume the VPN access-list is 101 and the NATed access-list is 100:<br \/>\n<code><br \/>\nip local pool VPN-POOL 192.168.2.1 192.168.2.100<br \/>\naccess-list 100 remark NAT<br \/>\naccess-list 100 deny ip 192.168.10 0.0.0.255 192.168.2.0 0.0.0.255<br \/>\naccess-list 100 permit ip 192.168.1.0 0.0.0.255 any<br \/>\naccess-list 101 remark VPN Traffic<br \/>\naccess-list 101 permit ip 192.168.2.0 0.0.0.255 192.168.1.0 0.0.0.255<br \/>\n<\/code><br \/>\n(**) NAT configuration excluded from the example, any using access-list would work<\/p>\n<h2>ISAKMP negotiation<\/h2>\n<p>The first part of the ISAKMP configuration has nothing to do with the parameters to configure on the OSX, so just copying and pasting this will work, we are free to define more negotiation types here (just with other preference than 20). In the next part we are using MY_IPSEC_VPN_GROUP for the group, and MySharedKeyForTheIPSecVPNGroup as the password, please change with the data collected at the begining of the configuration, here you must change <Put here a local authentication method> and <Put here a local authorization method> with the prefered aaa authentication and authorization methods (normally in small routers local, but could be any)<br \/>\n<code><br \/>\ncrypto isakmp policy 20<br \/>\n encr 3des<br \/>\n authentication pre-share<br \/>\n group 2<br \/>\ncrypto isakmp keepalive 20<br \/>\ncrypto isakmp xauth timeout 60<br \/>\n!<br \/>\ncrypto isakmp client configuration group MY_IPSEC_VPN_GROUP<br \/>\n key MySharedKeyForTheIPSecVPNGroup<br \/>\n pool VPN-POOL<br \/>\n acl 101<br \/>\ncrypto isakmp profile VPNClient<br \/>\n description VPN Clients profile<br \/>\n match identity group MY_IPSEC_VPN_GROUP<br \/>\n client authentication list &lt;Put here a local authentication method&gt;<br \/>\n client authorization list &lt;Put here a local authorization method&gt;<br \/>\n client configuration address respond<br \/>\n<\/code><\/p>\n<p>If local authentication and authorization is used, it would be needed to configure a local user, to prevent local access to the router configuration, it would be needed to not specifing the privilege for the user:<br \/>\n<code>username &lt;VPN user&gt; password &lt;password&gt;<\/code><\/p>\n<h2>Basic IPSec negotiation<\/h2>\n<p>The next step is to provide the basis of the IPSec tunnel, here we will assume 3DES for encryption and SHA for hashing, we have to remember here that the OSX does not provide header compression, so we should never enable it.<br \/>\n<code><br \/>\ncrypto ipsec security-association lifetime kilobytes 536870912<br \/>\ncrypto ipsec security-association lifetime seconds 86400<br \/>\ncrypto ipsec transform-set 3DES-SHA esp-3des esp-sha-hmac<br \/>\n<\/code><\/p>\n<h2>Crypto map configuration<\/h2>\n<p>Here we will need to know the outer interface, for the example it would be Dialer1, but will need to be changed to whatever your outer interface will be. Here we can define more IPSec options, just taking note to have other preference than 31.<br \/>\n<code><br \/>\ncrypto dynamic-map DYNMAP 10<br \/>\n description VPN Clients<br \/>\n set transform-set 3DES-SHA<br \/>\n set isakmp-profile VPNClient<br \/>\ncrypto map CLIENTMAP local-address Dialer1<br \/>\ncrypto map CLIENTMAP 31 ipsec-isakmp dynamic DYNMAP discover<br \/>\n<\/code><\/p>\n<h2>Assigning the crypto map configuration<\/h2>\n<p>The last step is configuring the crypto map in the outer interface, as in this example the outer interface is Dialer1, the crypto map will be aplied to that interface, please note the name of the crypto map is matched with the crypto map from the last step:<br \/>\n<code><br \/>\ninterface Dialer1<br \/>\n crypto map CLIENTMAP<br \/>\n<\/code><\/p>\n<p>Now we have the router configured, now we will have to configure the OSX.<\/p>\n<ol>\n<li>In setting, network, we wil click the + sign at the bottom left of the list of interfaces to add a new interface, we will choose VPN as interface type, and Cisco IPSec as VPN type. We can provide here any familiar name for the VPN.<\/li>\n<li>In the server address we will provide the outer address of our router, if dynamic, here we will put the name we use with our prevered dynamic DNS provider, a static address is always painless, but dynamic DNS works fine with Cisco routers<\/li>\n<li>On the name of the account we will put the username configured on the router<\/li>\n<li>Clicking on authentication configuration, we will provide the secret for the group, and the group name<\/li>\n<\/ol>\n<p>We are able to click on the Connect button to test our VPN connection.<\/p>\n<p>Hope this could be helpfull for anybody trying to configure an IPSec VPN in the Cisco routers to a MAC OSX client, I would like to know the problems people has configuring this kind of VPN, and if anybody has other preferences for the kind of client.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post is intented to be a merge of two of the technologies of my life. In one hand Cisco networking with the old IPSec VPN, and on the other hand OSX, which has been a good friend in my iOS development career. I was using Cisco anyconnect in the past (let&#8217;s say &#8220;the new&#8221; <a class=\"read-more\" href=\"http:\/\/iosnow.net\/?p=50\">[&hellip;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,18,5,19],"tags":[],"_links":{"self":[{"href":"http:\/\/iosnow.net\/index.php?rest_route=\/wp\/v2\/posts\/50"}],"collection":[{"href":"http:\/\/iosnow.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/iosnow.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/iosnow.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/iosnow.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=50"}],"version-history":[{"count":6,"href":"http:\/\/iosnow.net\/index.php?rest_route=\/wp\/v2\/posts\/50\/revisions"}],"predecessor-version":[{"id":56,"href":"http:\/\/iosnow.net\/index.php?rest_route=\/wp\/v2\/posts\/50\/revisions\/56"}],"wp:attachment":[{"href":"http:\/\/iosnow.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=50"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/iosnow.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=50"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/iosnow.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=50"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}