Force Public Ip?
Tomper
Join Date: 2003-02-10 Member: 13365Members
<div class="IPBDescription">My server gets local IP not public IP</div> Hello,
This is the first time I am attempting to set up a public NS server, and I've run into a problem which I need some help on...
Here's my setup: I am running a Linux-machine as a firewall/router, and to this I connect the various machines on my LAN via a switch. The router automatically assigns a local IP-number to each computer that connects to the LAN. One of these machines is a PentiumIII which I have installed the NS Server on.
The problem: When I start the NS Server, it recieves the local IP-number not the actual public IP-number my network has outwards to the internet. Thus I can find the NS Server from my other computers, but friends from the outside cannot find it.
Is there a way to force the server to start up on a specified IP (the public one)? Or does anyone have any helpful hints in the right direction here? Sad to say, I'm not the hottest of Linux-admins or network-ops. <!--emo&???--><img src='http://www.unknownworlds.com/forums/html/emoticons/confused.gif' border='0' style='vertical-align:middle' alt='confused.gif'><!--endemo-->
This is the first time I am attempting to set up a public NS server, and I've run into a problem which I need some help on...
Here's my setup: I am running a Linux-machine as a firewall/router, and to this I connect the various machines on my LAN via a switch. The router automatically assigns a local IP-number to each computer that connects to the LAN. One of these machines is a PentiumIII which I have installed the NS Server on.
The problem: When I start the NS Server, it recieves the local IP-number not the actual public IP-number my network has outwards to the internet. Thus I can find the NS Server from my other computers, but friends from the outside cannot find it.
Is there a way to force the server to start up on a specified IP (the public one)? Or does anyone have any helpful hints in the right direction here? Sad to say, I'm not the hottest of Linux-admins or network-ops. <!--emo&???--><img src='http://www.unknownworlds.com/forums/html/emoticons/confused.gif' border='0' style='vertical-align:middle' alt='confused.gif'><!--endemo-->
Comments
just add the following parameters to your command line / shortcut to start you HLDS:
<!--c1--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->+ip <yourip><!--c2--></td></tr></table><span class='postcolor'><!--ec2-->
So you have something liek this to start your server:
<!--c1--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->./hlds -game ns +ip 81.2.188.49 +port 27010 +maxplayers 17 +exec server.cfg +map ns_hera<!--c2--></td></tr></table><span class='postcolor'><!--ec2-->
Hyper
[ADDED] Just read your post fully (damn laziness), and what your saying is that your Linux machine is the only one that actually connects to the Internet, and then shares it out to the LAN. That means that only your Linux machine can use your Internet IP. Your server machine can only use a LAN IP since its not connected to the internet directly. To make it work for people outside your LAN you need to use port forwarding. On your Linux machine, open up the port you use for your server and make it forward to the server machine. This will auto direct all the traffic from the Internet to the actual server you want to receive it. I hope that helps <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif'><!--endemo-->
I tried the +ip command but the server refuses to set it. I'm going to try to set up the port-forwarding, I have a feeling that's the trick.
Question though: Is it just the port 27015 (or whichever I choose) that needs to be forwarded, or are there any more? I found a bit of text in a readme-file that says: "6) I am behind a firewall. What ports need to be opened for hlds?
Incoming UDP to local destination 27015.
Outgoing UDP to remote destination 27010, 27012.
Outgoing TCP to remote destination 5273.
Outgoing TCP to remote destination 7002."
Guess since the only *incoming* port is 27015 it should suffice to port-forward that right?
Thanks again,
/Tomper
Yes, as long as your firewall / NAT device allows all outbound connections, and creates stateful rules for outbound connections allowing return traffic back in. This is the default behavior of a SOHO hardware devices that I'm aware of.