At a loss figuring out if an IP is on LAN or INET



I'm writing an app that communicates with computers both inside and outside
my router. So I need to determine by the remote host's IP address if I need
to send them my LAN IP or my Internet IP. Someone suggested AND'ing the IP
and my Subnet Mask but I come up with this:

My IP: 192.168.0.14
Mask: 255.255.255.0

Result: 192.168.0.0

Should I just compare the first two octets? Or are there situations where
this would provide incorrect results?


.



Relevant Pages

  • Re: IP Printing Problems with OSX
    ... DSL router, the subnet mask is 255.255.255.0, but when connected to the ... your network, computers, printers, routers, everything. ... DHCP, but to leave out a few IPS, such as the 192.168.1.1 through ...
    (uk.comp.sys.mac)
  • Re: IP Addressing
    ... A company have been given two static ip addresses for their two computers ... Or does the subnet mask have to be 255.0.0.0? ... I don't see why they're using a router when they have public IP ... Please post any reply as a follow-up message in the news group ...
    (microsoft.public.windowsxp.network_web)
  • Re: Redirect to VPN tunnel?
    ... At the remote site you need to change the DHCP options on the router so that the clients are using the main office DNS and WINS. ... Without DNS and WINS pointing to the SBS server the remote computers have no way to resolve names from the main office. ... Connection-specific DNS Suffix. ...
    (microsoft.public.windows.server.sbs)
  • Maintaining the ability to remote desktop after I move.
    ... Now how do I apply that to my router? ... >allow you to vnc into the router. ... >>find a way to remain connected to their computers ... But is that even possible form a remote ...
    (microsoft.public.windowsxp.network_web)
  • Re: Cannot access some sites with IE or Firefox
    ... computers in home network connected to a Airnet AWR014g Router via ethernet. ... subnet mask 255.255.255.0 ... Local Area Connection 2 is set to a static ip address 192.168.1.102 subnet ...
    (microsoft.public.windowsxp.network_web)