SIP和EC2弹性IP地址 [英] SIP and EC2 elastic IPs

查看:176
本文介绍了SIP和EC2弹性IP地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想做出一个EC2实例定制SIP软件方面的工作。我此刻的软件不具备NAT处理能力,我想知道如果我能得到它与相关的EC2实例的公共(弹性)IP透明地工作。

I'm trying to make a custom SIP software work on an EC2 instance. My software at the moment doesn't have NAT handling capabilities, and I was wondering If I could get it to work transparently with the public (elastic) IP associated to the EC2 instance.

下面是iconfig -a我的EC2中运行的输出:

Here's the output of "iconfig -a" run on my EC2 box:

eth0的链接ENCAP:以太网的HWaddr XXXXXX
INET地址:私有IP地址的BCAST:10.48.195.255面膜:255.255.254.0
INET6地址:XXXXXX / 64范围:链接
UP BROADCAST RUNNING MULTICAST MTU:1500跃点数:1
RX数据包:3825错误:0下跌:0超支:0框架:0
TX数据包:3596错误:0下跌:0超支:0载波:0
碰撞:0 txqueuelen:1000
RX字节:259666(253.5昆明植物研究所)德克萨斯州字节:1106872(1.0兆),

eth0 Link encap:Ethernet HWaddr XXXXXX
inet addr: PRIVATE-IP-ADDRESS Bcast:10.48.195.255 Mask:255.255.254.0
inet6 addr: XXXXXX/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3825 errors:0 dropped:0 overruns:0 frame:0
TX packets:3596 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:259666 (253.5 KiB) TX bytes:1106872 (1.0 MiB)

罗链接ENCAP:本地回环
INET地址:127.0.0.1子网掩码:255.0.0.0
INET6地址::: 1/128范围:主机
UP跑loopback MTU:16436跃点数:1
RX数据包:78错误:0下跌:0超支:0框架:0
TX包:78错误:0下跌:0超支:0载波:0
碰撞:0 txqueuelen:0
RX字节数:6892(6.7昆明植物研究所)德克萨斯州字节:6892(6.7昆明植物研究所)的

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:78 errors:0 dropped:0 overruns:0 frame:0
TX packets:78 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:6892 (6.7 KiB) TX bytes:6892 (6.7 KiB)

有没有办法来改变这种让自己的应用程序都可以透明地开放对公众(弹性)IP地址UDP套接字?而基本的工作,如果在公共IP通常被指派为eth0。

Is there a way to change this so that my application can transparently open a UDP socket on the PUBLIC (elastic) IP address? And basically work as if the public IP was normally assigned to eth0.

我想过用iptables的DNAT / SNAT或手动添加的IP地址,但没有成功为止。

I thought about using iptables DNAT/SNAT or adding the IP address manually, but no success so far.

推荐答案

解答的https://forums.aws .amazon.com /

弹性IP地址映射到使用1实例:1 NAT。实例本身并不知道公共地址。由于这个地址不能与接口绑定的,我怕你将需要处理它以另一种方式。你会想避免更改网络配置,因为它可能会导致连接丢失。

The Elastic IP address is mapped to the instance using 1:1 NAT. The instance itself is not aware of the public address. As this address can't be bound to the interface, I'm afraid you will need to handle it in another way. You will want to avoid changing the network configuration as it might result in loss of connectivity.

这篇关于SIP和EC2弹性IP地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆