Welcome, Guest. Please login or register.
Did you miss your activation email?
+  pfSense Forum
|-+  pfSense English Support» DHCP and DNS» How to configure DHCP Server to NOT assign a default gateway
Username:
Password:
 
 

Pages: [1]   Go Down
  Print  
Author Topic: How to configure DHCP Server to NOT assign a default gateway  (Read 686 times)
0 Members and 1 Guest are viewing this topic.
smanders
Newbie
*
Offline Offline

Posts: 2


View Profile
« on: January 22, 2013, 04:55:45 pm »

Hello,

I need pfsense to NOT assign a default gateway via DHCP.  I only want it to assign the IP address.  When I leave the field blank, the clients are still assigned the LAN interface's IP address as their default gateway Huh.  This introduces a problem on my dual homed machines.  I even made sure the NIC in the Windows adapter binding order had my NIC that IS assigned a default gateway first in the list.  However, connections still are functioning properly until I remove the competing default route.

I found this old thread with no resolution.  I'm running the latest version of pfsense.  Any one know?

http://forum.pfsense.org/index.php/topic,33924.msg176092.html#msg176092

Thanks,
smanders
Logged
johnpoz
Hero Member
*****
Offline Offline

Posts: 1697


View Profile
« Reply #1 on: January 23, 2013, 02:45:37 pm »

Well if you read the text by the gateway entry you will see
    
"The default is to use the IP on this interface of the firewall as the gateway. Specify an alternate gateway here if this is not the correct gateway for your network. "

So that explains why leaving it blank does what it does - mine doesn't have an entry in it. 

If you look in /var/dhcpd/etc you will see the dhcpd.conf - in there you will see the option

 option routers 192.168.1.253;

Being set - where .253 is my lan interface IP, your will be what you set in the field or if left blank your interface the dhcp server is running on IP.

The dhcp server can be configured not to hand out that info - but it would have to be changed in the pfsense code to allow for that.  Submit a request to allow the option of not handing it out.

Most people running dhcpd on pfsense would want to hand out pfsense as the gateway I would have to assume.  If you don't want your dual homed boxes to use pfsense as gateway - just setup the IP on that interface on the client as static and don't set the gateway.

I wouldn't think it too hard of a change to make.. But I doubt too many people are asking for such a feature which is why it has not been setup as an option.
Logged
Willy
Jr. Member
**
Offline Offline

Posts: 30


View Profile
« Reply #2 on: February 28, 2013, 07:14:31 am »

I have (had) a similar problem. We have a separate VLAN for VoIP with QoS settings for the VoIP VLAN. Both the normal LAN and VLAN have DHCP. Some workplaces use a softphone. On these systems we set the normal LAN and the VLAN. Both get a IP from DHCP and both networks get a GW with the same metric. The problem is that Windows now randomly decides which gateway to use and Murphy will make sure it's always the wrong one.

I changed the pfSense code myself (services.inc, xmlparse.inc and services_dhcp.php) so I can check a checkbox to disable setting the gateway for that DHCP range. Problem solved until I upgrade to a new version I guess.

I really would like to see this feature in standard pfSense.
Logged
johnpoz
Hero Member
*****
Offline Offline

Posts: 1697


View Profile
« Reply #3 on: February 28, 2013, 08:48:56 am »

Well there you go submit your change then..  I would post up details in development section, or ask there how to get started with submitting code to pfsense.
Logged
Willy
Jr. Member
**
Offline Offline

Posts: 30


View Profile
« Reply #4 on: February 28, 2013, 11:34:58 am »

Well there you go submit your change then..  I would post up details in development section, or ask there how to get started with submitting code to pfsense.

I'm afraid my "hack" will not comply to pfSense coding rules, but I'll certainly have a look at it.
Logged
johnpoz
Hero Member
*****
Offline Offline

Posts: 1697


View Profile
« Reply #5 on: February 28, 2013, 01:35:54 pm »

Im sure if your hack works, it could be tweaked to align with standards..  There are couple of changes I make upon loading a new snap.. Just been too lazy to work out the details of how to get them put into the code myself.

Someone had created a patch to get vnstat2 working, which I have to reapply on each new snap.  Also I am not a fan of the local-ttl of 1 for dnsmasq..  I just don't see the reason to have such low ttl on my dns records..  They rarely if ever change, so I change it to 86400 in the services.inc file. 

Would like to see this as option to set this to whatever you want, etc.  Just too lazy to submit the code required to make it happen Wink  I will get to it sooner or later..  But if you have worked out the changes required to give you a check box - seems you got most of the work done already..  Be a nice addition that multiple people might take advantage of.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

 

Page created in 0.027 seconds with 19 queries.