Firestarter can't start DHCP-server

Bug #43784 reported by Martin Jormedal
42
This bug affects 8 people
Affects Status Importance Assigned to Milestone
firestarter (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

After setting up firestarter to allow internet-sharing with a DHCP-server it is unable to start said server and gives an error saying something to the effect of "Failed to start firewall, unknown error". If one starts the DHCP-server manually (/etc/init.d/dhcp3-server start) internet-sharing works fine.

Revision history for this message
LarryGrover (lgrover) wrote :

I encountered this bug today. The problem lies in lines 112-121 of /etc/firestarter/firestarter.sh:

        if [ -e /etc/init.d/dhcpd ]; then
                /etc/init.d/dhcpd restart > /dev/null
        else
                /usr/sbin/dhcpd 2> /dev/null
        fi

        if [ $? -ne 0 ]; then
                echo Failed to start DHCP server
                exit 200
        fi

If you have the dhcp3-server package installed, there is no file at either:
/etc/init.d/dhcpd
or:
/usr/sbin/dhcpd
...so the script fails to start a dhcpd server, and exits.

Changing both instances of "/etc/init.d/dhcpd" to "/etc/init.d/dhcp3-server" allows the firestarter.sh script to work as expected.

Revision history for this message
RichardNeill (ubuntu-richardneill) wrote :

By default (on Edgy), firestarter is schizophrenic!

 * It edits the config file for dhcpd3.conf
 * BUT it tries to run the executable dhcpd.

The workaround:

1)Install dhcpd3
2) cd /usr/sbin; ln -s dhcpd3 dhcpd

Result: Internet connection sharing does NOT work.

Revision history for this message
Roman Polach (rpolach) wrote :

I have dhcp3-server and firestarter installed
Changing both occurences of "/etc/init.d/dhcpd" to "/etc/init.d/dhcp3-server"
in 112-121 of /etc/firestarter/firestarter.sh did not solve this problem for me..
I still get:
Failed to start the firewall
An Unknown error occured

Also "ln -s /etc/init.d/dhcp3-server /etc/init.d/dhcpd" did not help

Revision history for this message
Reinhard Tartler (siretart) wrote :

forwarded from ubuntu-motu:

From: "sca.le" <email address hidden>
Subject: firestarter
Date: Fri, 23 Mar 2007 22:48:59 +0100

im a feisty tester, i have found an error.

Firestarter gives an error if LAN DHCP server is activated. I found that it would suffice to create a symlink to fix this:
sudo ln /usr/sbin/dhcpd3 /usr/sbin/dhcpd
Since dhcpd3 is the new version of the dhcpd and with this symlink all works fine, it would be nice if you will upgrade Firestarter to support the new version of dhcp

thz for everything.

Revision history for this message
Antonio Censi (accensi) wrote :

firestart.sh is generated by the firestart application. The generated code, as listed above, checks for dhcp3-server or for dhcpd.

Even if dhcp package is installed, the test in firestarter.sh fails because service name in init.d is not dhcpd but only dhcp.

If dhcpd is started directly it fails because it will miss the interfaces list to check, defined in /etc/default and will for all interfaces,

Correction should be done in source code, by maintainer or upstream, to address the correct service names used in Ubuntu Feisty.

In the meantime, work-around listed above linking the the service names, dhcp3-server or dhcp to dhcpd.

Revision history for this message
Rob Davies (rob-notts) wrote :
Download full text (3.4 KiB)

New to Ubuntu, but experienced sys admin but firestarter totally confused me for a bit. This Bug report was very useful in finding a solution, so thanks to all who commented previously.

First I ran the wizard to install and continually was got the ghastly MS style message in a pop-up :

    Failed to start the firewall

    An unknown error occured.

    Please check your network settings and make sure you internet connection is active.

With iptables --list showed it's rules were actually OK, and my net settings were up and active.

At that point, I had no DHCP server installed, but knew I needed one; and though the tool was broke, the rules were actually quite reasonable.

There's actually 2 problems related to DHCP dameon :

1) As described previously, firestarter doesn't know the real service name in init.d, nor is it able to report any sensible error output from it's attempt to start up DHCP service, nor does it fail gracefully if no DHCP daemon is installed.

2) Configuration file error, generating dhcpd.conf

Installing dhcp DHCP V2 server first, using firestarter's /etc/dhcpd.conf, and then dhcp3-server and configuring /etc/dhcp3/dhcpd.conf manually, I noticed an error in the /etc/dhcpd.conf produced for the DHCP V2 server, dhcp, and /etc/dhcp3/dhcpd.conf file which are identical and written out in duplicate by firestarter:

# DHCP configuration generated by Firestarter

subnet 10.5.5.0 netmask 255.255.255.0 {
        option routers 10.5.5.5;
        option subnet-mask 255.255.255.0;
        option domain-name-servers 194.168.4.100, 194.168.8.100;
        option ip-forwarding off;
        range dynamic-bootp 192.168.0.100 192.168.0.254; !!!! Wrong Network
        default-lease-time 21600;
        max-lease-time 43200;
}

This is probably an artefact of a developer's network setting. So I fixed that up and got DHCP dhcp3-server started by hand :

***************
*** 106,108 ****
--- 106,119 ----
  # range 10.0.29.10 10.0.29.230;
  # }
  #}
+
+ #
+ # DHCP configuration generated by Firestarter
+ #
+
+ subnet 10.5.5.0 netmask 255.255.255.0 {
+ option routers 10.5.5.5;
+ option subnet-mask 255.255.255.0;
+ option domain-name-servers 194.168.4.100 194.168.8.100;
+ range 10.5.5.190 10.5.5.199;
+ }

All of a sudden firestarter was able to start & stop the firewall, as described by initial bug report. But then a crash with "Active Connections" showing, you can be left with empty netfilter rules in the kernel without realising it, whilst initially the firestarter rules remained in situ no matter what.

With broken config file and making the symlink, you get the same error explaining why "polach" reports failure on symlink work round. I think in Wizard it's perfectly possible for someone to accidentally have firestarter attempt to configure and start DHCP service unkowingly and then be triply confused later, as they debug their policy.

As you should install firewall first, and then your services; firestarter would be better served not trying to be too clever, but requesting the completed config file name, and daemon name in /etc/init.d to activate DHCP support (by relaxing ...

Read more...

Daniel T Chen (crimsun)
Changed in firestarter:
status: New → Confirmed
Revision history for this message
Martin (martin-wetterstedt) wrote :

Not fixed yet? Is there a concise solution?

Revision history for this message
Jack Wasey (jackwasey) wrote :

network manager, for all its flaws, can now replace firestarter, if you don't want the firewall part. n.b. you must also install dnsmasq-base otherwise the connection sharing doesn't work.

if you also want firewall, try ufw, and it's gui sibling.

Revision history for this message
otakuj462 (otakuj462) wrote :

Confirmed on 8.04. This is an old bug. I'm surprised it hasn't been fixed.

Revision history for this message
RichardNeill (ubuntu-richardneill) wrote :

I got bitten by this on Jaunty. It seems to be necessary to run:

# ln -s /etc/dhcp3/dhcpd.conf /etc/dhcpd.conf
# ln -s /usr/sbin/dhcpd3 /usr/sbin/dhcpd

Revision history for this message
Daniel Santibáñez Polanco (dansanti) wrote :

in jaunty work fine, but on karmic fail again...

Revision history for this message
Jackson Williams (jackson-r-williams) wrote :

On Ubuntu 9.10, after installing firestarter and dhcp3-server the "Enable DHCP for local network" option was grayed out, as though I didn't have dhcp installed. Running:

# ln -s /etc/dhcp3/dhcpd.conf /etc/dhcpd.conf
# ln -s /usr/sbin/dhcpd3 /usr/sbin/dhcpd

fixed this. Thanks RichardNeill.

Revision history for this message
burivoy (burivoy) wrote :

The same thing for 10.04 Lucid Lynx, what the fuck??????

Revision history for this message
sdowney717 (sdowney717) wrote :

Still happening in 12.04 for me.
Cant start DHCP
https://picasaweb.google.com/lh/photo/Sr38bI4TVOSKY6WFO0wGLtMTjNZETYmyPJy0liipFm0?feat=directlink

WHAT is the fix plaease tell me.
The linky thing will make it work?
I do NOT have dhcp-3 installed, so editing some shell file wont help me.

Revision history for this message
sdowney717 (sdowney717) wrote :

Do I have to install dhcp3 server, then run the link command??

seems odd, I dont want to brake everything...

Is there some other firewall that I can make this work, gufw, did not work.

Revision history for this message
sdowney717 (sdowney717) wrote :
Revision history for this message
Phillip Susi (psusi) wrote :

This package has been removed from Ubuntu. Closing all related bugs.

Changed in firestarter (Ubuntu):
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.