On Sat 07 Jan 2012 01:53:18 PM IST, Pandu Poluan wrote: > > On Jan 7, 2012 3:13 PM, "Nilesh Govindarajan" <cont...@nileshgr.com > <mailto:cont...@nileshgr.com>> wrote: > > > > On Sat 07 Jan 2012 01:27:45 PM IST, Nilesh Govindarajan wrote: > > > Well, the title tells the question clearly; how do I configure network > > > such that the first ip is obtained via dhcpcd and other is static? > > > config_eth0="dhcp <static>" doesn't work. > > > > > > As a solution I wrote a dhcpcd hook containing /sbin/ifconfig eth0:0 > > > <ip> netmask <netmask> > > > > > > Is there a direct way? > > > > > > > Yikes! It works now :O > > > > AFAIK dhcpcd will remove all IP addresses on an interface (i.e., all > addresses listed by 'ip addr sh dev eth0') before it sets the > interface's address using the values provided by the DHCP server. > > Thus, your configuration will work only if dhcpcd receives an address > soon enough before the static address(es) gets assigned. > > If the dynamic address assignment is delayed, then the static > addresses will be removed by dhcpcd, resulting in just one address on > the interface. > > Of course, this is pure conjecture on my part. If there's anyone more > familiar with how addresses gets assigned in Gentoo, feel free to > correct me. > > Rgds, >
The hook was working. Before I discovered it myself that using with config_eth0 it works. May be I was little sleepy or so when I tried the first time. :/ -- Nilesh Govindarajan http://nileshgr.com