# gentoo netplug

## josephg

i would like to use sys-apps/netplug because i have a very simple requirement, and i don't need a bazooka. all i need is to start/stop net.wlan0. i've found some relevant but v.old posts.

https://forums.gentoo.org/viewtopic-p-3010054.html#3010054

 *UberLord wrote:*   

> netplug is smaller and lighter
> 
> ifplugd is more feature rich, but heavier and some of it's "advanced" features don't actually work.

 

https://forums.gentoo.org/viewtopic-p-7069304.html#7069304

 *trs79 wrote:*   

> I haven't been able to find out much from Google/Gentoo wikis, but I've emerged netplug and nothing seems to happen when I plug/unplug an ethernet cable.
> 
> Also, I noticed there isn't any netplug script in /etc/init.d, I'm wondering how the daemon should be started then? I've invoked it manually, via netplud -F, which starts a process for eth0, but nothing shows up when I plug/unplug an interace.

 

.. which seems to be my exact situation. if i manually start it, netplugd detects my interface correctly. but that's all it does. it does not seem to release/acquire dhcp lease, when the interface goes down/up.

i followed the instructions on this post, as i couldn't find any other instructions on the wiki or elsewhere.

 *khayyam wrote:*   

> all you need do is add it to the 'modules' handling the particular interface eg:
> 
> /etc/conf.d/net
> 
> ```
> ...

 

there is also this post

 *depontius wrote:*   

> In general, baselayout will "do the right thing" when you simply install netplug or ifplugd.  As mentioned, I use netplug (the lighter-weight of the two) simply to get rid of the dhcp timeout when my system isn't connected to any network.  No configuration was needed.  I'm not even sure that it's necessary to add net.eth0 to the default runlevel.

 

```
$ man netplugd

..

 /etc/rc.d/init.d/netplugd

             The init(8) script that starts, stops, and displays status of the netplugd daemon.
```

init.d/netplugd init script mentioned in the man page is not installed by sys-apps/netplug, or i can't find it.

```
$ qlist sys-apps/netplug

/sbin/netplugd

/usr/share/man/man8/netplugd.8.bz2

/usr/share/doc/netplug-1.2.9.2-r1/ChangeLog

/usr/share/doc/netplug-1.2.9.2-r1/TODO.bz2

/usr/share/doc/netplug-1.2.9.2-r1/README.bz2

/usr/share/doc/netplug-1.2.9.2-r1/NEWS.bz2

/etc/netplug.d/netplug

/etc/netplug/netplugd.conf
```

gentoo networking seems to be working fine, except when my link goes down and up later.

----------

## UberLord

The man page is referring to a an init script for distros other than Gentoo.

I can't help beyond that though as I no longer have a use for netplug and no longer maintain OpenRC.

But dhcpcd supports carrier detection fine. If your goal is to have a small DHCP client react to carrier events, just bypass the Gentoo networking entirely and add dhcpcd to the default runlevel.

----------

## josephg

 *UberLord wrote:*   

> dhcpcd supports carrier detection fine. If your goal is to have a small DHCP client react to carrier events, just bypass the Gentoo networking entirely and add dhcpcd to the default runlevel.

 

thanks but dhcpcd is bloatware for my needs. udhcpc is ample and sufficient. i like em small  :Wink: 

i also like gentoo netifrc, and i have my network services dependent on net. all i do is /etc/init.d/net.${IFACE} restart and i can see all my services restarting. neat!

----------

## UberLord

 *josephg wrote:*   

> 
> 
> thanks but dhcpcd is bloatware for my needs. udhcpc is ample and sufficient. i like em small 
> 
> 

 

How small do you want to go?

I can reduce dhcpcd to a similar feature set of udhcpc at about 80k on i386 NetBSD. Probably about 90k on Gentoo because glibc lacks a few things NetBSD libc provides.

That still gives you link detection and dhcp option customisation.

 *Quote:*   

> i also like gentoo netifrc, and i have my network services dependent on net. all i do is /etc/init.d/net.${IFACE} restart and i can see all my services restarting. neat!

 

No that is not neat.

Network facing application should be able to react to addresses being added/removed and address states changing without having to be restarted.

----------

