{"id":202,"date":"2016-01-28T22:07:29","date_gmt":"2016-01-28T22:07:29","guid":{"rendered":"http:\/\/pjakey.com\/wp\/?p=202"},"modified":"2018-05-08T16:53:03","modified_gmt":"2018-05-08T16:53:03","slug":"cisco-anyconnect-and-host-only-connectivity-in-virtualbox","status":"publish","type":"post","link":"https:\/\/pjakey.com\/wp\/2016\/01\/28\/cisco-anyconnect-and-host-only-connectivity-in-virtualbox\/","title":{"rendered":"Cisco AnyConnect and Host-Only Connectivity in VirtualBox"},"content":{"rendered":"<p>Sometimes I desire to have a VM on my local machine, which is running Max OS X 10.10. \u00a0I prefer to be able to use SCP to transfer files from my host to my guest, usually some flavor of Linux.<\/p>\n<p>It seems pretty straight-forward to set up a host only connection. \u00a0There are articles all over describing exactly how it can be done. \u00a0<a href=\"http:\/\/christophermaier.name\/blog\/2010\/09\/01\/host-only-networking-with-virtualbox\" target=\"_blank\" rel=\"noopener\">Here&#8217;s <\/a>one and <a href=\"https:\/\/www.ulyaoth.net\/resources\/tutorial-ssh-into-a-virtualbox-linux-guest-from-your-host.35\/\" target=\"_blank\" rel=\"noopener\">here&#8217;s a<\/a>nother.<\/p>\n<p>Under normal conditions, this works flawlessly. \u00a0However, at work, we use <strong>Cisco AnyConnect<\/strong> (here is some <a href=\"http:\/\/www.cisco.com\/c\/dam\/en\/us\/products\/collateral\/security\/anyconnect-secure-mobility-client\/at_a_glance_c45-578609.pdf\" target=\"_blank\" rel=\"noopener\">marketing <\/a>material if you&#8217;re interested), which hijacks my routing table and sends everything to the watchful eye of our network admins&#8230;or at least through their gateways and hops how they see fit. \u00a0This means that even a local &#8220;host-only&#8221; route is over-written by whatever they have dictated. \u00a0Here is my &#8220;host-only&#8221; route being sent out my VPN tunnel:<\/p>\n<pre>192.168.56 \u00a0 \u00a0 \u00a0 \u00a0 link#10 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0UCS \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 0 \u00a0 \u00a0 \u00a0 \u00a00 \u00a0 utun0<\/pre>\n<p>This means that if you want to have a local VM with which to play and experiment, connecting to it isn&#8217;t all that straight-forward. \u00a0First, you have to disconnect from your VPN (AnyConnect &gt; Disconnect). \u00a0You&#8217;ll see that your VirtualBox local host-only route is gone completely:<\/p>\n<pre>$ netstat -nr\r\nRouting tables\r\n\r\nInternet:\r\nDestination  Gateway           Flags   Refs     Use   Netif Expire\r\ndefault      10.65.10.1        UGSc      53     315   en3\r\n10.65.10\/23  link#5            UCS        3       0   en3\r\n10.65.10.1   4c:4e:35:77:77:41 UHLWIir   54       0   en3      600\r\n10.65.10.97  127.0.0.1         UHS        0       0   lo0\r\n10.65.10.99  68:5b:35:77:77:85 UHLWI      0       0   en3      644\r\n10.65.11.255 ff:ff:ff:ff:ff:ff UHLWbI     0       3   en3\r\n127          127.0.0.1         UCS        0       0   lo0\r\n127.0.0.1    127.0.0.1         UH        71  839273   lo0\r\n169.254      link#5            UCS        0       0   en3<\/pre>\n<p>The VirtualBox host-only interface may have an IP address, both on the host and the guest, but its route is not re-added to my routing table when I disconnect from the VPN. \u00a0I have to go into VirtualBox &gt; Preferences &gt; \u00a0Network &gt; Host-only Network, remove the host-only interface (vboxnet0) and re-add it. \u00a0Once I do this, its route is added to my routing table and I can connect to my VM guest!<\/p>\n<pre>$ netstat -nr\r\nRouting tables\r\n\r\nInternet:\r\nDestination    Gateway           Flags Refs    Use   Netif Expire\r\ndefault        10.65.10.1        UGSc    65    315     en3\r\n10.65.10\/23    link#5            UCS      3      0     en3\r\n10.65.10.1     4c:4e:35:77:77:41 UHLWIir 66      0     en3    527\r\n10.65.10.97    127.0.0.1         UHS      0      0     lo0\r\n10.65.10.99    68:5b:35:77:77:85 UHLWI    0      0     en3    571\r\n10.65.11.255   ff:ff:ff:ff:ff:ff UHLWbI   0      6     en3\r\n127            127.0.0.1         UCS      0      0     lo0\r\n127.0.0.1      127.0.0.1         UH      73 840630     lo0\r\n169.254        link#5            UCS      0      0     en3\r\n192.168.56     link#11           UC       2      0 vboxnet\r\n192.168.56.255 ff:ff:ff:ff:ff:ff UHLWbI   0      1 vboxnet<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes I desire to have a VM on my local machine, which is running Max OS X 10.10. \u00a0I prefer to be able to use SCP to transfer files from my host to my guest, usually some flavor of Linux. It seems pretty straight-forward to set up a host only connection. \u00a0There are articles all<span class=\"excerpt-ellipsis\">&#8230;<\/span><\/p>\n<p><a class=\"more-link\" href=\"https:\/\/pjakey.com\/wp\/2016\/01\/28\/cisco-anyconnect-and-host-only-connectivity-in-virtualbox\/\" itemprop=\"url\">Continue Reading<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-202","post","type-post","status-publish","format-standard","hentry","category-sysadmin"],"_links":{"self":[{"href":"https:\/\/pjakey.com\/wp\/wp-json\/wp\/v2\/posts\/202","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pjakey.com\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pjakey.com\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pjakey.com\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pjakey.com\/wp\/wp-json\/wp\/v2\/comments?post=202"}],"version-history":[{"count":1,"href":"https:\/\/pjakey.com\/wp\/wp-json\/wp\/v2\/posts\/202\/revisions"}],"predecessor-version":[{"id":285,"href":"https:\/\/pjakey.com\/wp\/wp-json\/wp\/v2\/posts\/202\/revisions\/285"}],"wp:attachment":[{"href":"https:\/\/pjakey.com\/wp\/wp-json\/wp\/v2\/media?parent=202"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pjakey.com\/wp\/wp-json\/wp\/v2\/categories?post=202"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pjakey.com\/wp\/wp-json\/wp\/v2\/tags?post=202"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}