[twsocket] Need Advice / Help on how to find the correct IP's

Stephen Williams SWilliams@fm.optus.net.au
Tue, 13 Jun 2000 14:29:35 +1000


Due to the wide variety of connection types available for people to connect
their computers to the "Internet", you can never be 100% certain which
interface is going to the outside and which interface is going to the inside
world.

There seems to be a very common misconception that the Internet is something
completely different than a private LAN.  It isn't.  It is the same thing.
Just on a much larger scale.

There are a couple of IP ranges set aside for private LAN usage.  I believe
these are 10.x.x.x and 192.168.x.x.  There may be some others as well.  All
private LANs should use IPs in these ranges.  Therefore, if one of the IPs
returned by LocalIPList is in one of these ranges, then you may safely
assume that it interfaces to the private LAN.  If the IP address is not in
one of these reserved ranges, then assume that it connects to the
"Internet".  If the private LAN uses IPs outside of these reserved ranges,
then it is the LAN administrators own fault for not following the prescribed
guidelines.

Steve 'Sly' Williams
IT Development
Cable & Wireless Optus Outsourcing Services
swilliams@fm.optus.net.au
------------------------------------------------------------
(On the difference between men and women:) "On the one hand, we'll never
experience childbirth. On the other hand, we can open all our own jars."
------------------------------------------------------------

> The problem is: My program gets the IPs already but sometimes
> does the mistake to sitch these adresses so they are in the 
> wrong place.
> 
> Example:
> Private Network-IP: 192.168.0.1
> Internet-IP:  62.244.34.132             
> 
> So if the user has 1 Network card my program tells him:
> Private Network-IP: 192.168.0.1
> Internet-IP: None
>    
> if the user has 1 Network card and is has an Internet-IP at 
> the same time my program tells him:
> Private Network-IP: 192.168.0.1
> Internet-IP: 62.244.34.132
> 
> And now the problem again:
> if the user has only an Internet-IP and no Network card 
> installed my program tells him:
> Private Network-IP: 62.244.34.132
> Internet-IP: None
> 
> And thats the problem. I want to be 100% sure which one is 
> assigned to which interface.
> 
> Hope you have an idea...
> 
> Greets
> 	Ralf
> 
> >Wel if you can connect with addr '0.0.0.0' you have the ip 
> of the server.
> >You can call LocalIpList to get list of all interface cards. 
> Next step is to
> >set LocalAddr property to the first one and try to connect 
> again. If it dont
> >work, then it's the wrong one, you can try the next, etc, 
> and if connect is
> >ok then you have the interface witch is connected to internet.
> >
> >If I'm completely wrong here pleas ask the original question again.
> >
> >rgds, Wilfried
> >
> >> -----Original Message-----
> >> From: twsocket-admin@elists.org 
> [mailto:twsocket-admin@elists.org]On
> >> Behalf Of Ralf Buml
> >> Sent: maandag 12 juni 2000 19:43
> >> To: twsocket@elists.org
> >> Subject: RE: [twsocket] Need Advice / Help on how to find 
> the correct
> >> IP's
> >>
> >>
> >>
> >> Hi Wilfried!
> >>
> >> Thanx for your answer! :)
> >>
> >> It's ok... I knew the thing with the IP-Adresses already.
> >> But as your last paragraph says some users don't know
> >> which IP-Adresses are valid. (I was such a user some years
> >> ago, wondering why my Network never worked on TCP/IP :)))
> >>
> >> Is there no other way than checking these adresses?
> >> This way is much too unsecure for my needs and will be the
> >> last escape if any other way is possible...
> >>
> >> Greets
> >> Ralf
> >>
> >> >Normally (if lan ip properly configured), the lan ip 
> address should be a
> >> >private netwerk, and the internet ip address is a public one.
> >> Difference is
> >> >a private network is normally not routed. Private are:
> >> >
> >> >class A (for very large networks):
> >> >10.0.0.0 / 8
> >> >
> >> >class B (for large networks):
> >> >172.16.0.0 / 12
> >> >
> >> >class C (small networks):
> >> >192.168.0.0 / 16
> >> >
> >> >Note if someone does not untherstand: the /nn is the 
> number of bits
> >> >belonging to the network. eg: the class B machines: is 
> from 172.16.0.1 to
> >> >172.31.255.254
> >> >
> >> >However, I have seen many LAN's with public addresses 
> also because many
> >> >people (including the network administrators) does not know it.
> >
> >
> >_______________________________________________
> >TWSocket mailing list [http://elists.org/mailman/listinfo/twsocket]
> >Visit our website at http://www.rtfm.be/fpiette/indexuk.htm 
> 
> 
> 
> So long        Ralf
> 
> - need you, dream you, find you, fuck you, use you, scar you, 
> break you -
> -        lose me, hate me, smash me, erase me (N.I.N. - 
> ERASER)         -
> -         Homepage:  
http://www.t-online.de/home/sledge-hammer          -
 



_______________________________________________
TWSocket mailing list [http://elists.org/mailman/listinfo/twsocket]
Visit our website at http://www.rtfm.be/fpiette/indexuk.htm