How to configure DHCP Server to NOT assign a default gateway
-
There isn't a feature request for it that I've seen, but I have seen at least one other person ask for it. In order to not break anyone's existing installs, another option or keyword would need to be added.
So either:
1. A checkbox to suppress sending a gateway
or
2. Entering the word "none" into the gateway box will prevent the gateway from being supplied to clients. -
Hello,
Old topic bu if it can help :
I manage to disable the default gateway assignment by DHCP server by setting the network address as default gateway.
For example I have a network 192.168.1.0/24, I set 192.168.1.0 as the default gateway.pfsense accepts it but as the route is invalid it will not be used by the client.
It is a bite dirty but I hope it helps. ;)
gdo35
-
I know it's 8 years later. However as I'm running into this issue still I've created a ticket: https://redmine.pfsense.org/issues/11927
Should be an easy and quick fix. -
Already fixed... Says so right in the box where you set a gateway.
"Type "none" for no gateway assignment."
-
This post is deleted! -
Ah I figured out the confusion. There is indeed the option for "none" on the main config. It's not available however on the static mappings (although the interface is otherwise the same) where I need it.
-
I would have to test it - but bet dollar to donuts none works there too, and just the text not updated there..
-
I'm afraid a virtual donut just got a bite ;-)
This is the validation error:
Thanks for taking the time to look at this!
-
I would alter the redmine you put in to a feature request for the none that works on normal pool, to work on reservations then.
Other option, set non on the pool - and set the ones you want for reservations to whatever it is you want bit it pfsense IP or something else.
Personally if your not going to set a gateway, prob just easier to set the IP and maybe dns static on the device itself other than setting a reservation for it.
Other solution if you don't want something with a reservation going anywhere, just set the gateway to 127.0.0.1 ;) It take that - and that client isn't going anywhere with that set.
-
@sixfive7 - Yes this is an old thread, but I want to share what I just configured because it worked for me in 2.5.2-RELEASE.
As commented by Marcos Mendoza on your readmine ticket:
https://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xhtml Router aka Gateway is DHCP option 3. You can override what's sent under Additional BOOTP/DHCP Options by specifying an empty string for option 3. I don't see this as necessitating a specific GUI option given that there may be edge cases for many more DHCP options that get sent by default.
I can confirm that adding DHCP Option with the following config worked as intended:
Number: 3
Type: IP address or host
Value: noneOn my windows server host, this network interface was assigned an IPv4 Address, IPv4 Subnet Mask, IPv4 DHCP Server, IPv4 DNS Server, and IPv4 Default Gateway is blank.
-
@elgranjeff - Thank you for this. It's been quite some time since your post, but this just helped me to solve a similar issue here.
For anyone else reading this: You have to type "none" (i.e., the word, without quotes) into the value field. If you enter no value, pfSense will not throw an immediate error on the GUI, but the dhcp server will not start again, as can be seen from the dhcp log.
-
@highc I'm glad to hear it helped you! Also, thanks for clarifying that a person needs to type the word "none" without quotes—good catch!