I've recently set up a LogMeIn Hamachi VPN in Gateway mode. My goal is to forward all internet traffic from my local machine through the VPN. I've been searching for a while now and have only found this resource: http://community.logmein.com/t5/Hamachi/How-to-route-all-internet-traffic-through-Hamachi/td-p/22808/page/
The Hamachi VPN is configured at my workplace across the country on a machine with IP address:
10.1.10.5. It is connected to a Linksys router:
10.1.10.85, which is connected to a Comcast Business Class modem:
Locally, my machine (
184.108.40.206) is behind a Cisco AE4500 router (
192.168.1.1). My routes are as follows:
IPv4 Route Table =========================================================================== Active Routes: Network Destination Netmask Gateway Interface Metric 0.0.0.0 0.0.0.0 192.168.1.1 192.168.1.111 20 0.0.0.0 0.0.0.0 10.1.10.85 1e 21 220.127.116.11 240.0.0.0 On-link 1e 276 255.255.255.255 255.255.255.255 On-link 1e 276 =========================================================================== Persistent Routes: Network Address Netmask Gateway Address Metric 0.0.0.0 0.0.0.0 10.1.10.85 1 =========================================================================== IPv6 Route Table =========================================================================== Active Routes: None Persistent Routes: None
Now, per the link I referenced above, that persistent route SHOULD route all my traffic through the 10.1.10.85 router and give my PC the WAN address of my office network. However, it appears as if the route is being completely ignored. I added it with the following command:
route -p add 0.0.0.0 mask 0.0.0.0 10.1.10.85 metric 1 if 30
Where interface 30 is the Gateway mode Hamachi VPN interface (I have also tried this without specifying an interface, to no avail).
My understanding is that the metric 1 should be making that route the least "costly" to take and Windows should choose it over the other local interfaces. I've also, for giggles and grins, attempted to completely delete my local route (
route delete 0.0.0.0 mask 0.0.0.0 192.168.1.1). When I do that, I lose internet connection completely until I re-add that route (
route add 0.0.0.0 mask 0.0.0.0 192.168.1.1 metric 20 if 19 where interface 19 is my Local Area Network ethernet interface).
Is there anything wrong that's glaringly obvious? How can I troubleshoot the issue?
tracert google.com returns a bunch of
Request timed out hops (and by "a bunch" I mean every hop except the last one is
Request timed out). I've tried all sorts of combinations of adding the route while the VPN is connected, while it's not connected, deleting all the routes and starting over, using
10.1.10.1 as the gateway, using
10.1.10.85, etc. Nothing seems to accomplish what I'm trying to do. I've also spent a few hours researching how routes work and perusing SuperUser for similar problems; none seem to be attempting what I am and the ones that are similar haven't fixed my issue.
Any assistance is greatly appreciated.
I randomly just accidentally disconnected Hamachi and reconnected it. While it was reconnecting (in its "configuring" state) I ran
tracert google.com. It went through the
10.1.10.85 router. When I checked IP chicken, my WAN IP was my workplace's WAN IP. After Hamachi finished "configuring" whatever it was configuring, I tried again.
tracert google.com went through my local router and my WAN IP was back to my ISP-appointed IP...So it appears as if initially my routes are working fine, then Hamachi overwrites them or disables them or something.
route print still shows the routes as if nothing changed.
I've figured out the problem, but cannot answer my own question yet as I'm a new SU user. Here's what I figured out:
When Hamachi is in Gateway mode, the server you configure as the "Gateway" is, actually, the gateway. So when you add a route to forward all your internet traffic through the Hamachi VPN, don't use the remote router's IP address; use the server address itself. In my example it's
route -p add 0.0.0.0 mask 0.0.0.0 10.1.10.5 metric 1 worked beautifully. I have no idea why I didn't think of using the server's IP address before, but such is life. Anyway, for clarity, this is the IP you should use if you were to set this up with different IPs than in my example:
Err, I can't post pictures yet either, so here's a link, instead: http://screencast.com/t/iHwemBJCxxcp