How do I use Pihole's DHCP server on a specified interface that is connected to my virtual machine?

For the virtual machine in VirtualBox, my Pihole server has two adapters set. One is a NAT. The other is Host-only adapter (with no DHCP as I want Pihole to manage DHCP).

How can I bind Pihole's DHCP server with the given Host-Only adapter interface?

This is my set up:

My Pihole server (and DHCP server)

CLIENT SETUP:

RESULT

Pihole's DHCP server hands out an IP address to client:

Able to ping DHCP server:

Not able to ping any remote server, or anything that is blacklisted (like doubleclick.net):

Try dig or nslookup instead of ping?

This is all I am getting:

For some reason, nothing is able to reach the Internet. I'm definitely getting a remote IP resolved.

The interesting thing is if I went into the network manager GUI and set the method to 'Shared to other computers,' the client would get an IP address offered to it and the client could go online. But since that uses dnsmasq as PiHole does, the two would conflict. So, that wouldn't work.

Also, I changed the client's DNS from manual to auto and it got 192.168.2.1. And I am able to get this now (it's also how I got the above result too):

So, it seems like I can get a response from the PiHole in terms of what's black listed now. I just can't seem to ping any remote servers like google.ca as shown:

image

But I am able to resolve to an IP address now. It's just that the ping stays frozen. No ttl. Nothing.

I figured out my issue. AFTER. A. LONG. GRUELING. EFFORT. IP forwarding. That was missing.
This saved my sanity at last: https://www.linode.com/docs/guides/linux-router-and-ip-forwarding/

No duh it was IP forwarding; considering I want to turn this VM into a router for my other client machines. Now after 3 days or more trying to figure this out, I feel like such a moron. :dizzy_face:

And to make those IPtables persistent, gotta Install IPtables Persistent by running apt install iptables-persistent

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.