Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 121468

Summary: static ip address (alias) and dhcp at the same ethernet adapter - fails sometimes
Product: Gentoo Linux Reporter: Toralf Förster <toralf>
Component: Current packagesAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED INVALID    
Severity: minor    
Priority: High    
Version: 2005.1   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Toralf Förster gentoo-dev 2006-02-03 12:44:22 UTC
Hhm, defining
config_eth0=(
        "dhcp"
        "192.168.0.254/24"
        )
in /etc/conf.d/net works fine even if I do not have dhcp :

n22 /etc/conf.d # route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
loopback        *               255.0.0.0       U     0      0        0 lo


Whereas
config_eth0=(
        "192.168.0.254/24"
        "dhcp"
        )
does not work if I don't have dhcp:
n22 /etc/conf.d # route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
loopback        *               255.0.0.0       U     0      0        0 lo


Why is the order of the 2 definitions in /etc/conf.d/net important, meaning first trying to use dhcp and after that creating the alias eth0:1 ?
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2006-02-03 12:55:31 UTC
Why don't you use fallback?
Comment 2 Toralf Förster gentoo-dev 2006-02-05 02:59:24 UTC
I don't want at fallback solution, I want every time a static ip address ever and dhcp only if possible.
My question wasn't, how I can do that (1st solution works for me), the question is why the 2nd variant did not work. Seems to be a leak in the logic of configuring the network adapters, isn't it ?
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2006-02-05 03:01:29 UTC
(In reply to comment #2)
> My question wasn't, how I can do that (1st solution works for me), the question
> is why the 2nd variant did not work. Seems to be a leak in the logic of
> configuring the network adapters, isn't it ?

No, not at all. Once you've assigned a static IP address to a card, there's no business left for DHCP. So - the second case in your configuration doesn't make sense.