Linux StarCraft HOWTO
After searching the web, I've discovered the lack of a page describing a clear cut way to make StarCraft work correctly from a box protected by a Linux ipchains firewall. There is one for running StarCraft ON a Linux box using WINE, but that's not what we're after.
If you've tried to do this before, then you've probably seen one or more of these symptoms:
Ah, well there's hope. The main reason StarCraft doesn't like your Linux firewall is because of the way it connects to others. Sure, you have Battle.net and a score of other alternative servers to connect to. You'd think a *server* would host games but in StarCraft's case its essentially a irc chat server that tells others your IP address. Each game is both a server and a client; that's why (hacking the game is so easy) . So, you've got to make UDP port 6112 accessible to all and map it directly to your StarCraft box. The TCP port should open by itself since it's only for connecting to the server and you're initiating the connection but we'll map it anyway.
Things you will need:
I'm assuming you have your firewall setup already but just in case here is a VERY SIMPLE 2-line version:
Change eth0 to whatever interface is connected to the net. This may be your modem (probably ppp0).
<RANT> Note that this really doesn't provide you with any of the useful features that a real firewall setup would; you should stop now and finish your firewalling policy if you're going to be on the Internet. Security is YOUR responsibility! For a fairly easy-to-use setup tool for general security (with great comments to help educate you on what's going on), we recommend PMFirewall.</RANT>.Ok, if you haven't already, install ipmasqadm. Add these next lines, either to the end of /etc/rc.d/rc.local to set it up automatically on bootup, or make your own script and run it whenever you want to play (if you make your own file, be sure to add #!/bin/sh to the top and chmod 0775 after you save it). Remember that you have to have root access on the Linux firewall box in order to make these changes. If you don't know what that is, or how to get it, then please ask somebody. We take no responsibility for what your fingers type when you're root, nor do we claim that doing any of the preceiding or following is not horribly fraught with the most dreadful risk imaginable.
#Turn on port forwarding echo 1 > /proc/sys/net/ipv4/ip_forward #Turn on LooseUDP echo 1 > /proc/sys/net/ip_masq_udp_dloose #Set the MASQ timeouts - gotta adjust for the laggers /sbin/ipchains -M -S 7200 10 900 #Open up the ports needed for StarCraft /usr/sbin/ipmasqadm portfw -a -P tcp -L enter.your.internet.ip.here 6112 \ -R enter.your.starcraft.machine.ip.here 6112 /usr/sbin/ipmasqadm portfw -a -P udp -L enter.your.internet.ip.here 6112 \ -R enter.your.starcraft.machine.ip.here 6112
That's it. If you've been messing around with port configurations before trying this, you may want to reboot(gasp!) before trying it out in StarCraft.
-NfoCipher
Lead programmer of TuxWorks.com and avid computer gamer.
StarCraft ™ is a fun game and is owned and trademarked and all that by Blizzard Entertainment (insert standard legal plug here).