IPs problem

  • Thread starter Thread starter Xarky
  • Start date Start date
X

Xarky

Hi,
I am writing a small client server program. Now my computer is
connected to a router, and is going to run as the server program.
Since the router generates IPs for the computers connected to it, what
IP should be given to the client...or how can I get around this
problem.

When I enter the site www.whatip.com - the ip assigned by my ISP is
given but when I type iconfig in command prompt, the ip assigned by
the router is given.

Can someone help me out.

Thanks in Advance
 
Hi,

You need to assign your computer (the one running as the server) a static ip
address and possibly put it in the DMZ. Once you have done this you will
then be able to access that machine reliably by ip. If you have registered a
domain name to the ip that your ISP has given you, you will have to place
your computer in between the router and the incoming line. For a specific
tutorial regarding your router you can do a web search and find a plethora of
information or post to the alt.comp.networking.routers for help

Hope this helps.
 
Xarky said:
Hi,
I am writing a small client server program. Now my computer is
connected to a router, and is going to run as the server program.
Since the router generates IPs for the computers connected to it, what
IP should be given to the client...or how can I get around this
problem.

When I enter the site www.whatip.com - the ip assigned by my ISP is
given but when I type iconfig in command prompt, the ip assigned by
the router is given.

Can someone help me out.

Thanks in Advance

Ok, Xarky, let me try to help you here:

First, you connect to the internet thru a router, so the ip address you
see when you go to www.whatip.com is your router's ip address, assigned
by your Internet Provider, and it's the ip address your network is seen
from outside.
The ip address which you see when you execute ipconfig is the actual ip
address of your computer in your local network, assigned to you by your
DHCP server. This ip address usually starts from 192.168.*.* or 10.1.*.*
and is NOT seen from outside your network.

That was some intro to make sure we are on the same page.
Now, you are running some server on your computer and want to provide
access to this server for people from internet, right?

In this case you can either make your computer a DMZ, so that all
traffic will be forwarded to it, but it's not really secure.
Or you can just setup a port forwarding on your router to your computer
by your server port.

EG. if your server is running on port 8080 and your computer's internal
ip is 192.168.1.5, then in the router settings you set forwarding of
incoming traffic for port 8080 to 192.168.1.5.

So this way, anybody who tries to access your server should type the
routers ip address (the one you see on www.whatip.com) and your router
will re-route that traffic to your machine
(Make sure that clients for that server connect to server's listening port)

That's about it...


Maybe too watery, but hope it still helps :)

Andrey
 
Hey,

MuZZy has told you everything you need to know, but I have a little
comment:
NEVER setup DMZ server on your router, unless you know exactly what
you are doing.
It is not a little unsecure, it is a lot unsecure.

When you setup port forwarding like MuZZy explained, router allows
only configured ports to go through, DMZ server makes the internal
computer completely open for the internet, and if your software
firewall has some security issues (which I am sure it does, there
is nothing perfect...), your computer will be open to everyone...

So, configure ports and DO NOT setup DMZ in router.

Have a nice day.
 
Back
Top