Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 481066 - net-misc/netifrc-0.1: dhcp + static address on a single interface not recognized
Summary: net-misc/netifrc-0.1: dhcp + static address on a single interface not recognized
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Robin Johnson
URL:
Whiteboard: oldnet
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-14 16:53 UTC by Klaus Kusche
Modified: 2013-08-16 14:15 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Klaus Kusche 2013-08-14 16:53:47 UTC
My /etc/conf.d/net says 
config_eth0="dhcp 192.0.2.130/28"

This used to work some time ago:
eth0 got two adresses, one dynamic from dhcp and one static 
(independent of dhcp).
That's what I want.

It no longer works: 
eth0 only gets a dhcp address, no static address.
No visible error messages, the address seems to be ignored silently.
Comment 1 William Hubbs gentoo-dev 2013-08-14 17:07:12 UTC
(In reply to Klaus Kusche from comment #0)
> My /etc/conf.d/net says 
> config_eth0="dhcp 192.0.2.130/28"

You are missing a newline. Try with it set up like this:

config_eth0="dhcp
192.0.2.130/28"
Let me know if that fixes the issue.
Comment 2 Klaus Kusche 2013-08-14 18:47:04 UTC
(In reply to William Hubbs from comment #1)
> (In reply to Klaus Kusche from comment #0)
> > My /etc/conf.d/net says 
> > config_eth0="dhcp 192.0.2.130/28"
> 
> You are missing a newline. Try with it set up like this:
> 
> config_eth0="dhcp
> 192.0.2.130/28"
> Let me know if that fixes the issue.

No, it doesn't.
It reads the address according to syslog:

Aug 14 20:40:50 lap ifplugd(eth0)[2221]: Link beat detected.
Aug 14 20:40:51 lap ifplugd(eth0)[2221]: Executing '/etc/ifplugd/ifplugd.action eth0 up'.
Aug 14 20:40:51 lap ifplugd(eth0)[2221]: client:  * Bringing up interface eth0
Aug 14 20:40:51 lap ifplugd(eth0)[2221]: client:  *   dhcp ...
Aug 14 20:40:51 lap dhcpcd[2472]: version 6.0.5 starting
...
Aug 14 20:41:02 lap dhcpcd[2472]: forked to background, child pid 2631
Aug 14 20:41:02 lap ifplugd(eth0)[2221]: client: dhcpcd[2472]: forked to background, child pid 2631
Aug 14 20:41:02 lap ifplugd(eth0)[2221]: client:  [ ok ]
Aug 14 20:41:02 lap ifplugd(eth0)[2221]: client:  *     received address 192.168.178.23/24
Aug 14 20:41:02 lap ifplugd(eth0)[2221]: client:  [ ok ]
Aug 14 20:41:02 lap ifplugd(eth0)[2221]: client:  *   192.0.2.130/28 ... [ ok ]
Aug 14 20:41:02 lap ifplugd(eth0)[2221]: client:  *   Running postup ...
Aug 14 20:41:02 lap ifplugd(eth0)[2221]: Program executed successfully.

However, it doesn't bind it to eth0:

~: ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.178.23  netmask 255.255.255.0  broadcast 192.168.178.255
        ether f0:4d:a2:43:9e:96  txqueuelen 1000  (Ethernet)
        RX packets 2235  bytes 1918305 (1.8 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2081  bytes 356967 (348.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 17  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        loop  txqueuelen 0  (Local Loopback)
        RX packets 2  bytes 100 (100.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2  bytes 100 (100.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

~:
Comment 3 Klaus Kusche 2013-08-14 18:51:38 UTC
(In reply to William Hubbs from comment #1)
> You are missing a newline. Try with it set up like this:

Space and newline both result in the same syslog and the same ifconfig.
Comment 4 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2013-08-14 20:49:04 UTC
Please show the output of 'ip addr' (from iproute2), as ifconfig doesn't display all of the info.
Comment 5 Klaus Kusche 2013-08-15 07:34:35 UTC
(In reply to Robin Johnson from comment #4)
> Please show the output of 'ip addr' (from iproute2), as ifconfig doesn't
> display all of the info.

You are correct: ifconfig's problem.
ip addr shows both addresses, netstat -r has the correct entries,
and both addresses actually work.

Since when is ifconfig broken? It used to display eth0:0 ...
Comment 6 Ben Kohler gentoo-dev 2013-08-16 13:58:33 UTC
If iproute2 is used to assign the addresses, then the old-style net alias aren't used, and you need to use iproute2 ('ip' command) to see the addresses.  If you have iproute2 installed (possibly via a dep of some other pkg), it's automatically enabled instead of ifconfig.