Solved

How do you get the IP address of a network?

Posted on 2014-09-11
12
295 Views
Last Modified: 2014-09-20
I want to be able to restrict a license to a given network IP address, on the assumption that only one network will have that address.

If that assumption is valid, I need the Delphi code to retrieve the IP address of a given network so that I only allow access to computers that are actually on that network.

I will use that IP address to validate the license, by running an already existing routine on the Internet each time a new computer tries to get a Registration Key.
0
Comment
Question by:GrahamDLovell
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 3
12 Comments
 
LVL 27

Expert Comment

by:Sinisa Vuk
ID: 40318718
In this blog you will find code to get local IP address:
http://delphi.about.com/od/networking/l/aa103100a.htm
....solution from EE:
Q_27628218

I suggest more unique way - get MAC address (on EE too) of network adapter:
Q_28333946
0
 
LVL 19

Expert Comment

by:MerijnB
ID: 40318728
Keep in mind that a pc can have multiple ip addresses, which can change.
Like Sinisa suggests, if you want to make it 'unique', get some other info from the pc, MAC address is a good one, although it can be easily changed. Using WMI it's not so hard to get interesting information which you can use to uniquely identify a pc (to a certain extend of course). Think of things like: number of cores on cpu, serials from hard drives, motherboard, etc.

If you go there, there are some WMI related things you need to keep in mind.
0
 

Author Comment

by:GrahamDLovell
ID: 40318998
A business with an network installation can get an unique IP address from a global/regional registrar. If they do this, I want to be able to automatically retrieve it from the local PC running my software.

Is that feasible?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 19

Expert Comment

by:MerijnB
ID: 40319003
Are you talking about external or internal ip?
0
 

Author Comment

by:GrahamDLovell
ID: 40319036
An external IP is the only one that would really provide the security I need. Is it possible?
0
 
LVL 19

Expert Comment

by:MerijnB
ID: 40319045
afaik you can only get this from a 3th party on the outside, an option would be to download from http://icanhazip.com/

But it's quite possible that this is not allowed by firewalls on your customer side, or dns is blocked.

All in all, I think it's not something you can trust, firewalls can block, it's possible a customer's external ip will change, it's possible that multiple machines will have different external ip's. My advice would be to look for another scheme for your licensing.
0
 
LVL 27

Expert Comment

by:Sinisa Vuk
ID: 40319054
Dhcp server provides local ip addresses and I share you a link with code which gets those ip-s. What is a problem? Did you try?
0
 
LVL 19

Expert Comment

by:MerijnB
ID: 40319057
Sinisa, Graham is looking for external ip, not internal
0
 
LVL 27

Accepted Solution

by:
Sinisa Vuk earned 500 total points
ID: 40319106
His question is not clear ... that he needs external ip address - which is uniqe but external ip address is changing on reseting router.

...IP address of a given network....
There are few EE questions with same topic:
http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_21392636.html
http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_21818645.html

...but I suggest again MAC address.
0
 
LVL 19

Expert Comment

by:MerijnB
ID: 40319112
which is uniqe but external ip address is changing on reseting router.

This is certainly not true, it can happen in some cases (like I mentioned above), but this doesn't happen always by a long shot.
0
 

Author Closing Comment

by:GrahamDLovell
ID: 40319175
The solution is found on http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_21818645.html, referenced here. This will work if the IP address is stable, which in the scenario I envisaged it would be. Time will tell whether that is really the case.
0
 

Author Comment

by:GrahamDLovell
ID: 40334253
Based on the above comments, it looks like IP address and MAC address will both be too hard to manage. Instead, I will create a licence management function on my web site for network licences.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface There are many applications where some computing systems need have their system clocks running synchronized within a small margin and eventually need to be in sync with the global time. There are different solutions for this, i.e. the W3…
Configuring network clients can be a chore, especially if there are a large number of them or a lot of itinerant users.  DHCP dynamically manages this process, much to the relief of users and administrators alike!
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question