Using an EC2 instance as a remote DHCP server


Hello, I need to solve this problem for my bachelor thesis. I want to run ubuntu ami on EC2 and use it as a remote DHCP server. This has to be within the free tier so I can't use elastic IPs and also NAT. I'm running Ubuntu 22.04 LTS with public IPv4 assigned and an access security group configured. Should I use EC2 public IPv4 address as default gateway when configuring DHCP? In theory it should work with the configured ip helper address from the remote router (my local router). Do I need to worry about AWS because they only route unicast? If you have any advice I will be grateful. Thank you very much for any answers.

2 Answers

You can use an Elastic IP if you want, as it's free to have one associated with your instance. You're only charged for >1 on an instance or for ones that are unassociated.

answered a year ago
  • I didn't know that. I assigned public IP within creation of instance. Also, I'll be using only 1 instance so I will not use that elastic IP's potential. Or is there any advantage by using that elastic IP?

  • The purpose of an Elastic IP is to get a public IP address that doesn't change on instance restart. If you're relying on the instance having a specific IP because something else is referring to it, then use an Elastic IP.


When you configure the DHCP server on your EC2 instance, you can use the EC2 instance's public IPv4 address as the default gateway. This should work with the configured IP helper address from your local router.

note 1 : such configurations are not recommended

note 2: You do not need to worry about AWS only routing unicast, as DHCP requests and responses are unicast messages.

profile picture
answered a year ago
  • I know it's not recommended, but in my case it must be free so i cant use any utility to secure that connection, I can use only security group to set some rules, for example inbound/outbound rule only for my local router's public IP.

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