Running a server behind a router

I'm currently developing a chat client/server application in java for my computer science seminar at college. I would like to run the server part of the application on my pc at home but I'm behind a wireless router and a cable modem. I was wondering if this would be possible.

[285 byte] By [ted_gressa] at [2007-11-15]
# 1

If your router has a public IP address, and if your ISP allows it to accept connection and if you can configure it to do port forwarding, then yes, you can do it.

jverda at 2007-7-29 > top of java,Core,Core APIs...
# 2

I'm not quite sure which IP address I would use to connect to my server. Would I use the IP address of the router? Or the IP address of my PC? I'm using DHCP right now, so would I have to assign a static IP to my PC that's running the server?

ted_gressa at 2007-7-29 > top of java,Core,Core APIs...
# 3

> I'm not quite sure which IP address I would use to

> connect to my server. Would I use the IP address of

> the router?

The public (external) address of the router, yes.

> Or the IP address of my PC? I'm using

> DHCP right now, so would I have to assign a static IP

> to my PC that's running the server?

No. The main issue here isn't that the PC's address is dynamic, it's that it's private.

http://en.wikipedia.org/wiki/Private_IP_address

So, for instance, your PC's IP is probably something like 192.168.0.1 or 10.0.0.1 or something. There could be millions of computers with that address, so it can't be used to identify a computer on the public internet.

jverda at 2007-7-29 > top of java,Core,Core APIs...
# 4

> I'm not quite sure which IP address I would use to

> connect to my server. Would I use the IP address of

> the router? Or the IP address of my PC? I'm using

> DHCP right now, so would I have to assign a static IP

> to my PC that's running the server?

No you can keep using DHCP. You can bump up the lease if you like.

But on most small networks it's still unlikely to change. Then you will need to forward/map/open ports from the router to that IP address.

The key is the public IP of your router. That's better if it is static but there are other solutions like Dynamic DNS.

Example : http://www.dyndns.com/services/dns/dyndns/

cotton.ma at 2007-7-29 > top of java,Core,Core APIs...
# 5

I've got everything working now the way I need it to. Thanks for your help!

ted_gressa at 2007-7-29 > top of java,Core,Core APIs...