How to connect behind a NAT

I am using smack and smackx to get software to connect to a chat room directly. It works fine with a server with a “real” address such as sas.sensornet.gov. In that case, I use conference.sas.sensornet.gov in my software and it connects to the room.

But in the real application, the SoapBox server is on a machine with a 192.168 address. Jabber clients can connect to this using an alias in the Windows hosts file such as

192.168.1.10 jabber.server

and then they can join the conference room. But using conference.jabber.server does not work in my software.

I tried another experiment. I made a dyndns alias (sasserver.dyndns.org) with the same ip address as sas.sensornet.gov. If I use conference.sasserver.dyndns.org, my software fails to connect to the chat room. Why?

So how do I connect to a Jabber server without a real ip name?

Thanks for any help,

Jim

jarome wrote:

I am using smack and smackx to get software to connect to a chat room directly. It works fine with a server with a “real” address such as sas.sensornet.gov. In that case, I use conference.sas.sensornet.gov in my software and it connects to the room.

But in the real application, the SoapBox server is on a machine with a 192.168 address. Jabber clients can connect to this using an alias in the Windows hosts file such as

192.168.1.10 jabber.server

and then they can join the conference room. But using conference.jabber.server does not work in my software.

It should work. Have you tried also adding “conference.jabber.server” in your hosts file?

You can specify the IP address when connecting. You need to use the right domain in your JID for authentication, however.

I tried another experiment. I made a dyndns alias (sasserver.dyndns.org) with the same ip address as sas.sensornet.gov. If I use conference.sasserver.dyndns.org, my software fails to connect to the chat room. Why?

I’m sure they would control which FQDN you are using to access and locked you out because of it.

So how do I connect to a Jabber server without a real ip name?

I’m not sure what your problem is. Do you want to connect to a jabber server on your LAN (192.168.* address), or from outside? From outside, you can configure your router to forward all requests to the jabber ports (default 5222 and 5223) to the internal IP.

If you want to use dyndns, it should work, set your jabber servers FQDN to it (saying jabber.dyndndaddress should work).

You also should then update your certificates to reflect the FQDN.

The real one is being connected to totally on the 192.168 subnet.

But I am trying to debug this using a SoapBox server with a real ip address, on the internet. So if I try to use Exodus, for example to connect to the real server (sas.sensornet.gov) using conference.sas.ornl.gov, it works. But if I try conference.sasserver.dyndns.org, it does not. Nor does it work with an entry in the hosts file, with or without the conference. prefix.

What is FQDN? Can one set it in the server? How?

If I try to connect to the dyndns alias for sas.sensornet.gov, I get

Looking up SRV: xmpp-client.tcp.sasserver.dyndns.org

Got A: 192.188.177.24 5222

SENT: <stream:stream to=“sasserver.dyndns.org” xmlns=“jabber:client” xmlns:stream=“http://etherx.jabber.org/streams” xml:lang=“en” version=“1.0” >

RECV: <stream:error xmlns:stream=“urn:ietf:params:xml:ns:xmpp-streams”><host-unknown xmlns=“urn:ietf:params:xml:ns:xmpp-streams” /><text xmlns=“urn:ietf:params:xml:ns:xmpp-streams” xml:lang=“en-US”></text></stream:error>

RECV: </stream:stream>

RECV:

With the real address I get:

Looking up SRV: xmpp-client.tcp.sas.sensornet.gov

Got A: 192.188.177.24 5222

SENT: <stream:stream to=“sas.sensornet.gov” xmlns=“jabber:client” xmlns:stream=“http://etherx.jabber.org/streams” xml:lang=“en” version=“1.0” >

RECV: <stream:stream from=“sas.sensornet.gov” xml:lang=“en” id=“80f59446-c13b-409c-b748-43ad124011ce” xmlns=“jabber:client” version=“1.0” xmlns:stream=“http://etherx.jabber.org/streams”>

RECV: <stream:features xmlns:stream=“http://etherx.jabber.org/streams”><mechanisms xmlns=“urn:ietf:params:xml:ns:xmpp-sasl”><mechanism>

Finally, I never can get the smackx debugging console to appear. I start my java code with -Dsmack.debugEnabled=“true” and thesmackx debug library is included (I think). Is there a trick to getting this to work?