Skip to content

Instantly share code, notes, and snippets.

@aw
Created October 4, 2013 09:29
Show Gist options
  • Save aw/6823356 to your computer and use it in GitHub Desktop.
Save aw/6823356 to your computer and use it in GitHub Desktop.
[FIX] Amazon EC2 gateway NAT doesn't work?
# Had this crazy networking problem when trying to use an EC2 instance as a NAT gateway.
#
# Here's a fix I found buried in documentation here:
# http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_NAT_Instance.html
#
Disabling Source/Destination Checks
Each EC2 instance performs source/destination checks by default. This means that the instance must be the source or destination of any traffic it sends or receives. However, a NAT instance must be able to send and receive traffic when the source or destination is not itself. Therefore, you must disable source/destination checks on the NAT instance.
Use the following procedure to disable the SrcDestCheck attribute for a NAT instance that's either running or stopped.
To disable source/destination checking on a NAT instance
Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
Click Instances in the navigation pane.
Right-click the NAT instance, and then select Change Source / Dest Check.
For a NAT instance, this attribute should be disabled. Click Yes, Disable.
@lucaswilric
Copy link

Thanks mate. You just saved my afternoon.

@aw
Copy link
Author

aw commented Jan 14, 2015

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment