Skip to content

Instantly share code, notes, and snippets.

@reisjr
Created June 6, 2017 01:50
Show Gist options
  • Save reisjr/758ddc8acc823c7982eacb2b7884ade2 to your computer and use it in GitHub Desktop.
Save reisjr/758ddc8acc823c7982eacb2b7884ade2 to your computer and use it in GitHub Desktop.
EC2 Multiple IPS
#Creting network interfaces - ENIs
aws ec2 create-network-interface --subnet-id subnet-002f9xxx
aws ec2 create-network-interface --subnet-id subnet-002f9xxx
#Getting EIPs
aws ec2 allocate-address
aws ec2 allocate-address
#Associating EIPs to ENIs
aws ec2 associate-address --network-interface-id eni-xxxxxxx --allocation-id eipalloc-xxxxxxxx
aws ec2 associate-address --network-interface-id eni-xxxxxxx --allocation-id eipalloc-xxxxxxxx
#Check security groups
#Changing metric for eth1
sudo route add -net default gw 172.31.16.1 netmask 0.0.0.0 dev eth1 metric 1
#Removing default route through interface eth0
sudo route del -net default gw 172.31.16.1 netmask 0.0.0.0 dev eth0 metric 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment