Multiple Public IPs - Load balancer?

pothi

@127.0.0.1
Messages
1,071
Location
Srivilliputhur (TN)
ISP
BSNL - 3G
VI - LTE
Airtel - LTE/5G
Jio - 5G
BSNL 3G has been my current primary internet!

My router shows a public IP address. However, whenever I try to check my public IP using one of the (numerous) methods mentioned in How can I get my external IP address in a shell script? , I get one among a pool of four (or more) different IPs, including the public IP mentioned in the router.

For example, here's the current list of my public IPs...

117.243.16.xxx
117.242.80.xxx
117.219.206.xxx
117.202.238.xxx

Anyone else noticed this? If you have seen this, how long has BSNL been doing this?

What could be the reason for this behaviour? Is BSNL running a load balancer with multiple IPs to route traffic?

Just curious!
 
Which commands did you use?
 
If we talk about wireless, same effect also happens with Vodafone.
I believe it comes down to poor session optimization and control on provider's part.
 
Oh. I was using Vodafone until last month. Will look into it when I use it again.

@sloj I used curl -s whatismyip.akamai.com && echo. Same pattern if I use a different method such as dig +short myip.opendns.com @resolver1.opendns.com.
 
Does it change when you run the command immediately again? If so then I guess it is a session issue. Enabled hotspot on phone used BGP.Tools and checked again after a certain interval and the IP address stayed the same for me. Also used
dig TXT +short o-o.myaddr.l.google.com @ns1.google.com dig +short txt ch whoami.cloudflare @1.1.1.1
 
It changes immediately for curl based look-ups. dig based look-ups seems to stay the same. However, it differs immediately upon switching to an alternate provider. For example, executing the above two dig commands brought two different results.

I wasn't aware of cloudflare method. Thanks.
 


Just do nslookup, does that return multiple IPs in one response?
 
Thanks for your answers. As mentioned already by Lolita_Magnum , the problem is with sessions.

I want the command to show inconsistent result if there is inconsistency in the public IP or in session (as Lolita_Magnum mentioned). I don't want the command to show a single IP when my network uses multiple public IPs.

Because, I often had to take a note of my public IP to bypass HTTP basic authentication in a site. If a command shows a single IP consistently and if my browser uses a different IP to connect, I would be presented with HTTP basic auth.

So, the point is to actually show different IP if there are multiple public IPs used across sessions. So, curl works fine for me as it closes the session immediately, resulting in showing different IP when executed next time. Also, for unknown reason, dig doesn't work when connected via VPN.

@vishalrao I tried nslookup. It showed a single IP consistently like dig.
 
Last edited:
But that's what is confusing. The router gets the external public IP and session should be maintained there unless there is a network interruption.
 

Back