Hamachi and UDP Broadcast Games

I was recently trying to play some old game (Starcraft, Warcraft 3, and others) in LAN with some friends through the hamachi VPN system. All attempts were unsucessful due to the fact that the broadcasted UDP packet weren’t sent over the VPN interface but only in the local LAN.

To solve this we just had to manipulate the routing table of the systems.
After connecting to the hamachi VPN just do these commands as root user

OS X: as long hamachi uses 5.x.x.x for his nodes
route add -net 255.255.255.255 5.255.255.255

Linux: where ham0 is the hamachi interface
route add -net 255.255.255.255 netmask 255.255.255.255 dev ham0
No, this is not working, i tried to test it and to work around it but found no solution to host on a linux machine by now. If anybody knows how to do so, let me know

It seems to be working on gentoo (look at the comments)

This will redirect all the broadcast packets, maybe it can interfere with some other program, but as long as you want some time off to play it works great. To clear the modification to the routing table we didn’t do anything else then disconnecting from the hamachi VPN, the system handles the disappareance of the interface removing every involved route.

Resuming*

Game Linux MacOS
Warcraft 3 play host
Starcraft host host
Delta Force host untested

* Linux has no other setup then just starting hamachi. This all was tested between a Mac and a Linux systems

If someone can test other games and maybe help on the linux problem that would be great.

Hope this helps!
[last update 10 August 2009]

12 Responses to “Hamachi and UDP Broadcast Games”

  1. Clarke Says:

    Hi, sorry for posting a comment to this post, I have not found any contact form on your blog.

    I’ve been reading your blog for quite awhile, and maybe you can answer my question regarding rtorrent.

    Do you know how to make rtorrent shutdown a computer or at least shutdown itself once all torrents are downloaded?

    Thanks in advance

    Clarke.

    • Dario Meloni Says:

      I haven’t left the mail visible. Posting a comment is alright, but at least post a comment on a rtorrent related post…
      Anyway, there is no easy solution. rtorrent is not supposed to work this way, it is designed to work as a demon, you should use Transmission or similar for jobs like that.

      The solution would be to write a ruby script that checks that every download is in closed state (if you want to shutdown after seeding) or after the download is completed (if you only want to download).

  2. Clarke Says:

    Hi, thank you for reply

  3. Clarke Says:

    Goog blog and interesting scripts. I’ve added it to my blogroll on http://www.clarke.org.ru (Russian).

    CLarke

  4. gophK Says:

    Hello,

    I’ve tried ‘route add -net 255.255.255.255 5.255.255.255′ but it doesn’t seem to work. I can’t see anyone’s SC games. Other people see my games for a little while, but it doesn’t work (‘unable to join game’).

    I can ping other WinXP users, and they can ping me just fine too. Is there some other way to redirect the packets to Hamachi?

    • Dario Meloni Says:

      Unfortunately i’ve found myself that it doesn’t work, and really i can’t understand why, even tracking the packets flowing through the various interfaces…
      I can’t really say if it is a hamachi bug or not, i’m going to try with some other vpn software to test it (such as OpenVPN)

  5. Mack Says:

    Hi folk!

    This tip: where ham0 is the hamachi interface
    route add -net 255.255.255.255 netmask 255.255.255.255 dev ham0

    work for me on Linux Gentoo!

  6. Ryan Says:

    In case you want some tips for when you try it with openvpn:

    I’ve been using openvpn to host wc3 games. I’ve had some issues with that. First, I have it set up in bridged mode, and even with the client-to-client clients can only see games if I host them. If anyone on the VPN hosts, I can see them, but nobody else can (I’m on the same lan as my vpn server)

    I’ve tried tweaking some different settings.

    If I either push a “redirect-gateway” or have a client add “redirect-gateway” to their setting (causing all traffic to go through the vpn) then it behaves as if they are on the same lan as me (they can host / see other games etc) – I’m going to try later to push a route down to the clients that perhaps will fix it… if not, its at least workable to have one person host all the games and use redirect-gateway and have everyone join that persons games.

  7. rogerdpack Says:

    how did you run these windows games on linux? How can hamachi be made to work in doze? anybody? :)
    -r

Leave a Reply