Bug 1419 - dhcp server not started when sharing internet connection
Summary: dhcp server not started when sharing internet connection
Status: RESOLVED INVALID
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: x86_64 Linux
Priority: Normal minor
Target Milestone: ---
Assignee: Mageia Bug Squad
QA Contact:
URL:
Whiteboard:
Keywords: NEEDINFO, PATCH
Depends on:
Blocks:
 
Reported: 2011-05-24 21:08 CEST by Denis Prost
Modified: 2012-06-11 21:51 CEST (History)
9 users (show)

See Also:
Source RPM: dhcp
CVE:
Status comment:


Attachments
Script to start/restart dhcpd server on interface start (824 bytes, text/plain)
2012-04-24 03:34 CEST, Dave Hodgins
Details

Description Denis Prost 2011-05-24 21:08:47 CEST
Description of problem:

DHCP server is not automatically started at the end of the internet connection sharing configuration process through MCC. So the internet sharing does not work after configuration : one has to start it by hand (for example through MCC/system/services dialog) to get it working. Not very user-friendly.


Version-Release number of selected component (if applicable):

drakx-net-text-0.97-1.mga1

How reproducible:

Every time one follow the steps below.

Steps to Reproduce:

1. configure internet connection sharing on a computer that is directly connected to the internet (speedtouch USB modem for me) and that is connected to other computers through an ethernet network.

2. try to connect to internet from other computers : it does not work (the reason being that "ps ax|grep dhcp" shows no active dhcp server)

3. start dhcp server service by hand : now, other computers can access to internet.
Denis Prost 2011-05-24 21:10:47 CEST

CC: (none) => denis.prost

Comment 1 Marja Van Waes 2011-10-14 20:26:40 CEST
@ Sorry for responding so late.

Is this still a problem in current cauldron or Mageia 1 ?

Keywords: (none) => NEEDINFO
CC: (none) => marja11

Comment 2 Denis Prost 2011-10-14 20:41:24 CEST
This is a Mageia 1 problem. 
Unfortunately, I can't say about Cauldron since I want to stay with Mageia 1 to keep a stable system.
I worked around it starting dhcpd by hand when needed so, for me, there's no emergency to fix it. When Mageia 2 is out, I will perform a new test and will let you know if it's still here (just post again here to ask, if ever I was long to do it myself)
Regards,

Denis
Comment 3 Marja Van Waes 2011-10-14 21:20:28 CEST
@ Denis

Thanks for replying :)

If you encounter the same problem in Mageia 2, please put that in a seperate bug report (because it's a different version of Mageia), but it would be nice if you could give a link to this one.

Closing this bug as old

Status: NEW => RESOLVED
Resolution: (none) => OLD

Comment 4 Denis Prost 2011-10-14 21:22:51 CEST
OK Marja, I'll do it.
Comment 5 Manuel Hiebel 2011-10-16 00:31:16 CEST
Still present in mageia1 and cauldron too I think (as no commit fox that)

Keywords: NEEDINFO => (none)
Status: RESOLVED => REOPENED
Resolution: OLD => (none)
Source RPM: drakx-net-text-0.97-1.mga1.src.rpm => drakx-net
Severity: normal => minor

Marja Van Waes 2011-10-24 21:33:57 CEST

Assignee: bugsquad => mageia

Comment 6 Denis Prost 2011-12-29 00:29:53 CET
I recently performed new tests that made me find the reason for my problem :

my network is only composed with two computers, one client and one gateway linked with a simple ethernet cable. So, when the client computer is not powered on, the ethernet network appears to the gateway as if it was down, that's the reason why dhcpd refuses to start on it when I configure the internet connection sharing (ICS).

As soon as the client computer is on when configuring the ICS, dhcpd starts properly.

By the way, the same problem appears everytime I start the gateway as the client is off. dhcpd is not started at boot time and I have to start it by hand later when the client is powered on by someone else
.
It would be nice if dhcpd start could succeed even if the network appears to be down at the time it starts, so as to never have to start it later by hand. But I did not find any place in the MCC ICS configuration dialog to achieve this. Maybe this is not possible ?
Comment 7 Marja Van Waes 2012-04-21 20:13:30 CEST
Pinging, because nothing has happened with this report for more than 3 months, it still has the status NEW or REOPENED.
Comment 8 Denis Prost 2012-04-22 14:56:28 CEST
Problem is still here. As a workaround, I had to include a script in /etc/rc.local which tries to start dhcpd every few seconds until it succeeds.
Not very clean nor compatible with the beginner-friendly "all config through GUI" Mageia way.
Comment 9 Dave Hodgins 2012-04-23 23:26:35 CEST
I think the proper fix for this would be to add scripts to
/etc/sysconfig/network-scripts/ifup.d and
/etc/sysconfig/network-scripts/ifdown.d
that will start the server if /etc/sysconfig/dhcpd contains
#INTERFACES="" (i.e. it's still commented out), or
INTERFACES="" contains $1 (the interface being started).

I'll put together test scripts later today.

CC: (none) => davidwhodgins

Comment 10 Dave Hodgins 2012-04-24 03:34:51 CEST
Created attachment 2088 [details]
Script to start/restart dhcpd server on interface start

Try saving the attached script, and copying it to
/etc/sysconfig/network-scripts/ifup.d/dhcpd
then run
chmod a+x /etc/sysconfig/network-scripts/ifup.d/dhcpd

I'm not sure if this is appropriate for general usage,
but should work for your specific case.

Please test it, and report if it works for you or not.

I'll let the maintainer of dhcpd decide if it's appropriate
for general usage, or not.
Marja Van Waes 2012-04-24 07:17:16 CEST

Keywords: (none) => NEEDINFO

Comment 11 Denis Prost 2012-04-24 17:12:27 CEST
Just tested it on Mageia 1, it works, thanks !
Comment 12 Dave Hodgins 2012-04-24 21:41:46 CEST
I've updated the rpm field.

Could be bugsquad assign this bug to the maintainer of dhcp, so they can
decide if the script would be appropriate for general use?

Connecting two computers directly via an ethernet cable, rather then
using a router is a relatively rare case, and the script may cause
unneeded restarts of dhcpd on systems with multiple interfaces where
a router is used.

Source RPM: drakx-net => dhcp

Comment 13 Manuel Hiebel 2012-04-25 00:13:18 CEST
no maintainer, added the committers

Keywords: NEEDINFO => PATCH
CC: (none) => dmorganec, guillomovitch, lists.jjorge, pterjan, stewbintn, thierry.vignaud
Assignee: mageia => bugsquad

Comment 14 Guillaume Rousse 2012-04-25 10:34:16 CEST
well, using /etc/sysconfig/network-scripts/ifup.d/ is a sysinit-specific solution: it won't works with systemd. So that's a bit short-termed solution.

Anyway, the bug title is a bit misleading. According of my own (flawed) understanding, the point is that dhcpd server should be automatically restarted when any bound interfaces configuration changes, and is not specifically tied to mcc network sharing wizard. However, I can't figure why it isn't true when dhcpd is not bound to any specific interface, but listen on all available ones (aka no specific interface set in /etc/sysconfig/dhcpd).
Comment 15 Denis Prost 2012-04-25 13:47:36 CEST
in my case, dhcpd was bound to eth0, since /etc/sysconfig/dhcpd contained :
---------
OPTIONS="-q"

INTERFACES="eth0"
INTERFACES="eth0"
INTERFACES="eth0"
-------
(don't know why there were three times the same line, I never edited that file, always performed network configuration through MCC)

So the problem did not seem to be related to the fact that dhcpd was not bound to any specific interface... but the solution provided in comment #10 solved the it !
Comment 16 Pascal Terjan 2012-04-25 13:55:10 CEST
I don't really understand the problem.

Is it that dhcpd starts to fail after being setup? Because the interface is not yet correctly setup and so needs to be started later when it becomes available?
It will refuse to start if you don't have an interface up with an address in the proper range.

I think restarting it anytime an interface gets up is a bad idea. Do we really want dhcp to restart each time you get disconnected/reconnected from an unrelated interface (for example wifi)?
Comment 17 Denis Prost 2012-04-25 14:12:26 CEST
here is a short description of the problem :

my network is only composed with two computers, one client and one gateway
linked with a simple ethernet cable. So, when the client computer is not
powered on, the ethernet network appears to the gateway as if it was down,
that's probably the reason why dhcpd fails starting on the gateway though ICS is configured.

Later, when the client computer is powered on by someone, it cannot get an IP address and access to the internet, since dhcpd does not run on the gateway : I have to start dhcpd by hand to solve the problem.

the proper behaviour, to avoid this non user-friendly operation, should be :
- either that dhcpd starts automatically as soon as the client computer is powered on (i.e. as soon as the local ethernet network is up).
- or that it is able to start even if the local network is down, so that it is always running
Comment 18 Guillaume Rousse 2012-04-25 14:20:22 CEST
>So, when the client computer is not
powered on, the ethernet network appears to the gateway as if it was down
The interface status on the gateway should not depend on the presence of a peer on the network, that's your real issue. It should be up, and the dhcp server also, permanently. BTW, 'network down' is quite approximative terminology.

Also, if you have no reason to explicit restrict dhcpcd to eth0, don't do it. If MCC add uneeded crap in /etc/sysconfig/dhcpd, just remove it manually, and eventually report a bug against it.
Comment 19 Denis Prost 2012-04-25 14:35:47 CEST
Sorry for the approximative terminology, I'm just trying to explain things from the user point of view, but don't have enough knowledge to completely understand what's behind and use the right words.

Just to make sure I understand well what you say when you tell "It 'should' be up", do you mean that this is something that needs to be fixed on Mageia, or that I should fix it myself by using another local network implementation than a direct ethernet cable between my two computers (in other words, that Mageia is not supposed to support such an implementation) ?

About your last point, I'm going to clean /etc/sysconfig/dhcpd by hand and remove the restriction to eth0. If I can identify what in MCC put these three same lines it, I will report a bug.
Comment 20 Guillaume Rousse 2012-04-25 15:37:24 CEST
There is no reason your local network shouldn't work. If your network interface is properly configured, it should be automatically activated at boot time, whether the other computer is plugged or not. You can check the status with 'ifconfig eth0'.

Now, if dhcpcd doesn't start while eth0 is up, whereas also configured to be started at boot time, there is a problem in your configuration, and that's ought to be fixed.
Comment 21 Pascal Terjan 2012-04-25 15:40:18 CEST
Given that this is connected directly with a cable (and not through some switch) it is indeed expected that the interface will be down thanks to ifplugd.

I believe there is an option to ignore link status on a given interface but forgot it.
Comment 22 Guillaume Rousse 2012-04-25 15:44:16 CEST
MII_NOT_SUPPORTED=yes in ifcfg-eth0
Comment 23 Denis Prost 2012-04-25 20:31:33 CEST
you got it ! I made that change and now dhcpd starts on the gateway computer even if the client computer is powered off. Thanks !
By the way, does that option corresponds to some option somewhere in MCC ? If not, would it be harmless to alway set it by default in Mageia, so that not to have to modify the file by hand after each new Mageia fresh install ?
Comment 24 José Jorge 2012-04-25 21:20:51 CEST
(In reply to comment #23)
> By the way, does that option corresponds to some option somewhere in MCC ? If
> not, would it be harmless to always set it by default in Mageia, so that not to
> have to modify the file by hand after each new Mageia fresh install ?

This option is the wizard to configure network cards : 
connection control -> advanced -> network hotplugging.

Thinking about it, maybe it makes sense drakwizard automaticaly adds this option to the NIC dhcpd listens : it is expected to not be configured in DHCP...
Comment 25 Denis Prost 2012-04-26 15:56:22 CEST
(In reply to comment #24)
> (In reply to comment #23)
> > By the way, does that option corresponds to some option somewhere in MCC ? If
> > not, would it be harmless to always set it by default in Mageia, so that not to
> > have to modify the file by hand after each new Mageia fresh install ?
> 
> This option is the wizard to configure network cards : 
> connection control -> advanced -> network hotplugging.
> 

Thanks for the tip ! Nice to see almost everything can be configured through GUI in Mageia...
Comment 26 Marja Van Waes 2012-05-26 13:10:23 CEST
Hi,

This bug was filed against cauldron, but we do not have cauldron at the moment.

Please report whether this bug is still valid for Mageia 2.

Thanks :)

Cheers,
marja

Keywords: (none) => NEEDINFO

Comment 27 Marja Van Waes 2012-06-11 19:28:45 CEST
Ping!

It is very important for us to know whether this bug is still valid for Mageia 2 or for *current* cauldron (so from after Mageia 2 was released).

Please tell us. If you don't reply, we'll have to close this bug as old.
Comment 28 Guillaume Rousse 2012-06-11 19:39:15 CEST
Actually, that was not a bug, but an expected behaviour.

Status: REOPENED => RESOLVED
Resolution: (none) => INVALID

Comment 29 José Jorge 2012-06-11 21:51:31 CEST
Yes, I don't understand : the bug is already closed as invalid!

Note You need to log in before you can comment on or make changes to this bug.