<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Manoj</title>
    <description>The latest articles on DEV Community by Manoj (@manulithic).</description>
    <link>https://dev.to/manulithic</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3330085%2Ffa0795ce-0867-405b-9530-171fa7352fa7.png</url>
      <title>DEV Community: Manoj</title>
      <link>https://dev.to/manulithic</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/manulithic"/>
    <language>en</language>
    <item>
      <title>The Mystery of 3/3 Checks on EC2—Solved</title>
      <dc:creator>Manoj</dc:creator>
      <pubDate>Thu, 18 Sep 2025 08:24:12 +0000</pubDate>
      <link>https://dev.to/manulithic/the-mystery-of-33-checks-on-ec2-solved-1blc</link>
      <guid>https://dev.to/manulithic/the-mystery-of-33-checks-on-ec2-solved-1blc</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiw5479kmsdexdru7pz4f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiw5479kmsdexdru7pz4f.png" alt=" " width="800" height="533"&gt;&lt;/a&gt;Most engineers who’ve worked with AWS Cloud will have launched an EC2 instance (a virtual machine). But only a few of them really know what the “3/3 checks passed” message on the console actually means.&lt;/p&gt;

&lt;p&gt;This post explains what these status checks are, why they matter, and what you should do if one of them fails. This is also something that might come up in an cloud interview question 👀.&lt;/p&gt;

&lt;p&gt;When an instance is launched or started, AWS runs three types of status checks:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;System Status Check&lt;/li&gt;
&lt;li&gt;Instance Status Check&lt;/li&gt;
&lt;li&gt;Instance Reachability Check
Let’s go through each in detail.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;1. System Status Check&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;✅ What it checks: The AWS infrastructure hosting your instance — hardware, networking, and power.&lt;br&gt;
⚠️ If it fails: It’s AWS’s problem. This status check is most unlikely to fail among the three.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Stop &amp;amp; start your instance (it will migrate to a new host).&lt;/li&gt;
&lt;li&gt;If the issue persists, you should probably speak to aws support team through raising a support ticket.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;2. Instance Status Check&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;✅ What it checks: Your instance’s operating system( kernel, boot process, responsiveness).&lt;br&gt;
⚠️ If it fails: That’s your responsibility.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Check system logs in the EC2 console.&lt;/li&gt;
&lt;li&gt;Use EC2 Serial Console or SSM Session Manager if SSH/RDP isn’t working.&lt;/li&gt;
&lt;li&gt;Fix issues like kernel panics, misconfigured filesystems, or firewall lockouts.&lt;/li&gt;
&lt;li&gt;Reboot after fixing.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;3. Reachability Check&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;✅ What it checks: Whether the instance is accessible over the network (SSH, RDP, or service ports).&lt;br&gt;
⚠️ If it fails: Likely a config issue, it’s again our responsibility.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Check security group rules and NACLs(basically you will have to check whether you have created the instance in right subnet with right routes)&lt;/li&gt;
&lt;li&gt;Confirm route tables &amp;amp; internet gateway for public subnets.&lt;/li&gt;
&lt;li&gt;Verify the instance firewall (ufw, iptables, Windows Firewall).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Think of it this way - if your EC2 instance passes all three checks, it’s like your VM just cleared a cloud-level health checkup. Green lights all the way means you can focus on building, not babysitting.&lt;/p&gt;

&lt;p&gt;Until next time, Saiyonara. 👋&lt;/p&gt;

</description>
      <category>aws</category>
      <category>linux</category>
      <category>cloud</category>
      <category>cloudcomputing</category>
    </item>
    <item>
      <title>When Private DNS Just Won’t Resolve: Debugging VPC-to-Hosted Zone Issues in AWS</title>
      <dc:creator>Manoj</dc:creator>
      <pubDate>Wed, 23 Jul 2025 16:51:38 +0000</pubDate>
      <link>https://dev.to/manulithic/when-private-dns-just-wont-resolve-debugging-vpc-to-hosted-zone-issues-in-aws-45j2</link>
      <guid>https://dev.to/manulithic/when-private-dns-just-wont-resolve-debugging-vpc-to-hosted-zone-issues-in-aws-45j2</guid>
      <description>&lt;p&gt;If you’ve worked with AWS VPCs and Route 53, I bet you’ve used or at least come across Private Hosted Zones. They’re incredibly useful when you want to create internal-only DNS records like resolving db.internal to an internal IP.&lt;/p&gt;

&lt;p&gt;But what happens when your EC2 instance refuses to resolve the domain, even though everything seems to be wired up correctly?&lt;/p&gt;

&lt;p&gt;That’s exactly what I faced recently, and this post is a quick walkthrough of what went wrong and how to fix it.&lt;/p&gt;

&lt;p&gt;🔍 The Problem&lt;/p&gt;

&lt;p&gt;I had:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A Private Hosted Zone in Route 53 (say, myinternal.local)&lt;/li&gt;
&lt;li&gt;A VPC attached to that hosted zone&lt;/li&gt;
&lt;li&gt;An EC2 instance launched inside that VPC&lt;/li&gt;
&lt;li&gt;DNS record like api.myinternal.local created in the zone
But inside the EC2 instance:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ping api.myinternal.local
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It gave me:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ping: unknown host api.myinternal.local
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;⚙️ Root Cause (What Was Missing)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;After debugging, the issue boiled down to two missing or misconfigured pieces:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;DNS Hostnames or DNS Support Disabled&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If your VPC doesn't have DNS resolution and DNS hostnames enabled, the private DNS resolution will silently fail.&lt;/p&gt;

&lt;p&gt;You can check and fix this from the VPC → Actions → Edit DNS Resolution/Hostnames in the AWS Console or use the CLI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws ec2 modify-vpc-attribute --vpc-id vpc-xxxxxx --enable-dns-support "{\"Value\":true}" aws ec2 modify-vpc-attribute --vpc-id vpc-xxxxxx --enable-dns-hostnames "{\"Value\":true}"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Instance Launched in Wrong Subnet or VPC&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Make sure your EC2 instance is in the same VPC that’s attached to the private hosted zone.&lt;/p&gt;

&lt;p&gt;Route 53 private hosted zones don’t resolve from any instance — they only resolve from the specific VPC(s) they're associated with.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🧪 How I Debugged It&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here's how I approached the problem:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Tested with dig and nslookup:&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dig api.myinternal.local
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This gave me no answer section, confirming DNS resolution was failing completely.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Verified /etc/resolv.conf on the EC2 instance:&lt;br&gt;
It was using AmazonProvidedDNS (i.e., .2 address), so the default resolver was correct.&lt;/p&gt;

&lt;p&gt;Checked VPC settings:&lt;br&gt;
DNS support and DNS hostnames were disabled by default on this VPC.&lt;/p&gt;

&lt;p&gt;Re-enabled those flags and restarted networking on the EC2 instance:&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; sudo systemctl restart network
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;DNS resolution magically started working.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>dns</category>
      <category>vpc</category>
      <category>hostedzone</category>
      <category>aws</category>
    </item>
    <item>
      <title>check this out</title>
      <dc:creator>Manoj</dc:creator>
      <pubDate>Fri, 18 Jul 2025 08:38:12 +0000</pubDate>
      <link>https://dev.to/manulithic/check-this-out-2k9h</link>
      <guid>https://dev.to/manulithic/check-this-out-2k9h</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/manulithic/aws-network-firewall-a-devops-guide-in-simple-words-ok4" class="crayons-story__hidden-navigation-link"&gt;AWS Network Firewall: A DevOps Guide in Simple Words&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/manulithic" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3330085%2Ffa0795ce-0867-405b-9530-171fa7352fa7.png" alt="manulithic profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/manulithic" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Manoj
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Manoj
                
              
              &lt;div id="story-author-preview-content-2690340" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/manulithic" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3330085%2Ffa0795ce-0867-405b-9530-171fa7352fa7.png" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Manoj&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/manulithic/aws-network-firewall-a-devops-guide-in-simple-words-ok4" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Jul 15 '25&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/manulithic/aws-network-firewall-a-devops-guide-in-simple-words-ok4" id="article-link-2690340"&gt;
          AWS Network Firewall: A DevOps Guide in Simple Words
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/aws"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;aws&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/devops"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;devops&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/network"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;network&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/security"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;security&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/manulithic/aws-network-firewall-a-devops-guide-in-simple-words-ok4" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;1&lt;span class="hidden s:inline"&gt; reaction&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/manulithic/aws-network-firewall-a-devops-guide-in-simple-words-ok4#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              &lt;span class="hidden s:inline"&gt;Add Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            2 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>aws</category>
      <category>devops</category>
      <category>network</category>
      <category>security</category>
    </item>
    <item>
      <title>AWS Network Firewall: A DevOps Guide in Simple Words</title>
      <dc:creator>Manoj</dc:creator>
      <pubDate>Tue, 15 Jul 2025 12:05:48 +0000</pubDate>
      <link>https://dev.to/manulithic/aws-network-firewall-a-devops-guide-in-simple-words-ok4</link>
      <guid>https://dev.to/manulithic/aws-network-firewall-a-devops-guide-in-simple-words-ok4</guid>
      <description>&lt;p&gt;I bet most of you who’ve worked on AWS even a little, chances are you’ve built a VPC — added subnets, configured route tables, attached internet gateways, and locked things down with network access control lists and security groups.&lt;/p&gt;

&lt;p&gt;But there comes a moment when you realise that security groups and NACLs aren’t enough. Maybe an application is reaching out to sketchy IPs. Maybe you need to block traffic to specific IP addresses, or log every packet leaving your VPC. That’s where AWS Network Firewall comes into the picture — and to be honest, not enough people use it to its full potential. In this article, I’ll walk you through what it is and why it’s required.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is AWS Network Firewall?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AWS Network Firewall is a managed firewall service that helps you control network traffic at a much more granular level that security groups and NACLs.&lt;/p&gt;

&lt;p&gt;To help you understand better, think like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Security Groups: Act like a bouncer at EC2 level&lt;/li&gt;
&lt;li&gt;NACL: Watch traffic at subnet border&lt;/li&gt;
&lt;li&gt;Network Firewall: It is a smart customisable checkpoint inside your VPC for deep inspection, filtering and rule-based control&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;And the best part? You don’t have to manage infrastructure. AWS will do all the necessary weight lifting for you.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What Can It Do?&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Block/Allow/Alert traffic based on IP, Port and Protocol.&lt;/li&gt;
&lt;li&gt;Detect and stop traffic to known bad/malicious IPs.&lt;/li&gt;
&lt;li&gt;Block access to an entire country/countries.&lt;/li&gt;
&lt;li&gt;Log and analyse traffic using VPC Flow Logs, Cloudwatch or S3.&lt;/li&gt;
&lt;li&gt;Integrate with Suiracata rules ( an open source threat detection engine).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Why Use IT?&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Block outbound traffic to malicious IPs&lt;/li&gt;
&lt;li&gt;Ensure your app(s) only connect to approved APIs / IPs / Domains&lt;/li&gt;
&lt;li&gt;Monitor for unusual connection patterns&lt;/li&gt;
&lt;li&gt;You can use suricata rules to detect intrusion attempts( for example: unauthorised sql access attempt, unauthorised access to exploit port to name a few)&lt;/li&gt;
&lt;li&gt;We all know this kind of control is hard to build using only NACL/Security Group.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Basic Setup Overview&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a firewall policy: Define what should be allowed/blocked.&lt;/li&gt;
&lt;li&gt;Add rule groups- like: stateless (quick filters) and stateful (connection aware, deeper checks)&lt;/li&gt;
&lt;li&gt;Create a firewall - attach rule groups and firewall policy to your firewall, attach the firewall to your vpc&lt;/li&gt;
&lt;li&gt;Configure routing: Traffic must flow through firewall (typically via a dedicated subnet)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Thanks for reading! If you’re using Network Firewall or curious about understanding it better, hit reply — happy to discuss or write a follow up post.&lt;/p&gt;

&lt;p&gt;cheers&lt;/p&gt;

</description>
      <category>aws</category>
      <category>devops</category>
      <category>network</category>
      <category>security</category>
    </item>
    <item>
      <title>Custom AMI without cloud-init? Here's how it broke my EC2-Instance</title>
      <dc:creator>Manoj</dc:creator>
      <pubDate>Mon, 07 Jul 2025 08:49:11 +0000</pubDate>
      <link>https://dev.to/manulithic/custom-ami-without-cloud-init-heres-how-it-broke-my-ec2-instance-3olk</link>
      <guid>https://dev.to/manulithic/custom-ami-without-cloud-init-heres-how-it-broke-my-ec2-instance-3olk</guid>
      <description>&lt;p&gt;So here's a quick post on something that cost me a good bit of time.&lt;/p&gt;

&lt;p&gt;I had launched an EC2 instance from a custom AMI, and right after the boot it started failing EC2 instance reachability checks. The instance was running, but I couldn't SSH into it. So I checked system logs via EC2 console and found this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;network: Bringing up interface ens5: ERROR : [/etc/sysconfig/network-script/ifup-eth] Device ens5 has different MAC address than expected, ignoring&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;what actually happened?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I had created an AMI from a running instance without cloud-init installed. So the image had the original MAC address hardcoded in /etc/sysconfig/network-scripts/ifcfg-ens5. When I launched a new ec2 instance from this AMI, AWS assigned a new MAC address to the network interface but the OS was still looking at the old one. It was a classic mismatch and therefore network failed to initialise, and so did the reachability check.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How I debugged it?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Since I couldn't SSH into the instance, here's what i did:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Stopped the instance, detached it's root volume and attached it another working instance in same availability zone as a secondary volume(e.g., /dev/xvdf).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Mounted the volume to a temporary directory:&lt;br&gt;
&lt;code&gt;sudo mkdir /mnt/temp&lt;/code&gt;&lt;br&gt;
&lt;code&gt;sudo mount /dev/xvdf1 /mnt/temp&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Edit the network config file and delete the line with HWADDR compeletely.&lt;br&gt;
&lt;code&gt;vi /mnt/temp/etc/sysconfig/&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Unmounted the volume, detached it and attached back to original instance as root volume and started it. &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Hurray! I was able to connect succeessfully&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to prevent this from happening?&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Install cloud-init before creating your custom AMI&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>aws</category>
      <category>ec2</category>
      <category>devops</category>
      <category>cloud</category>
    </item>
  </channel>
</rss>
