Mailinglist Archive: opensuse (5130 mails)

< Previous Next >
Re: [SLE] dhcp client .. not setting gateway and dns server
  • From: Darryl Gregorash <raven@xxxxxxxxxxxxx>
  • Date: Fri, 12 May 2006 19:36:32 -0600
  • Message-id: <44653820.5070509@xxxxxxxxxxxxx>
On 12/05/06 10:48, Peter Van Lone wrote:
> On 5/9/06, Darryl Gregorash <raven@xxxxxxxxxxxxx> wrote:
>
>> Then set DHCLIENT_DEBUG to "yes", and wait for logging information to
>> show up in the system log. Dhcpcd uses local0 as its syslog facility,
>> which by default SuSE logs to /var/log/localmessages along with the
>> other local* facilities. Supposedly local1 through local7 are used by
>> some init scripts, but I have never seen it, and no such file exists on
>> my system; however, if you want a separate file, modify
>> /etc/syslog-ng/syslog-ng.conf.in and run SuSEconfig (and restart
>> syslog-ng if SuSEconfig does not).
>
> OK, and update:
>
> I'll post updated/more information below, but first I am not sure
> where you mean for me to look. I see in the dhcpcd man file that the
> -d option turns on debugging, but I am not sure what command/seq of
> commands to use. I am also not sure where to put the "DHCLIENT_DEBUG
> to "yes"" parameter.
All of these variables are in Yast, /etc/sysconfig Editor -->
Network/DHCP/DHCP client.
>
>
> I issued this command:
>
> p02-dcs13:~ # dhcpcd -n -G 192.168.2.1 eth1
>
> hoping it would renew the lease, and then force the gateway
> information, but it did not work. Perhaps the command syntax is just
> wrong?
The syntax looks correct; however:
>
> It seems that if I do not get/have an active wireless DHCP lease, that
> when I get a lease for the wired interface (eth1) I don't get a
> default gateway. With Wireless I do. I also noticed in man file that
> by default dhcpcd uses eth0. Well, I don't have an eth0. See ifconfig
> and other output below:
I came across some remarks at the bottom of
/etc/sysconfig/network/ifcfg.template, the section titled "Multiple DHCP
clients", that are probably relevant to this problem. If the wireless
interface is always the first to be started with DHCP, then the
information received from the wired interface will never be used to set
a default gateway -- in such a case, the wireless interface is assumed
to be "authoritative". You can change this whenever you will not have a
wireless link available, but then would have to change it back when you
do have a wireless link available.

Though I have never needed to use it, this looks like a perfect example
of the kind of problem scpm (the System Configuration Profile Manager)
was designed to resolve. You can create two profiles; each profile would
define a different network card as the primary DHCP device. When you
choose the profile to use at boot, scpm will automatically make sure the
correct system files are in place. The files you need to modify are in
/etc/sysconfig/network, and contain the hardware addresses of your
network cards as part of teh filenames, eg.
ifcfg-eth-id-00:11:2f:ac:ee:ab is the name of the file for your "wired"
device. To make this device the DHCP primary, you need to add the line

DHCLIENT_PRIMARY_DEVICE=yes

to this file, and then create a profile in scpm. Move the line to the
other config file to create a profile with the wireless device as teh
primary.

I'll say again, I have not actually used scpm, so I don't know if you
can simply edit/create profile, re-edit/create new profile. You will
have to boot the system up with each profile to make sure things are
right. As for profile management, you can either use Yast or scpm from
the commandline.

> p02-dcs13:~ # route -n
> Kernel IP routing table
> Destination Gateway Genmask Flags Metric Ref
> Use Iface
> 192.168.2.0 0.0.0.0 255.255.255.0 U 0 0
> 0 eth1
> 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0
> 0 eth1
> 127.0.0.0 0.0.0.0 255.0.0.0 U 0 0
> 0 lo
Is this after you ran the dhcpcd command above? This looks like there
may be something amiss with timing during bootup; the 169.254.x.x
address is, I believe, an automatically assigned IP whenever DHCP fails.
It looks like the system is not waiting long enough for the card to be
configured, or for a DHCP reply to be received. There are several
variables (in Yast's /etc/sysconfig editor) that can be adjusted to
lengthen the wait times:

DHCLIENT_SLEEP
DHCLIENT_WAIT_AT_BOOT
WAIT_FOR_INTERFACES (this one is in network/hardware/config)

< Previous Next >