The IP tells the server which network interface to use: LAN, WiFi, ... One of 
these interfaces is the "loopback interface", the virtual device that provides 
access to, among others, 127.0.0.1. It tends to be called "lo".

Unless there have been massive changes recently, the Linux server decides which 
interface to use by default by resolving your hostname. Most systems are set up 
to first consult /etc/hosts and then DNS.

Let's assume my machine is called "caesar". Its fully qualified domain name 
would be "caesar.local" (unless I have an actual domain; then I can use that). 
If the following line is in /etc/hosts:
127.0.0.1 caesar.local caesar
then hlds will bind to the loopback interface, making external connections 
impossible. If, on the other hand, I go for
192.168.123.45 caesar.local caesar
where 192.168.123.45 is the IP address I have on my LAN, then hlds will bind to 
the LAN interface and accept incoming connections. (Your router forwards 
datagrams arriving at your external address to your server's internal address; 
hlds mostly need not worry about the external address.)

This default choice ("I resolve my own hostname") can be overridden using the 
CVar "ip".

Note that it is IMPORTANT that the first hostname of each entry in /etc/hosts 
is fully qualified, otherwise the magic described above won't work.
192.168.123.45 caesar.local caesar
is fine,
192.168.123.45 caesar caesar.local
or
192.168.123.45 caesar
are not.

Also, you can add multiple aliases:

192.168.123.45 caesar.local caesar gaius caius

Note that if you type in your external IP address, hlds will protest simply 
because your server has no network card with that address.

Hope this clears things up.

Cheers,
~~ Ondra
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlds_linux

Reply via email to