# Connection issues in programs

## Midnight Dream

Ok, I seem to be having all sorts of problems connecting to people via various programs.  Im Gaim, I cant Direct IM with half my buddy list (though I can in Windows).  In UT2K4 I cannot connect to a friend of mine when he creates a game, and he cant connect to me either.  Whats going on here?  I dont have these issues in Windows at all, and Linux is supposed to have the more efficient network code.  Any thoughts?

----------

## noup

Are you using a firewall in linux? What kind is your connection to the internet?

----------

## Midnight Dream

No firewall, unless one is included by default, and my connection is DSL.  Setup is as followed

[Internet]------>[DSL Modem in Bridge Mode]------->[Router]----------->[Computers]

I have had no issues with the router before in such cases, but even so I tried forwarding the ports, and still no luck.

----------

## Midnight Dream

For reference, this is the router I have

BEFSR41 V3 - http://www.linksys.com/products/product.asp?prid=561&scid=29

----------

## Midnight Dream

Ok, question real quick.  I got the Gaim problem fixed, I have to set my public ip (my internet broadcasted IP), but that means if ever my internet disconnects, I have to set it again.  Is there a way to setup a script or something, for that whenever eth0 comes up, it will modify /home/{$User}/.gaim/prefs.xml where it says

```

                        <pref name='public_ip' type='string' value='x.x.x.x' />

```

where x.x.x.x is my public ip

----------

## noup

so, the router is your problem right now... that's strange, since i have a linksys router (wrt54g) and gaim/games work without problems. which gaim version are you using? and also, are you using the latest firmware in the router? (just a shot in the dark).

about the other question, you can simply add a line to your /etc/init.d/net.eth0 start() method, though this wouldn't be the best way of doing it (perhaps a better way would be to include a script of yours as a dependency of net.eth0).

----------

## Midnight Dream

I am using Gaim 1.1.4, though I am going to be updating to 1.2.0 in a few minutes.  Also, I do have the latest firmware on my router (1.05).  And, as for the script,  I have no idea how  I would go about:

Making it get the external ip

Opening prefs.xml

Finding the specific line

Editing only the needed parts

Saving

----------

## noup

so, how did the latest version go? btw, are you using the router's configuration defaults or have you set any "special" option?

about the script, i think it can be done with only shell programming. though, i'm not really into it, so i really can't help you on that. but let's not forget this is a last resource. there are certainly tons of people using the same router as you, and the same gaim, so i really think there must be another solution. have you tried searching?

----------

## Midnight Dream

Thanks for the reply.  I havent gotten to test it out yet, as i'm sick and at home, and all my friends are at school.  The router configuration is pretty much default, I just have some port forwarding going on.

----------

## noup

 *Midnight Dream wrote:*   

> Thanks for the reply.  I havent gotten to test it out yet, as i'm sick and at home, and all my friends are at school.  The router configuration is pretty much default, I just have some port forwarding going on.

 

Ah... that's not good.  :Confused: 

What kind of IM network are you trying to use btw?

----------

## Midnight Dream

AIM, using the login.oscar.aol.com login

Also, I just tested, and I still have to put in my external public ip before I can connect to other people, send files, etc.

----------

## noup

 *Midnight Dream wrote:*   

> AIM, using the login.oscar.aol.com login
> 
> Also, I just tested, and I still have to put in my external public ip before I can connect to other people, send files, etc.

 

the "sending files" thing is different, you generally have to use port forwarding for that to work (either sending or receiving, not both). about the talking, try using another network and see how it goes. i don't use AIM, so i don't know the variances between that and the other networks.

----------

## Midnight Dream

Well, its an issue of not just sending files.  Its also directly connecting to other users, and its not all, but most people.  I found a way for it to work, yet I have to like I said, put my external ip into the 'specify ip' section in the configuration.

----------

## noup

 *Midnight Dream wrote:*   

> Well, its an issue of not just sending files.  Its also directly connecting to other users, and its not all, but most people.  I found a way for it to work, yet I have to like I said, put my external ip into the 'specify ip' section in the configuration.

 

Yes, i understood that. That's because, as it seems, when you try to talk to someone a direct connection is made, and so the IP gaim sends is your local ip (192.168.1.10, for example). But, when using AIM, are there always used only direct connections? (the conversations don't go through the server?) This is why i asked you to try with MSN messenger, for example. Also, try one other thing. Does it fail when you try to create a conversation (you open a new window and talk to someone), or does it fail when someone's trying to talk to you (or both)? Please clear that out, it should only fail in one of the two ways.

----------

## Midnight Dream

With AIM, the default setup is based on a mediated connection.  The two parties send messages through a server, unless they directly connect.  When I try to directly connect to somebody, it will always try to connect from my local ip (192.168.1.2) unless I specify specifically to use a different ip (in such, my external, that I have to type in every time the internet reconnects).  I dont guess I am having trouble with other protocols, but I dont use them enough to be 100% sure.  I can send files fine to a friend of mine via MSN, but that just goes with the thing that it works for some people, and doesnt for others.

----------

## noup

 *Midnight Dream wrote:*   

> With AIM, the default setup is based on a mediated connection.  The two parties send messages through a server, unless they directly connect.  When I try to directly connect to somebody, it will always try to connect from my local ip (192.168.1.2) unless I specify specifically to use a different ip (in such, my external, that I have to type in every time the internet reconnects).  I dont guess I am having trouble with other protocols, but I dont use them enough to be 100% sure.  I can send files fine to a friend of mine via MSN, but that just goes with the thing that it works for some people, and doesnt for others.

 

OK, so this explains it a little bit. I don't know whether you know this or not, but when you connect to a computer, you connect to a port in that computer, and so that port must be opened. When that computer is behind a router, for example, the router must know the computer for which it has to redirect all the packets that arive at a specific port of his. That's why you have to redirect a "port" to a local "IP address".

Now, when you try to estabilish a direct connection between two computers, it depends a lot on the way the network you're using works. At best, it should go like ("A" being "computer A", and "B" being "computer B"): if A's or B's port is accessible from the internet, use one of the two; if only A's port or only B's port is accessible, use the one that's accessible; if none is accessible, a direct connection is impossible and so both A and B should connect through the network server.

About the MSN file transfers, i think that when a direct connection can't be estabilished, the transfer will go through the server. However, i only managed to get this done using the Microsoft's MSN Messenger, so it seems like Gaim doesn't support transfering files through the msn server.

About AIM direct connections, Gaim should send the internet IP address you're using... that's the only way it can be "usable" in this context (manually specifying the IP address isn't very welcome). Perhaps there is an option in Gaim for you to use the external IP address (i have faith on this)?  :Smile: 

----------

## Midnight Dream

There is an option to automatically detect the IP, but the thing is, when that option is enabled, it grabs my local ip.  I have to disable that and specifiy my internet IP before it works to connect to other people, send files.

----------

## noup

 *Midnight Dream wrote:*   

> There is an option to automatically detect the IP, but the thing is, when that option is enabled, it grabs my local ip.  I have to disable that and specifiy my internet IP before it works to connect to other people, send files.

 

I was thinking about some other option.  :Smile: 

Well, i really think you should have searched a little bit before. It looks like this is a known bug: link.

----------

## Midnight Dream

But the thing is, it like half way works.  I can get it to work with everybody, as long as it can detect my external IP, and other people claim to have no issue with this, so I am wondering if it has been fixed for the most part or what.

----------

## noup

 *Midnight Dream wrote:*   

> But the thing is, it like half way works.  I can get it to work with everybody, as long as it can detect my external IP, and other people claim to have no issue with this, so I am wondering if it has been fixed for the most part or what.

 

Who claims to have no issue, people using Gaim and connecting through a router?

The problem is that Gaim doesn't detect your internet IP, and instead, it uses your local IP. So it's a bug.  :Smile: 

----------

## Midnight Dream

Yes, several people I talk through who are behind a router (and some behind a nat box) claim to have no issue.

----------

## noup

 *Midnight Dream wrote:*   

> Yes, several people I talk through who are behind a router (and some behind a nat box) claim to have no issue.

 

And are they using Gaim too? Well, there is a bug nonetheless.  :Smile: 

----------

## Midnight Dream

hehe, yes, they use Gaim too.  I do not contest the issue of the bug, as it is clearly visible to me, the only thing I am wondering now, is why it does this to me, and not to some other people, and is there a way to automatically detect my external IP myself, and insert it into the prefs.xml, whenever my internet comes back up.

----------

## noup

 *Midnight Dream wrote:*   

> hehe, yes, they use Gaim too.  I do not contest the issue of the bug, as it is clearly visible to me, the only thing I am wondering now, is why it does this to me, and not to some other people, and is there a way to automatically detect my external IP myself, and insert it into the prefs.xml, whenever my internet comes back up.

 

Well, for the bug to be only visible to some people, i really don't know... perhaps it depends on the router. I think what you should do is to find the bug report and add a comentary yourself, so it helps a little bit.

if you are considering writing a script, there are several ways. in gaim, do you have to specify an IP address, or can you speciffy an address name? either way, you can sign up for a free dynamic domain name at [url=www.no-ip.com], and then "emerge noip-updater". This will create an init script at /etc/init.d/noip, and when you run it the first time it will ask you the account details. what this does it to automatically assign your current internet IP address to a name like midnightdream.no-ip.com. Then, you can use this name in Gaim, if it supports using names. If it doesn't, a way to always know your current IP will be:

```

$host midnightdream.no-ip.com

```

and then you can use its output to write the gaim preferences file.

hope this helps.

----------

