Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: Discriminating between local and remote IP's

by iburrell (Chaplain)
on Oct 04, 2004 at 19:54 UTC ( [id://396367]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Discriminating between local and remote IP's
in thread Discriminating between local and remote IP's

I would never trust any IP address in the private ranges. You might have someone elses network

You are assuming that the server has two NICs, one on a private LAN, and another on the Internet connections. This is a rare configuration. Also, it is fairly hard to determine which interface the connection came from. You can look at the incoming IP address. It isn't that reliable for scurity.

It is better to look at the remote IP address. This can be spoofed and isn't very good security. But if you are looking at the IP address for trust, you aren't interested in good security.

  • Comment on Re^3: Discriminating between local and remote IP's

Replies are listed 'Best First'.
Re^4: Discriminating between local and remote IP's
by traveler (Parson) on Oct 04, 2004 at 20:07 UTC
    While it is true that using IP addresses for trust is not good security, it is easy to find out on which IP a connection came in.
    getsockname SOCKET Returns the packed sockaddr address of this end of the SOCKET connection, in case you don't know the address because you have several different IPs that the connection might have come in on.
    HTH, --traveler

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://396367]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-20 04:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found