# Network Fallback not Working

## semmelb

Hello,

since some days I try to configure my box to use a fallback address, if no dhcp server was found.

I used the following post (https://forums.gentoo.org/viewtopic-t-793191-highlight-fallback.html) and the 

```
net.example
```

from http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=blob;f=doc/net.example.Linux.in;h=952f8eb7d160074e8faa64b63d5f893878847065;hb=HEAD.

I adjusted the syntax to fit the new baselayout - openrc ( according to http://www.gentoo.org/doc/en/openrc-migration.xml ).

So my /etc/conf.d/net looks like this:

 *Quote:*   

> 
> 
> modules="dhcpcd"
> 
> #-----------------------------------------------------------------------------
> ...

 

As you can see, I am using netplugd as well.

If the box is connected to a dhcp network everything went fine and it gets an ip address.

But when I unplug the cable and connect the box to a network with no dhcp the following ip address is assigned:

```
169.254.244.49
```

This is an IP4ALL address with is being assigned if the dhcp client gets no ip address, BUT I turn this behaviour off in the configuration file:

 *Quote:*   

> 
> 
> dhcpcd_eth0="-L"
> 
> 

 

So why is this happening? How can I configure the network appropriately?

This bug drives me nuts. I tried several other dhcp client and also iproute instead of ifconfig, but nothing works.

Please help,

Matthias

----------

## semmelb

I do like to add some version information:

 kernel: 2.6.38-gentoo-r6

 openrc: 0.8.2-r1

 dhcpcd: 5.2.12

 ifconfig: 1.60_p20110409135728 ( net-tools )

 ifplugd: 0.28-r9

----------

## semmelb

So, I am digging further right now:

Looking into /var/log/messages gives the following:

 *Quote:*   

> 
> 
> Jun 29 10:43:44 atc-usb-01 ifplugd(eth0)[7486]: Link beat detected.
> 
> Jun 29 10:43:45 atc-usb-01 ifplugd(eth0)[7486]: Executing '/etc/ifplugd/ifplugd.action eth0 up'.
> ...

 

Interessing are the bold lines. The dhcpcd client is called with the commands provided in the /etc/conf.d/net,

with "-L" for IPVALL disabling. BUT 4 lines later dhcpcd tells my that it try to get an IPV4LL address.

So it looks like the "-L" is being completely ignored.   :Confused: 

OR might it be possible that the command dhcpcd -L -t 10 -m 3 eth0 is working, but the dhcpcd-client is called afterwards?

Maybe ifplugd reports the wrong status to the init script?

Any suggestions?

----------

## semmelb

-- Workaround found --

It seems to be a problem at the dhcpcd-client side.

Using dhcplient with fallback configured in dhclient.conf works.

Here is what I have done:

1. I installed the dhclient via: ( current stable version: 3.1.3_p1 )

```
emerge net-misc/dhcp
```

2. Creating dhclient.conf:

```
vi /etc/dhcp/dhclient.conf
```

 *Quote:*   

> 
> 
> send dhcp-lease-time 3600;
> 
> request subnet-mask, broadcast-address, time-offset, routers,
> ...

 

3. Configuring /etc/conf.d/net

 *Quote:*   

> 
> 
> # default client is dhcpcd
> 
> modules="dhclient"
> ...

 

4. Restart your network

```
/etc/init.d/net.eth0 restart
```

Sadly the dhclient package depends on the net-tools ( ifconfig, ... )

----------

## dblaci

put this lines at the end of /etc/dhcpcd.conf

noipv4ll

The fallback will work as expected.

----------

