Megahalo Wrote:If I try to run it on my static IP I get a could not allocate UDP port error which I now understand means I am not allowed to take an IP that the computer does not own because my router owns the IP.
That's one way of putting it. But first, a brief overview of Internet, LAN, and NAT (Network Address Translation).
WAN/Outside IP Address
When your ISP gives you an ethernet TCP/IP connection to the internet, possibly with PPPoE, your end of the wire will have one or more IP addresses, static or dynamic, assigned to it, by your ISP. The type and quantity of IP address depends on how much you pay your ISP. All packets traveling over that wire will have that IP address in it.
You can only have as many machines directly connected to you ISP connection as you have IP addresses from your ISP. But that's ok, most computers don't need a direct connection to the internet anyways.
LAN IP Address Assignment
When you set up a LAN, every computer must each have their own unique IP address; no sharing is possible. You can either assign them manually, static addresses, or setup a DHCP (Dynamic Host Configuration Protocol) server to manage IP address assignment.
Subnets
Also, only computers on the same subnet can communicate with each other. They should have the same subnet mask, to keep things simple. And the IP address octets, the numbers delimited by the dots, that are are in the same position as subnet mask octets of 255, must be identical on all machines.
Here are some examples:
Code:
Subnet_1 IP: 192.168.0/16
Subnet_1 Mask: 255.255.0.0
Computer_1 IP: 192.168.0.65
Computer_2 IP: 192.168.1.1
Computer_3 IP: 192.168.2.225
A computer with an IP that does not begin with 192.168
will not be able to directly communicate with Subnet_1
Subnet_2 IP: 10.0.0.0/24
Subnet_2 Mask: 255.255.255.0
Computer_1 IP: 10.0.0.3
Computer_2 IP: 10.0.0.4
A computer with an IP that does not begin with 10.0.0
will not be able to directly communicate with Subnet_2
Ports
When a computer accepts a packet with a matching destination address, it uses the port number to identify which service, the packet is for (e.g. HTTP, FTP, Echo, Source DS, etc.). Port numbers are denoted after the IP Address by a colon and number. Valid port numbers are 0 to 65535. Ports under 1024 assigned to well known services, such as port 21 for FTP.
Here are some example ports:
Code:
Echo Port 7 Used by ping
HTTP Port 80 8080 and other ports sometimes used
srcds Port 27016 Just one of several
Internet Connection Sharing / IP Address Translation
A Network Address Translator does just that, it changes IP Addresses in packets matching certain requirements. A NAT takes packets originating on your LAN destined for the outside world, and forwards them to your ISP by changing the source address. It also takes packets returning from your ISP and translates them onto your LAN by changing the destination address.
As you can see, NAT provides a simple way of sharing one internet connection among several machines. But it will only do this for TCP/IP connections initiated from your LAN. Any new connections from the outside are ignored (e.i. firewalled off).
Port Forwarding
But their is good news. A mechanism called port forwarding allows you to punch holes in the firewall and bind those holes to machines on the LAN.
When the NAT receives a packet on a port that it's listening to, it will modify destination address, and possibly the port for more exotic configurations, of the packet and send the packet onto your LAN. A machine with the matching IP address listening to that port will receive and process that packet.
Putting it all together
To host a Source DS that can be access from the internet, you must:
- Have a properly configured LAN
- Forward you Internet Gateway's (router's) Ports to your DS, see below for which ports.
- Access you server with your outside IP address
Goofy666 Wrote:[UDP] 1200 (used for Steam's Friends service)
[UDP] 27000 to 27015 (so that means all ports in between too)
[TCP] 27030 to 27039 (idem)
=> these are all Steam related ports
[UDP] 27015 and 27020 (default DS port, also used for HLTV)
[TCP] 27015 (you want to forward this for RCON access)
=> these ports are used by the dedicated server itself
Disclaimer
This is just a really brief overview that has skipped many details, such as transport protocols.
I know that this post is very late.
For a more in depth understanding, see
TCP/IP model on Wikepedia
Megahalo Wrote:I installed XAMPP (The Linux Webserver) and it works on port 80 (Normal HTTP port for those who don't know). Other people can get to my webserver. Now of course I'm trying to run my SRCDS on the exact same computer, but I can't figure out why it does not work.
Being able to access (I'm assuming from the outside) the web server is a good sign.
Megahalo Wrote:I decided to test running the SRCDS on my windows comp (LAN IP 192.168.1.100, with ports 0-65535 opened manually.). Well I study what my Windows version says my IP is and it says that the servers IP (that it uses) is 192.168.1.100, which is correct. And of course the Windows SRCDS works.
I'm assuming that when you 'opened' the ports, you were configuring the firewall on the windows machine.
There still are a few reasons that I can think of for your Linux box not being accessible. Local firewall on server, not all ports forwarded on the router, or ports not forwarded to the correct computer.
Given all of the changes you have been making, I suspect that your ducks just haven't been lining up. For this to work, all of the following are required all at the same time:
- Your friends have to use the IP address provided by your ISP.
- Your router has to be configured to forward ALL of the required ports to the correct computer (192.168.1.102 in your case), with the correct protocol (UDP/TCP) specified (if your router filters on that).
- Your server must have the correct ports opened (not firewalled) on it.
- Finally, Source DS must be bound to the correct IP address, 127.0.0.1 (localhost, means 'this' computer) or the IP address of the interface that the packets will be arriving on (192.168.1.102 in your case).
If just one of those items is not perfect, it won't work.
Now, if you tripled checked everything, see this post:
RE: Tried everything Have no idea whats wrong. It tells you how to check you're connectivity without a working Source DS.