in day 30 of cloud i face any issue after doing all the configuration as expected but still got no files in s3 bucket ,
1 : scenrio ami is not in free tier so far for that i used general ami
2: all the iptables configuration for nat instance has been enable as describe in officaial documentation.
3: watch all solving vedios on yt and read every medium blog but did not work any of them.
anyone who can reachout so we can do it togegther if anyone does it recently
kindly guide me
I guess you were trying to do it via the AWS console, unlike the solution suggested by Rob which does it all from the lab terminal. As you can probably tell from the github solution, there are many steps to this problem.
To create a public subnet requires all of this
Create an Internet Gateway and associate with the VPC
Create the subnet
Create a route table for the subnet with an entry for 0.0.0.0/0 that points to the internet gateway
These steps are what makes the subnet public.
Amazon Linux 2 is deprecated and will be completely retired at the end of June (I asked Engineering to update the instructions). The default option when launching instance is now Amazon Linux 2023. This is still fine, but when configuring NAT you will also have to install iptables via yum as it isn’t on this image by default.
You must create a custom security group for the NAT instance that allows external connections or you will not be able to connect to it to configure iptables.
dears,
i did all the configuration using ui base but let what comes out a i am trying it again will update accordingly, however if noting work we may discusss it an bit althought thank for putting the issue forword regarding instruction update , thanks for time.
Hi @sherdil,
The doc has been updated, you can use it as a reference. You can perform the task via AWS console as well, however make sure you don’t miss any step.
I’m unsuccessful with the NAT instance task. Despite following the CLI guide exactly, the text file isn’t being created in S3. I’ve confirmed my NAT instance is running AL2023 and I’ve applied the iptables rules . Is there a common reason why the outbound connection from the private subnet might still be failing?
Which guide are you using? We changed the distribution used for the task to Amazon Linux 2023, and that changes how you solve the task slightly. If you set up iptables correctly for that distribution, it should work.
yes I am using Amazon Linux 2023. The guide that I used is -
Also, these are the commands that I used for iptables-
IFACE=$(ip -o route get 1.1.1.1 | awk ‘{for(i=1;i<=NF;i++) if ($i==“dev”) print $(i+1)}’)
iptables -t nat -A POSTROUTING -o “$IFACE” -j MASQUERADE
iptables -A FORWARD -i “$IFACE” -o “$IFACE” -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i “$IFACE” -o “$IFACE” -j ACCEPT
Hi, any update? i tried with NAT gateway it worked just fine, but I was unable to complete the task as it expects the route to NAT EC2 instance. Please help, so that I can move to next exercise. It won’t let me move to the next exercise.
If you follow the guide carefully, it should work. I actually used the guide as a loose framewark and did pretty much the whole thing in the console. You do need to make sure to set up the routing tables right. I also logged into the instance to create the iptables invocations – you can check ip addr to make sure that you have the right interface.