0

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? – Tom Yan Dec 17 '19 at 6:23
  • 2
    Although there is no good single answer that I could use for "Close as duplicate" (most of them focusing on slightly different issues), this general situation has been discussed many times – search the site for "CGNAT". – user1686 Dec 17 '19 at 6:25
  • One option is to use some form of VPN solution to allow your machines to talk to each other such as tinc. You will need at least one machine that other machines can connect to. – David Schwartz Dec 17 '19 at 6:29
  • I guess this can be the generic thread I can close everything else with, then – user1686 Dec 17 '19 at 6:35
  • Thank You for your answers. – Shaik Mohammed Zeeshan Dec 17 '19 at 7:42
0

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.

Yes, it's kind of like that. Your ISP uses the same kind of NAT as your home router does.

This is commonly called "Carrier-grade NAT", and ISPs increasingly move their home customers to CGNAT because they're running out of IPv4 addresses, as those have become quite scarce and difficult to get in recent days. (Or perhaps because they sold the addresses they already had?)

(Though I wouldn't call it a "second LAN" – private addresses are not what defines a LAN.)

And how do I do port forwarding with such type of internet connection?

You don't.

Your options are:

  1. You can call your ISP and ask if they could issue you a dedicated public IP address. Some will do it for free, some will add an extra charge, and some will outright refuse.

  2. The short-term workaround is to use an external service which can act as a relay for you. This usually means a VPN – either self-configured on a cheap VPS (they usually have a public IP address), or through a commercial VPN provider (some of them have a plan which provides a dedicated IP and allows incoming connections).

  3. The long-term solution is to have your ISP provide IPv6 support in addition to IPv4, and hope that all your clients will also have IPv6 themselves, eventually.

  • So the public IP address i'm using is also used by all the homes in my neighborhood? – Shaik Mohammed Zeeshan Dec 17 '19 at 7:45
  • Yes, since you're behind a CGNAT and you're not able to receive incoming connections, that usually means the public IP address is shared. (Not necessarily with neighbours – it might be geographic, but it might be random homes as well.) – user1686 Dec 17 '19 at 8:01
  • So if I ask my ISP to assign a public IP will it have to get new infrastructure? – Shaik Mohammed Zeeshan Dec 17 '19 at 11:10
  • No. It should be some basic reconfiguration. – user1686 Dec 17 '19 at 11:26
  • Okay I'll contact my ISP and ask for it. – Shaik Mohammed Zeeshan Dec 17 '19 at 12:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.