What is my IP address?
First, let's talk seriously about Santa 😁. Every child knows he must send his present wished to "North pôle, Rainbow city". If he wants an answer, he should write his own address back of the envelope.
The same idea applies with your colleague watching cat videos on youtube : his computer knows how to find Youtube server, and Youtube server knows at which address it must send the video data.
Every device connected to Internet has an address : IP address. However, computers dream less than kids and use numbers such as 192.0.2.2 instead.
But how computers do to know a website ID address? Is there a directory ?
Yes it is. Il is called domain name, and will be explained later. 😊
One must tell the difference between private (internal) and public (external) IP.
- Private network is used behind your router.
- Public IP is used to share on world wide web.
To self-host your server, it's easier if your ISP provides static public IP. Make sure to find one.
You can get over this problem is you have an IPV6, a VPN or set up dynamic DNS, but it will be so much easier to have a static IP right away.
To know your public IP, you can use one of these links, amongst many others :ipaddress
To find private IP of a local device, your server as example, run "ifconfig". Below, we pipe it's output to grep to filter what we need:
# ifconfig | grep inet
You'll see something like this :
inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3 inet 127.0.0.1 netmask 0xff000000 inet 192.168.1.2 netmask 0xffffff00 broadcast 192.168.1.255 inet6 fe80::feaa:14ff:fe65:5f86%re0 prefixlen 64 scopeid 0x1
What does that mean ? 😲
Well look at it together 😉
- ::1 and 127.0.0.1 are links to the server itself : localhost. That's not what we're looking for.
- Addresses starting with "fe80:" et "192.168" are most of the time private IP addresses (IPv6 and IPv4).
If someone want to reach your server, he only know your public IP. The router must redirect him from the outside to your server (not to your smartphone or any other device). You must configure your router to do so. See you next page 😉.