IP in a variable

These are old archives. They are kept for historic purposes only.
Locked
VegetaSan
Posts: 18
Joined: Wed Aug 25, 2004 9:11 am
Location: The Netherlands
Contact:

IP in a variable

Post by VegetaSan »

isnt there some variable for the IP that unrealircd is running on. for example: my IP is 63.223.21.234

thenn..
in config file... wrote:listen @ip:*
{
options
{
ssl;
};
};
here is @ip = 63.223.21.234

I asked if there is something like this because... when I reboot or something .. then my IP is different then before.. and the config file will be configed wrong.

if there isnt something like this. Then I recommend making one :D
Image
Dukat
Posts: 1083
Joined: Tue Mar 16, 2004 5:44 pm
Location: Switzerland

Post by Dukat »

Does that listen block REALLY work?
It's syntax is wrong.

Use:

Code: Select all

listen <ip:port> {
	options {
		<option>;
		<option>;
		...
	};
};

Anyway: If you don't have a static IP, buy one.
Or just don't use your dynamic IP in the listen block and listen on *:

Code: Select all

listen *:7000 {
	options {
		ssl;
	};
};
VegetaSan
Posts: 18
Joined: Wed Aug 25, 2004 9:11 am
Location: The Netherlands
Contact:

Post by VegetaSan »

yeah. I got one of those. But ... I need to type the IP there .. but what if the IP changed. . then you will connect to the wrong IP.
Image
Dukat
Posts: 1083
Joined: Tue Mar 16, 2004 5:44 pm
Location: Switzerland

Post by Dukat »

Why exactly do you NEED to type the IP there? :?:
VegetaSan
Posts: 18
Joined: Wed Aug 25, 2004 9:11 am
Location: The Netherlands
Contact:

Post by VegetaSan »

yeah .. the "link" (IP)

for example:

IP: 120.232.23.22
Static DNS: blabla.unreal.com

I needed to type "120.232.23.22" but .. what if the comp got rebooted and the ip changed to "120.232.24.168" then connecting to "blabla.unreal.com" wont work nomore.
Image
Psadi
Posts: 42
Joined: Sat Mar 20, 2004 7:50 pm

Post by Psadi »

First thing I would do is make sure the DNS gets the right IP.

If you are using a services like dyndns there is several programs for both windows and unix that will do the trick for you.
VegetaSan
Posts: 18
Joined: Wed Aug 25, 2004 9:11 am
Location: The Netherlands
Contact:

Post by VegetaSan »

I dont have any idea how to get these programs .. or what they are called. could you tell me the names , thx
Image
Stealth
Head of Support
Posts: 2086
Joined: Tue Jun 15, 2004 8:50 pm
Location: Chino Hills, CA, US
Contact:

Post by Stealth »

About the original post:

Putting the computers IP in a variable will not work. If there are more than 1 interface on a computer (such as a shell), how will Unreal know what IP to put in this variable? The only way I can think of is to bind to all the IP's that it can find and see which ones it can access, but that just doesnt make any sense. And if you were to do that, what would happen if there is more than 1 IP that Unreal can bind to?

There are just too many problems that such a feature can cause. Something like this just wont be done.
Psadi
Posts: 42
Joined: Sat Mar 20, 2004 7:50 pm

Post by Psadi »

It depends on which dns service you are using

Im using dyndns and there it works well with http://ddclient.sourceforge.net/ for unix, this one should work with other dns services as well.

for windows you have several also.

DynDns has this page with several clients that works https://www.dyndns.org/services/dyndns/clients.html

Or you could run your own DNS server but that is over my head :)
AngryWolf
Posts: 554
Joined: Sat Mar 06, 2004 10:53 am
Location: Hungary
Contact:

Post by AngryWolf »

Everyone who replied here miss an important thing. Let's say, your IP address is 1.2.3.4. You type listen 1.2.3.4:6667; in your conf. Your IP then changes to 5.6.7.8. Because Unreal doesn't listen on 5.6.7.8:6667, you can't connect to the server anymore. You lose all clients connected to the server. You must update your listen block. or they won't be able to reconnect. So you need an automatic update of the configuration file everytime the IP changes (and a /rehash is required as well, of course).
aquanight
Official supporter
Posts: 862
Joined: Tue Mar 09, 2004 10:47 pm
Location: Boise, ID

Post by aquanight »

Well, if you're not on a shell (i.e. your own box), just listen *:blah and be done with it ;p .
Psadi
Posts: 42
Joined: Sat Mar 20, 2004 7:50 pm

Post by Psadi »

AngryWolf I didnt miss the point :) I just a similary config.

I have dynamic IP and from reading the doc I came to the conclusion that its was better to as aquanight says to listen to *:port then to each time I get a new IP go in a change that, not fun to find out the server was down just becuase of a IP change. To have a static way to get to the server i got myself a DNS name and then I use dyndns to keep the DNS name poiting to my IP that is dynamic. So far its been working very well.

I think that this is a better way then to have a variable in the config file to pull the IP in.

If you had that then you would need a mechanism to detect in the IRCd server when the server gets a new IP and then pull the new IP into the config file and then rehash it automaticly.
AngryWolf
Posts: 554
Joined: Sat Mar 06, 2004 10:53 am
Location: Hungary
Contact:

Post by AngryWolf »

Ok, sorry. :)
VegetaSan
Posts: 18
Joined: Wed Aug 25, 2004 9:11 am
Location: The Netherlands
Contact:

Post by VegetaSan »

I assume I need the program called "3DWatch" ... for Win32.

well anyways .. thanks for all the info guys .. you helped me out alot. thx again.
Image
Stealth
Head of Support
Posts: 2086
Joined: Tue Jun 15, 2004 8:50 pm
Location: Chino Hills, CA, US
Contact:

Post by Stealth »

This post is getting a little off topic. See my earlier post, the one that actually applied to the original topic.

If you want to continue your discussion about dynamic DNS's and dynamic IP's, make a new post in the "Off Topic" forum.
Locked