0

I have a Linux box that serves as a DHCP, DNS (via pihole-FTL) and WireGuard servers. I wanted to make the VPN network reachable from the network that device is on. After some research I found option 121 of DHCP, and after consulting the manpages, I added that option to pihole-FTL's config. After then refreshing the DHCP lease, the route was added on the client, as I expected. However, the default gateway stopped being advertised, and the client could not reach the internet.

Config before:
On the server:

$ rg dhcp-option /etc/dnsmasq.d/
/etc/dnsmasq.d/02-pihole-dhcp.conf
7:dhcp-option=option:router,192.168.1.1

And client after a DHCP refresh:

$ ip r
default via 192.168.1.1 dev enp3s0 proto dhcp src 192.168.1.223 metric 1002 
192.168.1.0/24 dev enp3s0 proto dhcp scope link src 192.168.1.223 metric 1002

Config after:
Server:

$ rg dhcp-option /etc/dnsmasq.d/
/etc/dnsmasq.d/02-pihole-dhcp.conf
7:dhcp-option=option:router,192.168.1.1

/etc/dnsmasq.d/03-dhcp-route-wireguard.conf
2:dhcp-option=121,192.168.2.0/24,192.168.1.4

Client after a refresh:

$ ip r
192.168.1.0/24 dev enp3s0 proto dhcp scope link src 192.168.1.223 metric 1002 
192.168.2.0/24 via 192.168.1.4 dev enp3s0 proto dhcp src 192.168.1.223 metric 1002

I was going off of this answer, but even though my configuration matches what is shown there, it does not work as I would expect.

1 Answer 1

0

The configuration was correct. However, the DHCP client (dhcpcd -n) I was using to get new leases was not working properly and static routes were overwriting the default one. After getting a new lease through NetworkManager, both routes exist on one device.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .