* [gentoo-user] Network configuration - Two ips one from dhcp & other static
@ 2012-01-07 7:57 Nilesh Govindarajan
2012-01-07 8:10 ` [gentoo-user] " Nilesh Govindarajan
0 siblings, 1 reply; 6+ messages in thread
From: Nilesh Govindarajan @ 2012-01-07 7:57 UTC (permalink / raw
To: Gentoo User Mailing List
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?
--
Nilesh Govindarajan
http://nileshgr.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* [gentoo-user] Re: Network configuration - Two ips one from dhcp & other static
2012-01-07 7:57 [gentoo-user] Network configuration - Two ips one from dhcp & other static Nilesh Govindarajan
@ 2012-01-07 8:10 ` Nilesh Govindarajan
2012-01-07 8:23 ` Pandu Poluan
2012-01-09 17:14 ` James
0 siblings, 2 replies; 6+ messages in thread
From: Nilesh Govindarajan @ 2012-01-07 8:10 UTC (permalink / raw
To: Gentoo User Mailing List
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
--
Nilesh Govindarajan
http://nileshgr.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-user] Re: Network configuration - Two ips one from dhcp & other static
2012-01-07 8:10 ` [gentoo-user] " Nilesh Govindarajan
@ 2012-01-07 8:23 ` Pandu Poluan
2012-01-07 8:25 ` Nilesh Govindarajan
2012-01-09 17:14 ` James
1 sibling, 1 reply; 6+ messages in thread
From: Pandu Poluan @ 2012-01-07 8:23 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1133 bytes --]
On Jan 7, 2012 3:13 PM, "Nilesh Govindarajan" <contact@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,
[-- Attachment #2: Type: text/html, Size: 1411 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-user] Re: Network configuration - Two ips one from dhcp & other static
2012-01-07 8:23 ` Pandu Poluan
@ 2012-01-07 8:25 ` Nilesh Govindarajan
0 siblings, 0 replies; 6+ messages in thread
From: Nilesh Govindarajan @ 2012-01-07 8:25 UTC (permalink / raw
To: gentoo-user
On Sat 07 Jan 2012 01:53:18 PM IST, Pandu Poluan wrote:
>
> On Jan 7, 2012 3:13 PM, "Nilesh Govindarajan" <contact@nileshgr.com
> <mailto:contact@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
^ permalink raw reply [flat|nested] 6+ messages in thread
* [gentoo-user] Re: Network configuration - Two ips one from dhcp & other static
2012-01-07 8:10 ` [gentoo-user] " Nilesh Govindarajan
2012-01-07 8:23 ` Pandu Poluan
@ 2012-01-09 17:14 ` James
2012-01-10 2:30 ` Nilesh Govindarajan
1 sibling, 1 reply; 6+ messages in thread
From: James @ 2012-01-09 17:14 UTC (permalink / raw
To: gentoo-user
Nilesh Govindarajan <contact <at> nileshgr.com> writes:
> > 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.
Did you look at /etc/conf.d/net.example for hints?
> > As a solution I wrote a dhcpcd hook containing /sbin/ifconfig eth0:0
> > <ip> netmask <netmask>
Maybe not launch your script for a few minutes (timing?) via crontab
if nothing else works?
James
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-user] Re: Network configuration - Two ips one from dhcp & other static
2012-01-09 17:14 ` James
@ 2012-01-10 2:30 ` Nilesh Govindarajan
0 siblings, 0 replies; 6+ messages in thread
From: Nilesh Govindarajan @ 2012-01-10 2:30 UTC (permalink / raw
To: gentoo-user
On Mon 09 Jan 2012 10:44:02 PM IST, James wrote:
> Nilesh Govindarajan <contact <at> nileshgr.com> writes:
>
>
>>> 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.
>
> Did you look at /etc/conf.d/net.example for hints?
>
>>> As a solution I wrote a dhcpcd hook containing /sbin/ifconfig eth0:0
>>> <ip> netmask <netmask>
>
>
> Maybe not launch your script for a few minutes (timing?) via crontab
> if nothing else works?
>
>
> James
>
>
>
>
>
I did read that. I'm pretty peculiar about reading docs, so that I
don't have to face an RTFM from the ML or IRC ;-)
The first time it didn't work properly. The second time it did. May be
I'd made some mistake or so.
--
Nilesh Govindarajan
http://nileshgr.com
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-01-10 2:31 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-07 7:57 [gentoo-user] Network configuration - Two ips one from dhcp & other static Nilesh Govindarajan
2012-01-07 8:10 ` [gentoo-user] " Nilesh Govindarajan
2012-01-07 8:23 ` Pandu Poluan
2012-01-07 8:25 ` Nilesh Govindarajan
2012-01-09 17:14 ` James
2012-01-10 2:30 ` Nilesh Govindarajan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox