Skip to content
This repository has been archived by the owner on Jul 20, 2024. It is now read-only.

No eth1 after apply #44

Open
alex404sl opened this issue Feb 9, 2022 · 1 comment
Open

No eth1 after apply #44

alex404sl opened this issue Feb 9, 2022 · 1 comment

Comments

@alex404sl
Copy link

Hi! Thank you for the work!

But I am not be able to make this work though. The created nat instance does not have eth1.

Thanks!

module "vpc" {
  source  = "terraform-aws-modules/vpc/aws"
  name                 = "main_vpc"
  cidr                 = "10.1.0.0/16"
  azs                  = ["xxxxxxx"]
  private_subnets      = ["10.1.1.0/24"]
  public_subnets       = ["10.1.0.0/24"]
  enable_dns_hostnames = true
}


module "nat" {
  # https://registry.terraform.io/modules/int128/nat-instance/aws/latest?tab=inputs
  source  = "int128/nat-instance/aws"
  name = "nat"
  vpc_id                      = module.vpc.vpc_id
  public_subnet               = module.vpc.public_subnets[0]
  private_subnets_cidr_blocks = module.vpc.private_subnets_cidr_blocks
  private_route_table_ids     = module.vpc.private_route_table_ids
  enabled = true
}

resource "aws_eip" "nat" {
  network_interface = module.nat.eni_id
  tags = {
    "Name" = "nat-instance"
  }
}
@alex404sl
Copy link
Author

alex404sl commented Feb 9, 2022

Tried to attach the created network interface and run the systemctl start snat, got following error message:

[root@ip-10-1-0-177 bin]# systemctl status snat
● snat.service - SNAT via ENI eth1
   Loaded: loaded (/etc/systemd/system/snat.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2022-02-09 02:22:50 UTC; 15s ago
  Process: 2814 ExecStart=/opt/nat/snat.sh (code=exited, status=2)
 Main PID: 2814 (code=exited, status=2)

Feb 09 02:22:50 ip-10-1-0-177.compute.internal snat.sh[2814]: --rpm-requires
Feb 09 02:22:50 ip-10-1-0-177.compute.internal snat.sh[2814]: --restricted
Feb 09 02:22:50 ip-10-1-0-177.compute.internal snat.sh[2814]: --verbose
Feb 09 02:22:50 ip-10-1-0-177.compute.internal snat.sh[2814]: --version
Feb 09 02:22:50 ip-10-1-0-177.compute.internal snat.sh[2814]: Shell options:
Feb 09 02:22:50 ip-10-1-0-177.compute.internal snat.sh[2814]: -irsD or -c command or -O shopt_option                (invocation only)
Feb 09 02:22:50 ip-10-1-0-177.compute.internal snat.sh[2814]: -abefhkmnptuvxBCHP or -o option
Feb 09 02:22:50 ip-10-1-0-177.compute.internal systemd[1]: Failed to start SNAT via ENI eth1.
Feb 09 02:22:50 ip-10-1-0-177.compute.internal systemd[1]: Unit snat.service entered failed state.
Feb 09 02:22:50 ip-10-1-0-177.compute.internal systemd[1]: snat.service failed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant