I am running Ubuntu on a Amazon EC2 Server. I have a Public IP Address (52.38.20.76
).
I am unable to bind the public IP address to UDP Port:
udp listen 52.38.20.76:3478: Cannot assign requested address
So, I am trying to change ifconfig to show the Public IP Address instead of the Private IP Address. However, the network changes I have tried have not worked.
Edit /etc/network/interfaces.d/eth0.cfg
# The primary network interface
auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
address 52.38.20.76
netmask 255.255.255.0
gateway 172.31.32.1
dns-nameservers 8.8.8.8 8.8.4.4
The Gateway, I based on the results of a route -n
command:
Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 172.31.32.1 0.0.0.0 UG 0 0 0 eth0 172.31.32.0 0.0.0.0 255.255.240.0 U 0 0 0 eth0
Current ifconfig settings:
eth0 Link encap:Ethernet HWaddr 06:01:36:ee:0f:0d inet addr:172.31.47.199 Bcast:172.31.47.255 Mask:255.255.240.0 inet6 addr: fe80::401:36ff:feee:f0d/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:9001 Metric:1 RX packets:8169768 errors:0 dropped:0 overruns:0 frame:0 TX packets:8126026 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:6143591550 (6.1 GB) TX bytes:6277418496 (6.2 GB)
FYI, the Static IP Address (52.38.20.76
) is done using Amazon's Elastic IP address.
Anyone have a suggestion on how to change add the Public IP Address to the interfaces?