Adding Multiple Interfaces to EC2 Ubuntu 12.04

Posted by nocode on Server Fault See other posts from Server Fault or by nocode
Published on 2013-10-24T15:10:56Z Indexed on 2013/10/24 15:57 UTC
Read the original article Hit count: 209

I have a m1.medium Ubuntu 12.04 instance with two ENI's. I have a VPC setup with a private and public subnet.

Private: 10.50.1.0/24
Public: 10.50.101.0/24

I initiated the instance on the private subnet. I configured a NAT instance and route all servers in the private subnet internet access. The route tables on the private subnet point towards the NAT instance and the route table on the public subnet point to the internet gateway.

I am trying to add a public interface on the machine so that I can put it behind a ELB. When I added the second ENI and configured a static IP in /etc/network/interfaces and restarted the network services, I can no longer access from the Public subnet to the Private Subnet.

Works
Private > private
Private > public

Does not work
Public > private

From Public > Private, I ran a TCPDUMp on the private machine and can see the request coming in. My guess is it's trying to route over the new Public interface instead of the Private. Here's my route:

default         10.50.1.1       0.0.0.0         UG    100    0        0 eth0
10.50.1.0       *               255.255.255.0   U     0      0        0 eth0
10.50.101.0     *               255.255.255.0   U     0      0        0 eth1

My networking knowledge is limited and I believe I have to add some routes but unsure of what command/syntax needs to be.

© Server Fault or respective owner

Related posts about amazon-ec2

Related posts about nat