SRCDS Steam group


Re-use port with different IP
#1
Hi guys

I followed the tutorial on http://www.srcds.com/db/engine.php?subaction=showfull&id=1102717219&archive=

Managed to get CS Source to listen on a different IP address assigned by my dediacted server company, but the problem now: It doesn't want to use ports already used by a different IP address.

There is only 1 physical interface, and I am provided with 3 IPs

Does this mean that no matter what IP you use, each port can only be used once or is there something that I Can do?

Specs:
Sempron 2800+
1GB RAM
80GB Hard Disk
100Mbps
Debian Stable
2.4.27-2-386 (yes, I will get round to compiling a 2.6 kernel sometime with 1000MHz polling)

GNU libc 2.3.2
gcc 3.3.5

I tried running with ./srcds_run -ip xxx.xxx.xxx.xxx -port 27015
but it always increments the ports by 1, client for 27006 and server 27016

Thanks in advance guys
Reply
#2
first you have to assign the ips to the nic (if not already done so), then just use -ip xxx.xxx.xxx.xxx -port 2071x in the start line.
Reply
#3
fqdn Wrote:first you have to assign the ips to the nic (if not already done so), then just use -ip xxx.xxx.xxx.xxx -port 2071x in the start line.

Hi fqdn,
Thanks for replying

I have already assigned the IPs to the interface with ifconfig eth0:1 xx.xxx.xx.xx and executed a second instance of CS Source with the new IP address.

Problem is, even though the 2nd instance uses the new IP address to itself, it increments the port anyway, even if I tell it to use 27015, it will use 27016.

Just not sure if this is a constraint to the interface
Reply
#4
nope shouldn't be that way at all, do a netstat -l and see if anything/or what is listening on 27015 for all the ips.

you can also try editing the config files directly instead of using the ifconfig command though it should be all the same.
Reply
#5
I think I found the problem:

I only set eth0:1 and not eth0:0

The original first instance of CS Source was listening on localhost, which automatically listened for the original ip address 11.111.11.11

I added in eth0:1 to listen to 22.222.22.22, and made the 2nd instance of CS Source listen on that IP address, but it wouldn't re-use the port.

I added eth0:0 to listen to 11.111.11.11 and then quit all CS Source servers and started them up one by one. Server seems to run fine now.

netstat originally showed:
Quote:tcp 0 0 *:27015 *:* LISTEN
...
...
udp 0 0 *:27015 *:*

Now it shows more realistic data:

Quote:tcp 0 0 serverXXXXX.uk2ne:27015 *:* LISTEN
tcp 0 0 22.222.22.22:27015 *:* LISTEN
...
... same for UDP

Just need to test them out now Toungue

The only thing now though, is when I use aptitude or nslookup or similar, it doesn't resolve the hostnames - such as security.debian.org

In order to install via the repositories or so on, I have to take out the eth0:X entries, do the aptituding and then add the eth0:Xs back in.

Possibly my firewall (firehol).

Thanks for helping me fqdn, netstat -l will also come in handy in the future.

Edit:

hmm, don't seem to work properly yet - possibly the firewall.
The servers run, but server on 22.222.22.22 doesn't respond - doesn't even connect to the Valve/Steam servers, therefore causing VAC to be disabled.

And I just realised I did not have to assign 11.111.11.11 to eth0:0 . . . Hmm I think I'm messing things up now

Another thing to note:
eth0 uses mask Mask:255.255.255.128
eth0:0 and eth0:1 use Mask:255.0.0.0

Think that makes any difference also?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)