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



On 2006-04-30, Chris Chilvers <keeper@xxxxxxxxxxx> wrote:
On Sat, 29 Apr 2006 09:25:55 -0700, david <david@xxxxxxxxxxxxxxxx>
wrote:

I still don't see how using the subnet mask helps anything here. The
fact that two ip addresses are on different subnets doesn't tell you
whether to use the internal IP or the external IP.

What the server probably wants to check here is whether the IP in the
packet header matched the IP in the packet data. That would tell you
whether the packet was NATted, which is what you really want to know.

You might also want to check whether hosts A and B had the same external
IP both in the packet data and the packet header, which would let you
identify situations where A and B are local to each other but remote
from the server.


I originaly thought about that, but then I thought about the fact that
the NAT we think about of multiple machines sharing the same IP is in
fact NAPT, whilst true NAT means that each machine could have a
different external IP whilst all being on the same internal network.

True, though in practice I think it would be awfully rare to have
multiple desktop machines behind "true NAT" firewalls.

The
only work around I could see was to have one client try to talk to the
other client internaly first to see if a connection could be found,
hence the use of the shared secrect. Think about it you probaly want two
shared secrects, one from A and one from B so that they both know they
are talking to the right machine, whilst in my first idea only A knew it
had the right computer, B does not (B could have connected to a random
computer that just accepted the connection).

Agreed.

Ideally you'd also want to handle situations where A can initiate a
connection with B, but B can't initiate a connection with A. But I
suspect this is all getting pretty far afield from the OP's needs, which
I don't think included server registration at all.

.



Relevant Pages

  • Re: peer to peer messaging
    ... attempts to open a connection to port 80 of the server at that IP address. ... For example a packet from my machine might have source IP ... Packets from the sever to my laptop would have those reversed. ...
    (comp.lang.java.programmer)
  • adding a printer FIX
    ... server 2003 enterprise machine: IIS, mail and File server- and now partial ... internal XP machines ... the printers were not on the server itself. ... 4.Remote into the server again and run the new connection wizard select make ...
    (microsoft.public.windows.server.networking)
  • Re: Adding Printer FIX
    ... server 2003 enterprise machine: IIS, mail and File server- and now partial ... internal XP machines PRO ... the printers were not on the server itself. ... without a physical connection to the server and no SCSI cards need be added. ...
    (microsoft.public.windows.server.networking)
  • Adding Printer FIX
    ... server 2003 enterprise machine: IIS, mail and File server- and now partial ... internal XP machines PRO ... the printers were not on the server itself. ... without a physical connection to the server and no SCSI cards need be added. ...
    (microsoft.public.windows.server.networking)
  • Re: Adding Printer FIX
    ... > print server. ... > 2 internal XP machines PRO ... > network was just fine all printers shared and accessible. ... > without a physical connection to the server and no SCSI cards need be added. ...
    (microsoft.public.windows.server.networking)