Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Network Fallback not Working
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
semmelb
n00b
n00b


Joined: 28 Jun 2011
Posts: 13

PostPosted: Tue Jun 28, 2011 1:48 pm    Post subject: Network Fallback not Working Reply with quote

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 (http://forums.gentoo.org/viewtopic-t-793191-highlight-fallback.html) and the
Code:
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"

#-----------------------------------------------------------------------------
# Configure DHCP
dhcpcd_eth0="-L -t 10"
config_eth0="dhcp"
# Wartezeit (default: 20sec)

#-----------------------------------------------------------------------------
# Configure Normal Network
fallback_eth0="192.168.178.222 netmask 255.255.255.0"
fallback_route_eth0="default via 192.168.178.1"

# By default we don't wait for ifplugd to configure the interface.
# If you would like it to wait so that other services now that network is up
# then you can specify a timeout here.
plug_timeout="5"
# A value of 0 means wait forever.


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:
Code:
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
Back to top
View user's profile Send private message
semmelb
n00b
n00b


Joined: 28 Jun 2011
Posts: 13

PostPosted: Wed Jun 29, 2011 8:05 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
semmelb
n00b
n00b


Joined: 28 Jun 2011
Posts: 13

PostPosted: Wed Jun 29, 2011 9:56 am    Post subject: Reply with quote

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'.
Jun 29 10:43:46 atc-usb-01 dhcpcd[7938]: sending commands to master dhcpcd process
Jun 29 10:43:46 atc-usb-01 ifplugd(eth0)[7486]: client: dhcpcd[7938]: sending commands to master dhcpcd process
Jun 29 10:43:46 atc-usb-01 dhcpcd[4246]: control command: [b]dhcpcd -L -t 10 -m 3 eth0[/b]
Jun 29 10:43:46 atc-usb-01 ifplugd(eth0)[7486]: Program executed successfully.
Jun 29 10:43:54 atc-usb-01 dhcpcd[4246]: eth0: broadcasting for a lease
Jun 29 10:44:24 atc-usb-01 dhcpcd[4246]: eth0: probing for an IPv4LL address
Jun 29 10:44:24 atc-usb-01 dhcpcd[4246]: eth0: checking for 169.254.28.244
Jun 29 10:44:28 atc-usb-01 dhcpcd[4246]: eth0: using IPv4LL address 169.254.28.244


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. :?
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?
Back to top
View user's profile Send private message
semmelb
n00b
n00b


Joined: 28 Jun 2011
Posts: 13

PostPosted: Wed Jun 29, 2011 4:12 pm    Post subject: Workaround Reply with quote

-- 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 )
Code:
emerge net-misc/dhcp


2. Creating dhclient.conf:
Code:
vi /etc/dhcp/dhclient.conf

Quote:

send dhcp-lease-time 3600;
request subnet-mask, broadcast-address, time-offset, routers,
domain-name, domain-name-servers, host-name;
require subnet-mask, domain-name-servers;

timeout 5;

lease {
interface "eth0";
fixed-address 192.168.0.1;
option subnet-mask 255.255.255.0;
option routers 192.168.0.1;
renew 2 2030/1/12 00:00:01;
rebind 2 2030/1/12 00:00:01;
expire 2 2030/1/12 00:00:01;
}


3. Configuring /etc/conf.d/net
Quote:

# default client is dhcpcd
modules="dhclient"


4. Restart your network
Code:
/etc/init.d/net.eth0 restart



Sadly the dhclient package depends on the net-tools ( ifconfig, ... )
Back to top
View user's profile Send private message
dblaci
n00b
n00b


Joined: 05 Oct 2004
Posts: 26

PostPosted: Sun Sep 15, 2013 9:19 am    Post subject: Reply with quote

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

noipv4ll

The fallback will work as expected.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum