Results 1 to 8 of 8
- 05-01-2010, 09:00 PM #1
Senior Member
- Join Date
- Oct 2008
- Posts
- 116
- Rep Power
- 0
Server is in a network using an IP, but router in network carries the external IP(www
I modified a server/client chat App from ch24, Java HTP7 DEITEL, well If I want to connect to Server from client, and Server is in a network using an IP, but router in network carries the external IP(www), then what IP to use to connect? the router's?
- 05-01-2010, 10:37 PM #2
Senior Member
- Join Date
- Mar 2010
- Posts
- 953
- Rep Power
- 4
I don't know what ch24, Java HTP7 DEITEL is, but I'm fairly certain you just want the server's IP address. The router should NAT that for you, and it should all be transparent to your program. I'm trying to think of a possible exception to that rule, but it would be so strange that I would need to see it to believe it.
-Gary-
- 05-01-2010, 10:48 PM #3
Senior Member
- Join Date
- Oct 2008
- Posts
- 116
- Rep Power
- 0
other pcs in that network of server, must not run this simple educational app... only
TEXTBOOK IS HOW TO PROGRAM , DEITEL...
if router is in one PC and the server is connected to that router/PC then I must use the router's IP? Also other pcs in that network of server, must not run this simple educational app... only one PC must run it?
- 05-01-2010, 10:57 PM #4
Senior Member
- Join Date
- Mar 2010
- Posts
- 953
- Rep Power
- 4
No, I'm pretty sure I said the opposite. Use the server's IP address. The IP layer knows that if the server is not on the local network, it needs to send the packet to the router -- your application does not get involved in that. Your application simply requests a connection to the server.
For most services, it is no problem if multiple machines on the same network run it, as the clients know which server they want to connect to. There are a few exceptions, notably DHCP, which respond to broadcast requests, so you have to be careful about more than one machine on a network running the service. In the case of DHCP you either make sure only one machine is running the service, or you make sure that all machines running DHCP share a synchronized database. But this almost certainly does not apply to your situation.
-Gary-
- 05-02-2010, 06:50 AM #5
Senior Member
- Join Date
- Oct 2008
- Posts
- 116
- Rep Power
- 0
I mean if server is in home network, and has same as router IP, like 3 other PCs on the same network(is not router PC), and make differ THE TOTAL 4 PCs, from second IP (from those kept internally networks - not outer internet) ?
- 05-02-2010, 11:23 AM #6
Senior Member
- Join Date
- Mar 2010
- Posts
- 953
- Rep Power
- 4
If I am understanding you correctly, then in that configuration you would need to set up port forwarding on the router -- and this is outside the scope of a Java forum.
-Gary-
- 05-02-2010, 11:51 AM #7
Senior Member
- Join Date
- Oct 2008
- Posts
- 116
- Rep Power
- 0
normally in a HOME NETWORK, Router has one external IP, and other PCs have the same plus one internal IP to distiguish between? correct?
- 05-02-2010, 10:35 PM #8
Senior Member
- Join Date
- Mar 2010
- Posts
- 953
- Rep Power
- 4
Again, this is outside the scope of a Java forum. A common configuration for home or business networks has a firewalling router using Network Address Translation (NAT) to share its Internet IP address(es) among a number of internal hosts. For instance you might have:
If you had a network configured like this, and you wanted to run a service on PC3 (say on port 8080) and make it available to the public Internet, you would need to configure port forwarding on the Router/firewall. You need to tell the Router/firewall that requests for connections on port 8080 should be forwarded to address 192.168.1.13. Then you would tell the clients on the Internet to connect to port 8080 on 66.102.7.99.Java Code:Router/firewall external IP: 66.102.7.99 Router/firewall internal IP: 192.168.1.1 PC1 internal IP: 192.168.1.11 PC2 internal IP: 192.168.1.12 PC3 internal IP: 192.168.1.13
-Gary-
Similar Threads
-
network problem (if anyone can try this)
By skandalouz in forum NetworkingReplies: 1Last Post: 12-23-2009, 10:45 AM -
Sending a key over network
By cst in forum NetworkingReplies: 0Last Post: 11-04-2009, 01:19 PM -
detecting mail server in network
By iqcst in forum NetworkingReplies: 4Last Post: 11-26-2008, 07:49 AM -
Monitoring the network
By khajalid in forum New To JavaReplies: 4Last Post: 09-10-2008, 01:55 PM -
Monitoring the network
By khajalid in forum NetworkingReplies: 3Last Post: 09-10-2008, 01:47 PM


LinkBack URL
About LinkBacks


Bookmarks