Instance IP Address

3,422 views
Skip to first unread message

Robert O'Regan

unread,
Jul 22, 2014, 5:17:52 PM7/22/14
to gce-dis...@googlegroups.com
Hi,

I've run into an issue with GCE that I wasn't expecting at all.
I have an application I run that connects to an online gambling website (Betfair) via their API.
Obviously online gambling isn't permitted in the US and as such Betfair block any API login attempts originating from US IP addresses.
 
I decided recently to move the application to a GCE instance. I created a new instance in the "europe-west" zone, copied across my application and ran through all my setup & configurations.Everything was going fine util I tried to run the application for the first time which logs in through the sites API.
I got an error message saying that login is not permitted from my zone.

After some investigation I spotted that the IP address of the instance itself is being reported as US even though my instance is based in the "europe-west" zone (which I believe is in Ireland).

Is this correct? All VM instances have US IP addresses? If so then GCE is completely useless for my application. Is there a way around this? Can I get an IP address appropriate to my location associated with my VM?

Thanks
Robert

Robert O'Regan

unread,
Jul 23, 2014, 6:22:10 AM7/23/14
to gce-dis...@googlegroups.com
Hi,

Is there anything I can configure on the instance with regards to network routing?
For example, can I configure all outbound requests to go through some proxy or something similar?
If so, how would I go about doing this?

Robert

Eran Sandler

unread,
Jul 23, 2014, 7:04:45 AM7/23/14
to Robert O'Regan, gce-discussion

Google Cloud ips can migrate between zones. That is why you might get a  IP that was originally allocated to the US.

In the networking section of the console you can configure a proxy networking to go through a single IP.

You can reserve an IP for that (I think) and hopefully would get a European one.
Is your code checking for the origin of the IP? Can you white list an IP?

Eran

--
© 2014 Google Inc. 1600 Amphitheatre Parkway, Mountain View, CA 94043
 
Email preferences: You received this email because you signed up for the Google Compute Engine Discussion Google Group (gce-dis...@googlegroups.com) to participate in discussions with other members of the Google Compute Engine community and the Google Compute Engine Team.
---
You received this message because you are subscribed to the Google Groups "gce-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gce-discussio...@googlegroups.com.
To post to this group, send email to gce-dis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gce-discussion/6f3c19fd-cb6a-4646-bc55-b5c09d9fde01%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Robert O'Regan

unread,
Jul 23, 2014, 7:11:52 AM7/23/14
to gce-dis...@googlegroups.com, roberto...@gmail.com
Hi,

Thanks for the feedback.
The problem isn't in my code as such. My application connects to an external webservice.
This webservice checks that the IP of the request is from an allowed zone.
So for example, the webservice does not allow requests from the US. So I created an instance in Europe-West but the IP of the instance still seems to be getting reported as US.

Would you know of any steps on doing what you suggested? 
I had a look but can't see any direct references to proxies and networking is not my strong point.

Robert

Eran Sandler

unread,
Jul 23, 2014, 8:02:26 AM7/23/14
to Robert O'Regan, gce-discussion
Regarding setting up proxy you can follow the documentation here:

Regarding getting a really European IP - that's a good question. I suspect that most of Google's addresses will be originally US allocated.

I would try contacting them (Googlers hangout around here as well). 

Worst case you can get a VPN account in a service such as privateinternetaccess.com and tunnel your traffic from Europe. Since Google will make sure your traffic does actually go only through Europe and the VPN server is in Europe you shouldn't have any noticeable delays.

Another option for you is to try and contact the providers of the API and ask them to whitelist your server IP address.

Eran


--
© 2014 Google Inc. 1600 Amphitheatre Parkway, Mountain View, CA 94043
 
Email preferences: You received this email because you signed up for the Google Compute Engine Discussion Google Group (gce-dis...@googlegroups.com) to participate in discussions with other members of the Google Compute Engine community and the Google Compute Engine Team.
---
You received this message because you are subscribed to the Google Groups "gce-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gce-discussio...@googlegroups.com.
To post to this group, send email to gce-dis...@googlegroups.com.

Robert O'Regan

unread,
Jul 23, 2014, 8:58:35 AM7/23/14
to gce-dis...@googlegroups.com, roberto...@gmail.com
Thanks for all the help Eran.

Gary Ling

unread,
Jul 23, 2014, 2:13:27 PM7/23/14
to gce-dis...@googlegroups.com
Hi Robert,

Thank you for posting the email. We are aware of this issue that (almost) all Google IP addresses are SWIP'ed to be Mountain View, CA. And at Google, it's not uncommon to remap a block of IPs from one location to another, especially given the elasticity of IP addresses for the Cloud. Too bad that many of external Geo IP services solely depend on SWIP database. While we are evaluating what we can do to help our customers, your best bet in my opinion is contacting your API provider and explore options they may offer now.

Thanks.

Gary Ling
Product Manager
Google Cloud Platform

Robert O'Regan

unread,
Jul 24, 2014, 4:57:00 AM7/24/14
to gce-dis...@googlegroups.com
Hi Gary,

Thanks for the reply. 
Can I infer that entire range that my IP is in has been re-allocated to European servers?
My API provider sent on the following link to the third party GeoIP they use...


I can request to have a range of IP's reviewed for location. 
Does anyone know if this generally works? i.e. would I have much success and any idea of how long the process would take?

I'm going to have to make a call fairly quickly on whether or not to keep my instance up as it is already costing me due to application downtime.

Just on the subject of GeoIP companies. It seems a fairly flaky system. 
Is there no centralised system that can be updated when a company changes the zone their IP's are deployed in?

Thanks
Robert

Gary Ling

unread,
Jul 24, 2014, 5:32:14 PM7/24/14
to gce-dis...@googlegroups.com
Hi Robert,

I am glad there is a viable option here for you. I took a quick look at maxmind.com and it appears they accept an exact IP as input. Please go ahead and enter your IP to the request form. If that fails, then try entering /24.

As for your question about GeoIP companies, some are better than others. And also, since IPs do get relocated, even the best companies may not be up to date all the time.

Hope it helps. Thanks.
Gary Ling

Frederick Green

unread,
Feb 26, 2015, 6:02:29 AM2/26/15
to gce-dis...@googlegroups.com
Hi Robert, I have exactly the same problem as you regarding connecting to betfair.

How did you resolve the problem in the end?  

Did maxmind work?



Fred

Steven Hillson

unread,
Jul 30, 2017, 11:29:06 PM7/30/17
to gce-discussion
Just found this from a while back and having the exact same issue. Did anyone ever find a proper solution to this?

Robert O'Regan

unread,
Jul 31, 2017, 6:11:48 AM7/31/17
to gce-discussion
Hey Steven,

What do you mean by "proper"?
Are you using Betfair (or similar) too?

If so then this is the solution as far as I am aware.
They block (at least they used to) on IP addresses so you need to make sure that the region your IP is associated with isn't on their blacklist.
I'm not sure there are many other solutions other than the usual messy things like VPN's etc... (which may not even work)

Robert

Steven Hillson

unread,
Jul 31, 2017, 6:28:24 AM7/31/17
to gce-discussion
Basically I want to have an always on bot running on betfair. However, if all google cloud ip addresses appear to be in the states then it looks like I'm just going to have to go with another provider. Just wondering whether anyone had found a way to do it with google as I would prefer to use their platform

Robert O'Regan

unread,
Jul 31, 2017, 7:11:17 AM7/31/17
to gce-discussion
Hey,

So I have an always on Betfair bot that has been running fine since I fixed the IP issue.
There are a couple of things though here.

Not all Google IP addresses are necessarily tied to the US. When I was looking into this issue I was told that Google (and other providers) have blocks of IP addresses that they may allocate to different regions. They can and do move them around and re-provision them. So in theory you could get an IP from Google that is tied to another geographic region. Not sure if you can influence this though.

Also, theres nothing to say that you try to setup with AWS and they may give you an IP address that is tied to the US too. So you could just as easily have the exact same issue with a different provider. I'm not sure if AWS for example guarantee that the IP addresses they allocate in their EU data centers are registered in the EU - maybe they do.

When I was having the issue Betfair told me they use Maxmind. Theres a tool here to check IP's...


Have to say. I found dealing with Maxmind to be fine. They took about a week to update their databases though and Betfair only periodically update their copy of the Maxmind database.

Robert

Steven Hillson

unread,
Jul 31, 2017, 7:40:38 AM7/31/17
to gce-discussion
Ok thanks Robert

I think I'll start looking at smaller more local hosting companies that are based in the UK without offices abroad. That way I suspect all their IPs will be "based" in the uk. 

Thanks for your help!

ABDULSALAM AYINLA

unread,
Apr 30, 2018, 9:23:32 AM4/30/18
to gce-discussion
Hi, 

I also develop betfair applications i previously ran into this and i have since used AWS but now its different :) betfair won't block your ip and the ip comes up as europe now :)  
 
 

Roman G

unread,
Jan 6, 2019, 7:26:19 PM1/6/19
to gce-discussion
Did anyone find any good UK based hosting companies that work? 
Were you able to select a UK geolocation of the IP address with AWS?

Paul Nash

unread,
Jan 16, 2019, 3:40:35 AM1/16/19
to Roman G, gce-discussion
Probably not the right forum to discuss competitors to Google Cloud, so I'd suggest you consider other forums if that's what you wish to discuss.

That said, I'll point out that the original premise is not really how IP addresses work. IP addresses are not physical items, they don't have physical "locations." Google's IP addresses are all reported to ARIN as belonging to Google, which is a US company. We use our IPs efficiently, and that means sometimes we assign them to route to server endpoints that are in one country, and sometimes another. In fact some of our IPs can be globally routed to wherever the closest Google network Point of Presence is, and so are "in" many countries at the same time. In Google Cloud, any customer can access this global routing optimization via Load Balancers. What the ARIN database or another geolocation dataset says doesn't really reflect where the server(s) might be that requests to those IPs are being routed to.

--
© 2018 Google Inc. 1600 Amphitheatre Parkway, Mountain View, CA 94043

 
Email preferences: You received this email because you signed up for the Google Compute Engine Discussion Google Group (gce-dis...@googlegroups.com) to participate in discussions with other members of the Google Compute Engine community and the Google Compute Engine Team.
---
You received this message because you are subscribed to the Google Groups "gce-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gce-discussio...@googlegroups.com.
To post to this group, send email to gce-dis...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--

Paul R. Nash | Group Product Manager, Compute Engine | paul...@google.com | 206-876-1620

Robert O'Regan

unread,
Jan 16, 2019, 4:11:18 AM1/16/19
to gce-discussion
I'd say this might be more of a coincidence. The reason (at least historically) that Betfair used IP address location was due to certain jurisdictions essentially outlawing online gambling - like most of the US. Betfair themselves don't have a license to operate in these areas. Hence they block by your geographic location. afaik the law is still in place so they likely still block IP's (or have come up with another method if not)

Muhammad Ebaduddin

unread,
Jan 16, 2019, 4:54:07 PM1/16/19
to gce-discussion
It is important to note that entire IP block in GCP is owned by Google so most likely you will find that the IPs provided in GCP are registered in the US due to Google being headquartered in the US. Although the IP may register as under US on the geo lookup records, the IP address itself is assigned from the nearest data center location in that zone, In this case within Europe. You can confirm this by spinning up instances in the US and in Europe and ping each other. The instance which is geographically furthest away will have the longest ping time and latency. You can find more information on our Data center locations at the following link [1]. I agree with Paul that what the ARIN database or another geolocation dataset says doesn't really reflect where the server(s) might be that requests to those IPs are being routed to.

[1] Google Data Centers: 

Pieter Cooreman

unread,
Mar 6, 2019, 9:28:10 AM3/6/19
to gce-discussion
Hi, i face a similar problem. I selected a Europe-based (Belgium) VM during setup, but I now notice it's most likely US based. I can tell from the load speed of my websites. My IP is 35.195.70.82

It's a shame, because Google has a datacenter in Belgium: https://www.google.com/about/datacenters/inside/locations/st-ghislain/

I have no clue where to start fixing this but cancelling my server and migrate all websites to another host... Any suggestions other than that?

Robert O'Regan

unread,
Mar 6, 2019, 12:36:22 PM3/6/19
to gce-discussion
Hi Pieter,

I doubt GCP would give you an instance in a region other than what you specified.
The region the IP is associated (recorded against) can sometimes be different to the physical data center location. But the instance would be exactly where you requested it I would imagine. 
This might suggest some issues with the VM itself or the apps deployed on it.

Robert

Pieter Cooreman

unread,
Mar 7, 2019, 3:19:08 PM3/7/19
to gce-discussion
Hello Robert. Thank you for getting back to me.

There are no issues with the server as such. I barely run any service other than some flat html websites. It looks more like a connectivity issue. I will look into the netwerk adapter settings. 

Thanks again, Pieter

Pieter Cooreman

unread,
Mar 7, 2019, 3:19:08 PM3/7/19
to gce-discussion
a little update: the zone for my vm is europe-west1-b. According to Google that is St-Ghilain, Belgium. 

i now found some geo-locators that locate my vm in Switzerland... 

On Wednesday, March 6, 2019 at 6:36:22 PM UTC+1, Robert O'Regan wrote:

DNG

unread,
Mar 12, 2019, 7:40:26 PM3/12/19
to gce-discussion
Hi,

I tried creating a lot of different areas but when I checked IP, it displayed the current location as China.
How to fix this problem.

Thanks.

Robert O'Regan

unread,
Mar 14, 2019, 10:35:13 AM3/14/19
to gce-discussion
What should the location be and how are you looking up the location now?
For example, when I had this issue I was using the Maxmind GeoIP database.
This is not reliable. The geographic location an IP is actually used in can change and Maxmind need to update their own databases to reflect this.
That at least was my issue

Leo Leung

unread,
Oct 14, 2019, 12:54:17 PM10/14/19
to gce-discussion
I have the same situation. I created a vm instances in Hong Kong asia-east2-a region but when I check my ip on whoer.net it says I am in Taiwan instead. 
Is there any way to fix this problem?

Thanks!

Alexandre Duval-Cid

unread,
Oct 14, 2019, 6:10:43 PM10/14/19
to gce-dis...@googlegroups.com
Hello,

As mentioned by my colleagues, Googles IP blocks are bought and registered at one of the offices locations. The VMs physical hardware is located at the chosen location in your respective GCP projects. the geo lookup records might not match the desired zone but the IP address itself is assigned from the nearest data center location in that zone [1].
Reply all
Reply to author
Forward
0 new messages