Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removing an interface does not remove the dhcp entry #3382

Closed
hboetes opened this issue Apr 3, 2019 · 5 comments
Closed

removing an interface does not remove the dhcp entry #3382

hboetes opened this issue Apr 3, 2019 · 5 comments
Assignees
Labels
bug

Comments

@hboetes
Copy link

@hboetes hboetes commented Apr 3, 2019

So the error is: "DHCP Server is currently enabled. Cannot enable the DHCP Relay service while the DHCP Server is enabled on any interface."

Well it's not enabled.

After googling that I found this: https://forum.netgate.com/topic/42997/can-t-enable-dhcp-relay

So I made a config backup and searched for dhcp and found:

  <dhcpd>                                                                                                                                                                                                                                                      
    <lan>                                                                                                                                                                                                                                                      
      <range>                                                                                                                                                                                                                                                  
        <from>10.10.10.10</from>                                                                                                                                                                                                                               
        <to>10.10.10.245</to>                                                                                                                                                                                                                                  
      </range>                                                                                                                                                                                                                                                 
    </lan>                                                                                                                                                                                                                                                     
    <opt2>                                                                                                                                                                                                                                                     
      <enable>1</enable>                                                                                                                                                                                                                                       
      <gateway>10.10.30.1</gateway>                                                                                                                                                                                                                            
      <domain>guest-lan</domain>                                                                                                                                                                                                                              
      <ddnsdomainalgorithm>hmac-md5</ddnsdomainalgorithm>                                                                                                                                                                                                      
      <numberoptions/>                                                                                                                                                                                                                                         
      <range>                                                                                                                                                                                                                                                  
        <from>10.10.30.100</from>                                                                                                                                                                                                                              
        <to>10.10.30.200</to>                                                                                                                                                                                                                                  
      </range>                                                                                                                                                                                                                                                 
      <dnsserver>1.1.1.1</dnsserver>                                                                                                                                                                                                                           
      <dnsserver>8.8.8.8</dnsserver>                                                                                                                                                                                                                           
    </opt2>                                                                                                                                                                                                                                                    
    <opt3>                                                                                                                                                                                                                                                     
      <ddnsdomainalgorithm>hmac-md5</ddnsdomainalgorithm>                                                                                                                                                                                                      
      <numberoptions/>                                                                                                                                                                                                                                         
      <range>                                                                                                                                                                                                                                                  
        <from>10.10.40.10</from>                                                                                                                                                                                                                               
        <to>10.10.40.240</to>                                                                                                                                                                                                                                  
      </range>                                                                                                                                                                                                                                                 
      <dnsserver>10.10.10.11</dnsserver>                                                                                                                                                                                                                       
      <dnsserver>10.10.10.12</dnsserver>                                                                                                                                                                                                                       
    </opt3>                                                                                                                                                                                                                                                    
    <opt5>                                                                                                                                                                                                                                                     
      <ddnsdomainalgorithm>hmac-md5</ddnsdomainalgorithm>                                                                                                                                                                                                      
      <numberoptions>                                                                                                                                                                                                                                          
        <item/>                                                                                                                                                                                                                                                
      </numberoptions>                                                                                                                                                                                                                                         
      <range>                                                                                                                                                                                                                                                  
        <from>172.16.6.200</from>                                                                                                                                                                                                                              
        <to>172.16.6.250</to>                                                                                                                                                                                                                                  
      </range>                                                                                                                                                                                                                                                 
      <winsserver/>                                                                                                                                                                                                                                            
      <dnsserver/>                                                                                                                                                                                                                                             
      <ntpserver/>                                                                                                                                                                                                                                             
    </opt5>                                                                                                                                                                                                                                                    
  </dhcpd>

That opt2 config with the enabled dhcp entry is from an old removed interface. So apparently removing an interface does not remove the dhcp entry and after that you can't remove the matching dhcp entry.
I tried working around the issue by enabling dhcp on another interface and then removing it again. Still the same entry remains.

After downloading the config and editing it, as mentioned in the linked URL, the problem was gone.

@AdSchellevis AdSchellevis self-assigned this Apr 3, 2019
@AdSchellevis AdSchellevis added the bug label Apr 3, 2019
@AdSchellevis

This comment has been minimized.

Copy link
Member

@AdSchellevis AdSchellevis commented Apr 3, 2019

3df9968 should fix the issue (validate if interface is active and dhcpd is enabled).

@fichtner

This comment has been minimized.

Copy link
Member

@fichtner fichtner commented Apr 3, 2019

the same is probably true for dhcpv6 as well

@AdSchellevis

This comment has been minimized.

Copy link
Member

@AdSchellevis AdSchellevis commented Apr 3, 2019

missed the IPv6 page, I'll check.

@hboetes

This comment has been minimized.

Copy link
Author

@hboetes hboetes commented Apr 3, 2019

Wouldn't it be nice to remove the DHCP configuration for an interface after removing the interface?

@AdSchellevis

This comment has been minimized.

Copy link
Member

@AdSchellevis AdSchellevis commented Apr 3, 2019

We don't have a mechanism in place to clean those sections, it would be confusing if we do this in some sections for some components. I rather keep it like it is now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.