I am setting up a bunch of Game servers for a medium sized LAN tournament using CentOS 6 and the various Linux binaries used for the game servers. With COD4 the servers did not show up in the server list (I can join through console) if I configure the COD4 server to bind to a specific IP-adress:
./cod4_lnxded +set net_ip 192.168.1.221 +set net_port 28960 +set dedicated 1 +set g_gametype dm +map_rotate +set sv_punkbuster 0 +exec server.cfg
When I don't bind to a specific IP but use a wildcard the server shows up:
./cod4_lnxded +set net_ip 0.0.0.0 +set net_port 28960 +set dedicated 1 +set g_gametype dm +map_rotate +set sv_punkbuster 0 +exec server.cfg
I tracked this down to UDP broadcast packages being the problem. When the client "asks" for servers in the network it broadcasts these packages. This is the tcpdump output from the client:
18:39:06.896696 IP 192.168.1.13.28960 > broadcasthost.28960: UDP, length 15
18:39:06.896773 IP 192.168.1.13.28960 > broadcasthost.28961: UDP, length 15
18:39:06.896806 IP 192.168.1.13.28960 > broadcasthost.28962: UDP, length 15
18:39:06.896835 IP 192.168.1.13.28960 > broadcasthost.28963: UDP, length 15
18:39:06.896884 IP 192.168.1.13.28960 > broadcasthost.28960: UDP, length 15
18:39:06.896957 IP 192.168.1.13.28960 > broadcasthost.28961: UDP, length 15
18:39:06.897012 IP 192.168.1.13.28960 > broadcasthost.28962: UDP, length 15
18:39:06.897066 IP 192.168.1.13.28960 > broadcasthost.28963: UDP, length 15
When I don't bind the cod4 server to a specific IP the following shows up in the tcpdump on the server when I request the local/LAN server list:
18:49:53.639269 IP 192.168.1.13.28960 > 255.255.255.255.28960: UDP, length 15
18:49:53.639604 IP 192.168.1.13.28960 > 255.255.255.255.28961: UDP, length 15
18:49:53.639938 IP 192.168.1.13.28960 > 255.255.255.255.28962: UDP, length 15
18:49:53.640329 IP 192.168.1.13.28960 > 255.255.255.255.28963: UDP, length 15
18:49:53.640498 IP 192.168.1.13.28960 > 255.255.255.255.28960: UDP, length 15
18:49:53.640829 IP 192.168.1.220.28960 > 192.168.1.13.28960: UDP, length 169
18:49:53.640835 IP 192.168.1.13.28960 > 255.255.255.255.28961: UDP, length 15
18:49:53.640850 IP 192.168.1.220.28960 > 192.168.1.13.28960: UDP, length 169
18:49:53.641044 IP 192.168.1.13.28960 > 255.255.255.255.28962: UDP, length 15
18:49:53.641391 IP 192.168.1.13.28960 > 255.255.255.255.28963: UDP, length 15
18:49:53.660843 IP 192.168.1.13.28960 > 192.168.1.220.28960: UDP, length 15
18:49:53.661192 IP 192.168.1.220.28960 > 192.168.1.13.28960: UDP, length 169
When I bind the cod4 server to a specific IP, only the incoming broadcast packages appear in the tcpdump output:
18:51:45.101509 IP 192.168.1.13.28960 > 255.255.255.255.28960: UDP, length 15
18:51:45.102035 IP 192.168.1.13.28960 > 255.255.255.255.28961: UDP, length 15
18:51:45.102238 IP 192.168.1.13.28960 > 255.255.255.255.28962: UDP, length 15
18:51:45.102588 IP 192.168.1.13.28960 > 255.255.255.255.28963: UDP, length 15
18:51:45.102924 IP 192.168.1.13.28960 > 255.255.255.255.28960: UDP, length 15
18:51:45.103312 IP 192.168.1.13.28960 > 255.255.255.255.28961: UDP, length 15
18:51:45.103482 IP 192.168.1.13.28960 > 255.255.255.255.28962: UDP, length 15
18:51:45.103818 IP 192.168.1.13.28960 > 255.255.255.255.28963: UDP, length 15
18:51:46.355719 IP 192.168.1.13.28960 > 255.255.255.255.28960: UDP, length 15
18:51:46.356045 IP 192.168.1.13.28960 > 255.255.255.255.28961: UDP, length 15
18:51:46.356269 IP 192.168.1.13.28960 > 255.255.255.255.28962: UDP, length 15
18:51:46.356612 IP 192.168.1.13.28960 > 255.255.255.255.28963: UDP, length 15
18:51:46.356759 IP 192.168.1.13.28960 > 255.255.255.255.28960: UDP, length 15
18:51:46.357130 IP 192.168.1.13.28960 > 255.255.255.255.28961: UDP, length 15
18:51:46.357510 IP 192.168.1.13.28960 > 255.255.255.255.28962: UDP, length 15
18:51:46.357668 IP 192.168.1.13.28960 > 255.255.255.255.28963: UDP, length 15
I edited the following in the /etc/sysctl.conf file but that did not solve the issue:
net.ipv4.conf.default.rp_filter = 0
net.ipv4.icmp_echo_ignore_broadcasts = 0
net.ipv4.conf.all.rp_filter = 1
net.ipv4.all.rp_filter = 1
net.ipv4.conf.default.arp_filter = 1
net.ipv4.conf.all.arp_filter = 1
The following information is applicable:
- CentOS release 6.6 (Final)
- Call of Duty 4 client, version 1.7
- Call of Duty 4 server, CoD4 MP 1.7 build linux-i386 Jun 28 2008
- Server uses virtual ip-adresses (eth0:0/eth0:1)
- All the server interfaces have BROADCAST enabled.
- selinux has been disabled for testing purposes.
Is there a way to explicitly allow this in CentOS or would there be another possible origin for this problem?
Thanks!
ifconfig
.