~alpine/users

2 2

nic hotplug ip renewal

Details
Message ID
<trinity-ed8f70cb-ed78-46ae-859b-97e9e0487953-1732262354675@3c-app-mailcom-bs13>
DKIM signature
missing
Download raw message
Greetings,

I have this interface file:
auto lo
iface lo inet loopback

allow-hotplug vnet0
iface vnet0 inet dhcp

when vnet0 get visible, there is no ip assignment, so I wrote a script that tries to run ifup on the adapter and when it success, it bails out.
thing is, after the lease time is over (~10 hours of lease), the nic looses the ip, how can I configure the lease to be renewed when needed?
I'm using openrc and eudev on alpine 3.20.x
Details
Message ID
<20241122111939.4342e7fb@ncopa-desktop.lan>
In-Reply-To
<trinity-ed8f70cb-ed78-46ae-859b-97e9e0487953-1732262354675@3c-app-mailcom-bs13> (view parent)
DKIM signature
missing
Download raw message
On Fri, 22 Nov 2024 08:59:14 +0100
daggs <daggs@gmx.com> wrote:

> Greetings,
> 
> I have this interface file:
> auto lo
> iface lo inet loopback
> 
> allow-hotplug vnet0
> iface vnet0 inet dhcp
> 
> when vnet0 get visible, there is no ip assignment, so I wrote a script that tries to run ifup on the adapter and when it success, it bails out.
> thing is, after the lease time is over (~10 hours of lease), the nic looses the ip, how can I configure the lease to be renewed when needed?
> I'm using openrc and eudev on alpine 3.20.x

I think for this the simplest solution would be to use dhcpcd. Let
interfaces file only have lo interface and

  apk add dhcpcd && rc-update add dhcpcd boot

-nc
Details
Message ID
<trinity-bc840913-e4e2-4281-918e-058fa084a5ed-1732276841776@3c-app-mailcom-bs01>
In-Reply-To
<20241122111939.4342e7fb@ncopa-desktop.lan> (view parent)
DKIM signature
missing
Download raw message
Greetings Natanael,

> Sent: Friday, November 22, 2024 at 12:19 PM
> From: "Natanael Copa" <ncopa@alpinelinux.org>
> To: "daggs" <daggs@gmx.com>
> Cc: ~alpine/users@lists.alpinelinux.org
> Subject: Re: nic hotplug ip renewal
>
> On Fri, 22 Nov 2024 08:59:14 +0100
> daggs <daggs@gmx.com> wrote:
>
> > Greetings,
> >
> > I have this interface file:
> > auto lo
> > iface lo inet loopback
> >
> > allow-hotplug vnet0
> > iface vnet0 inet dhcp
> >
> > when vnet0 get visible, there is no ip assignment, so I wrote a script that tries to run ifup on the adapter and when it success, it bails out.
> > thing is, after the lease time is over (~10 hours of lease), the nic looses the ip, how can I configure the lease to be renewed when needed?
> > I'm using openrc and eudev on alpine 3.20.x
>
> I think for this the simplest solution would be to use dhcpcd. Let
> interfaces file only have lo interface and
>
>   apk add dhcpcd && rc-update add dhcpcd boot
>
> -nc
>

Didn't thought of adding dhcpcd as boot service, will try it.

Thanks,

Dagg
Reply to thread Export thread (mbox)