Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have my AWS EC2 setup in different regions, say one in Oregon, and another one in Ireland.

I want to send a UDP message from Oregon to Ireland.

What IP address should I use in this case?

I have both private IP addresses and public IP addresses for Oregon and Ireland.

My system is ubuntu 12.04 64bit.

I know that within EC2 network, we can use private IP address, for example, two instances/servers in Oregon. But how do we deal with two instances in different regions?

Can anyone help?


share|improve this question

Answer is that you won't be able to access those machines with their private IPs. You need to go with public IP only.

The reason for the same is, that I believe in AWS/ec2, it's all about the network blocks/subnets.

So, one data center will have the block of address which they assign, and well the same will be the case with other data center. So you might have same private IP in both the data center. That's why you can't use the private IP to communicate with different data centers.

So, U won't be able to access those instances with their private IPs. For that you need to go with the Public IP, which you already said you have with your public IP/.

Hope this helped.

share|improve this answer
Thanks for the reply. I know that private IP won't work. So, I use public IP. I can ping public IP of one instance (instance X) in Oregon from the other instance (instance Y) in Ireland, but I failed in sending UDP messages from instance X to instance Y. I don't know why I succeed in pinging from different regions, but fail in sending UDP messages. (assuming my port is correct, and not be blocked.) – daniexia Dec 4 '12 at 8:43
Though I believe you already did that but still would like to confirm, whether you opened up the specific port for UDP in the security groups section. You need to open that up specifically for UDP protocol. – GeekRide Dec 4 '12 at 9:04
Yeah. I opened that port up for UDP 0-65535 for both instances. But still, the UDP message cannot be delivered to the other instance in different region. I already succeed in delivering UDP from within EC2 network (same region). What will possibly the problem? – daniexia Dec 4 '12 at 9:28
May be you sud try using netcat (nc) command from your source node to verify whether you are really able to send the UDP packet. Something like this: # nc -u dst_ip port – GeekRide Dec 4 '12 at 10:00
thanks. it should be that my code has some bug in it. there should be no problem in sending UDP messages via public IP – daniexia Dec 4 '12 at 19:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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