01-29-2010 05:31 PM
Hello to everyone.
As usual one more query.
I am developing an application that uses the protocol TCPI_IP.
Using the libraries of the CVI, the process becomes easy.
However I have a doubt in my application I have to know the IP of my router.
My connection is ADSL, has the following configuration. PC -> Router -> Modem, the PC's IP is "192.168.0.200" (IP I can find that by using the GetTCPHostAddr) and the router's IP is "201.51.250.400".
The doubt is, is there any function in CVI that returns the IP used by the router to communicate with the Internet? That is the IP "201.51.250.400"
For it is from this IP that I can communicate with my equipment, which is configured as a client.
Since already I am thankful.
Ivan
02-01-2010 12:10 AM
Does your router support DynDNS ? Then use a DynDNS service to setup a hostname for your router and use that hostname instead of the IP address and you probably have to configure also portforwarding on your router to make your server visible to the client(s) because 192.168.xxx.yyy is a non routable private IP address.
02-01-2010 12:43 AM
Hi Markus Kossmann.
I have thought this possibility, but would like to have a more practical way to find the IP router.
Well, as I wrote above, is an application that will have to distribute to people who mostly have a lot of difficulty make this configuration.
So if you can have a clear indication of the IP router without using the DynDNS service is less complicated for the customer.
It's hard to believe that there is no way to find the IP connection router.
I will continue waiting to see if someone has another suggestion.
Thanks for the reply.
Ivan
02-01-2010 01:25 AM
There is no "simple" solution for that.
Mightbe ( I can't check it here) the output of a tracert command includes the neccessary information and you can parse it.
Or you can use the interface on the router which is provided for the DynDNS service with your own program. But I think that is more comlicated than using a DynDNS service.
02-01-2010 03:36 AM
Ivan:
I think a dynamic DNS serivce would be the best (and normal) way to achieve what you want (which I think is to use your PC as a server). If you sign up to a service like dyndns.com, you can assign a proper domain name to your internet address; thenthe clients only have to look up that domain name to get the right IP address.