How to determine the Public IP address for a Tinc VPN to work? - vpn

Me and my 3 friends want to connect our computers through a VPN with each other. We thought of using Tinc for our purpose. While I understood most of the part of setting up but what I'm unable to get is the Public IP of my computer. Tinc requires the Public IP of at least one of the hosts for it to initiate connection. I tried going on the internet to find my Public IP but different websites are giving me different results. What should I put in the configuration file for my Public IP?
EDIT
Specifically we have a Raspberry Pi which is with me currently. We want everyone of us to be able to access the device. I installed Tinc on the Pi and then I don't know what to do for the Public IP. I'm using SSH to control the Raspberry Pi. So please tell me how to find the public address of the Pi through SSH.

You can find your Public IP address by using one of these methods.
Open Google and type "What's my IP". Google displays your Public IP address in the result.
Go to What Is My IP to find out your Public IP.
Since you're using the command line, I would recommend this: execute curl ipinfo.io/ip command and your Public IP will be displayed.

If your router does not reboot, you public IP is not supposed to change. So, if you go on a website like this one, you should have your public IP displayed.

Related

how to use http-server to expose site to public

I've set up a local site using http-server. I can access the site locally on my computer as: http://localhost:8080/myreport.html
Now I need to allow others to access the site on my machine. I provided the address to a coworker with my ip as http://192.168.56.2:8080/myreport.html but he was not able to access the site.
I checked the http-server site but was not able to find info on how to make a hosted site publicly accessible. Any idea what I might be missing here?
1/ localhost is the local domain of your computer. If you convert it, you will find 127.0.0.1.
2/ 192.168.56.2 is your private ip address. I invite you to read the wikipedia of the Private network definition.
3/ To allow access to your website, you need to know your public ip address and you need to OPEN the 80 port of your ISP.
3bis/ If your coworker is connect at your private network but he can't connect to you website with the private ip address, look if your firewall doesn't block the connections.
PS: Your question would be more relevant in the Super User community
Try this Looks like you must have a dynamic IP, so you can't access it.

NET: Implementation in C#

I have a router that runs on two VM. The second VM has IP address of 9.1.2.2
I have look IP address overview,
Private networks should use private network addresses like 192.168.x or 10.x. It is not a good idea to use a public IP address that has not been assigned to you. At this moment reverse DNS seems to say that 9.1.2.2 is unassigned but that doesn't make it safe to use.

IP Address: using program or script

A) The below statement
System.out.println(java.net.Inet4Address.getLocalHost());
shows output as myhostname/192.168.1.25
B) The http://whatismyipaddress.com/ shows below (masked):
14x.7x.2xx.x1x
Using above mentioned technique A (any language or script), how do I get the value 14x.7x.2xx.x1x that above mentioned technique B shows? Or, is it at all possible?
In other words (?), using technique A (as mentioned in original question), how I can I get the same public Ip address of my home router which is shown by technique B? If it is impossible, please explain briefly (two lines at the most) why?
Thanks
Refer to this question:Getting the 'external' IP address in Java
The computer don't know its final public address as it is not necessary for it to know. Local network IP Address is sufficient for it for the tasks. But if you want to get the public address you have to use an external service as mentions in the answers of the linked question.
I will assume that you are at your home and you have a router for connecting your several computers to the internet.
http://whatismyipaddress.com/ will show an IP address as it is visible on the global internet. This may well be the IP address of your in-home router, which exposes one address for your entire in-home network. This is your public IP address.
The script that you show will give you the IP address of your own machine, which is usually only useful on your own local network. This is a private IP address, only accessible from your local network.

Why is my IP adress different when displayed by different methods

I am new to all this, so I am sorry if the question is stupid. I am learning about networking and I want to find out IP address of my own computer.
When I try to display it through ipconfig, my router's configuration page and by simply googling, I see different IP-address
Thank you in advance for help
in ip-config it starts with 10. ...
in router's conf page 192.168.1. ...
when googling 213. ...
ipconfig will give you the address of your machine. This will be some private IP address. Your router will have two IP address - One public and one private. All machines in your local network (house probably) will talk to the router via its private address, while everything out in the Internet talk to your router via its public address.
So, ipconfig provides the address of your computer, your router's config page shows its private address, and Google will show you your router's public address.
Some terms to look up: Look up Public vs Private IP addresses and how NAT works and this will all make more sense.

Amazon AWS VPC Scenario 2: Specify the public IP address range of your network?

I am setting up a VPC on Amazon AWS using Scenario 2: VPC with Public and Private Subnets.
In the "Adding Rules to the WebServerSG Security Group" section, it specifies to set an inbound SSH rule, specifying allowed sources to be: "Your network's public IP address range".
I have an elastic IP address assigned to my NAT EC2 device. When I created my public web server (in the public subnet) I also assigned a public IP address to it (as part of the wizard). This does not appear in my elastic IP list for some reason (although I believe them to be the same thing right?). They are are not contiguous addresses.
I am not sure exactly what is supposed to happen here. Am I supposed to be able to ssh into the web server in the public subnet? Why would I specify that the only source to be able to ssh into the web server is my network's public IP address range? When I set the allowable source address to either of the public IPs, my connection is refused. Am I supposed to be SSH-ing somewhere else.
Could someone please explain to me exactly how this setup is supposed to work, in terms of how I am supposed to be SSH-ing into the instances remotely?
"Your network's public IP address range" means the network where you are -- not EC2... it refers to the public IP address or range of the computer where you're sitting now, your office network, your home network, any network where your traffic will be be coming from when you want to access the EC2 machines remotely to administer them.

Resources