Is there a way to change DHCP config in a subnet to point new instances to a different gateway?

0

I am looking for a way other than modify user data of EC2 instances or setting it up for every instance by different mechanism. Custom routing in RTB is already in place.

AWS
asked 5 months ago161 views
2 Answers
0

https://docs.aws.amazon.com/vpc/latest/userguide/DHCPOptionSet.html#ChangingDHCPOptionsofaVPC

DHCP option sets are per VPC. It sounds like your question is geared toward a per-subnet modification? "After you create a DHCP option set, you can associate it with one or more VPCs. You can associate only one DHCP option set with a VPC at a time. If you do not associate a DHCP option set with a VPC, this disables domain name resolution in the VPC."

Can the subnet in question be moved/re-created in a different VPC, as an option?

AWS
KAS
answered 5 months ago
  • But the DHCP option set does not contain default gateway. If I understand correctly - new instances coming to live in the particular subnet will always have default GW set to a particular (not configurable) address by DHCP unless modified by user data or otherwise.

0

Hello @Piotr Boetzel,

Attaching a Customized Route Table to a subnet will be the only solution that can be taken from the networking side, where you can modify the 0.0.0.0/0 to the new Default Gateway and that will affect all resources inside this subnet.

AWS
Shmosa
answered 4 months ago
  • Agree with this response. Route table using the "catch-all" 0.0.0.0/0 will define the Default G/W per subnet.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions