I have a typical home internet connection with a wireless router which broadcasts a wireless signal for all the home devices to connect.
Recently I started using Linux and I heard about the idea of remotely accessing my computer. So I installed ssh server on my Linux Machine. To test the server I tried accessing the machine from inside the LAN network of my home. After finding out on the internet I found out that I need to do port forwarding on my router to allow connections to my Linux Machine.
I have a Tenda N301 Wireless Home Router. After finding instructions on the internet I configured the router to forward the port 22 to the Linux Machine which was assigned static IP Address by the router.
After setting everything up I tried to connect to the Linux Machine from outside of my LAN Network. It said there weren't any ports open on the specified IP Address. So I thought there might be a problem with the wireless router. So I directly connected the Ethernet cable from ISP to my Laptop and configured it with the ISP's configurations.
The IP address turns out to be a private IP Address assigned to me which is like 172.26.28.***. And the gateway is at the address 172.26.28.1 and the Subnet Mask was 255.255.252.0. I had to enter these details in my laptops network configuration settings.
I thought I get assigned a public IP Address by the ISP and my router uses NAT to connect all the devices at home. Even after connecting the cable directly to my laptop I had to enter a private IP Address.
I used Angry IP Scanner to scan the address from 172.26.28.0 to 172.26.28.255. After scanning I found out that the gateway given by my ISP which was 172.26.28.1 was the ISP's DNS server. And no ports are open on that address.
I tried accessing my Linux Machine from outside the network after connecting the cable directly to my Laptop but still I couldn't access it. The type of connection my router was configured to connect was a static IP connection.
I'm not able to understand why I'm assigned a private IP address even when I'm not using the router. Am I like connected to LAN inside LAN when I'm using the router. And how do I do port forwarding with such type of internet connection?
Thank You
I thought I get assigned a public IP Address by the ISP
And the answer is no?CGNAT
".