About Corpse Graphic by Id Software News
Download Help

Enhanced Mac OS X Server Compatibility for multiple IP Networks on one Ethernet

The Mac OS X Server's IP broadcast mechanism is different from that used by Mac OS 8.x, in that it will broadcast only to servers on it's IP network. F.e. if your machine's address is 192.168.1.12 with a netmask of FF.FF.00.00 it will broadcast to 192.168.255.255. A machine with an IP address not starting with 192.168 although physically attached to the same LAN, will not process that packet. Mac OS 8.x on the otherhand uses the "limited broadcast" feature and broadcasts to 255.255.255.255, which is an IP way of saying "any host on my local ethernet string"

The result is that normally machines, that belong to a different IP net, can not be reached by Mac OS X Server broadcasts. Now this is important, because Quake III Arena and the Server Snooper use broadcasts to detect server presence.

Quake III Arena Server Snooper and your machine can be configured to duplicate Mac OS 9.x style broadcasts, if you follow these steps:

  1. Allow Q3AServerSnooper to be run with root priviledges. This allows the program to open a "raw socket" to fabricate its own IP packets.

    In Terminal.app enter

    bash$ cd /Local/Applications/Games/Q3TestSnoop.app  # or wherever you installed it
    bash$ su
    
    bash# chmod 4775 Q3AServerSnooper
    bash# /usr/sbin/chown root Q3AServerSnooper
    
  2. Check that you have broadcasthost defined in your local netinfo. It would be highly unusual, if you don't, but anyway better safe than sorry:
    bash# nidump hosts .
    127.0.0.1       localhost
    255.255.255.255 broadcasthost
    bash#
    
    If you do not have broadcasthost already defined, define it with Network Manager or ask your administrator for help.

  3. Determine an IP Address on your IP network that is available. We are using an unused address donotuse here. Add this to your local netinfo.
  4. Now we need to create an arp entry for the host donotuse, that maps to the ethernet broadcast address FF:FF:FF:FF:FF:FF.
    bash# /usr/sbin/arp -d donotuse  # just for safety
    bash# /usr/sbin/arp -s donotuse FF:FF:FF:FF:FF:FF
    

  5. Finally we route all traffic for the broadcast address to that fake host:
    bash# /sbin/route -add broadcasthost donotuse
    
    To see that everything worked out OK, start Q3AServerSnooper anew and check the output with
    bash# /usr/sbin/tcpdump -e port 27960
    
    After a few seconds you should see a packet being dumped. Check that the destination Ethernet adress is "Broadcast" and the destination IP address is 255.255.255.255. Like in this sample output:
    01:59:03.561057 0:3:2:f7:3d:9a Broadcast ip 57: walitza.27961 > 255.255.255.255.27960: udp 23
    
    In the following line something went wrong, as the destination address still contains the network part.
    01:59:03.561057 0:3:2:f7:3d:9a Broadcast ip 57: walitza.27961 > 194.25.136.255.27960: udp 15
    
    Because of the new dual socket code, check at least two packets. One of the two packets should be doing an ethernet broadcast to 255.255.255.255

    If you are using Quake III Snooper regularly, it might become painful to always execute the route and the arp commands after each reboot. A script takes care of that. It should be edited according to your configuration, made executable and placed in /etc/startup. Since version 0.1 this script can also be found in the Resources folder of the Application.

    #! /bin/sh
    
    #
    # Map unused IP addresss to Ethernet broadcast address
    #
    
    . /etc/rc.common
    
    
    ConsoleMessage "Ethernet broadcast for Q3ArenaServerSnooper"
    
    /usr/sbin/arp -s donotuse ff:ff:ff:ff:ff:ff
    /sbin/route add broadcasthost donotuse