# Tools for automatic connections on startup

## drudox

Hi everybody ! 

I'm using gentoo with I3 wm in a relatively new laptop , I well remember that when I use my previous laptop I had insert a line for exec on startup a networking tool

that automatically connect the system to the ethernet dhcpcd or to a known wireless that I had already used remembering its password ..

Now I don't want know which was this tools .. but I would like to know how can I obtain this behavior ... 

Thanks in advance

----------

## xaviermiller

Hi,

Nowadays, dhcpcd + wpa_supplicant can do that trick. You just have to start both services and dhcpcd will manage your networks.

----------

## potuz

I've used wpa_supplicant+dhcpcd for years but lately I caved in and finally decided to install net-misc/networkmanager. Its fingerprint is nothing compared to the usual beasts that I need to recompile everyone and then and having a curses interface (nmtui) is useful when in places that  I need to search for a network (instead of running wpa-cli  look for search results and hope that the screen doesn't scroll fast, go and edit the .conf file and so forth)

----------

## drudox

so basically how I can automatically run networkmanager ?Last edited by drudox on Fri Aug 17, 2018 12:24 pm; edited 1 time in total

----------

## potuz

 *drudox wrote:*   

> so basically how I ca automatically run networkmanager ?

 

```
#systemctl  enable NetworkManager.service 
```

----------

## drudox

no i'm using openrc .. not systemd

----------

## potuz

EDIT: It seems NM adds a service:

```
$ equery files networkmanager  | grep init

/etc/init.d

/etc/init.d/NetworkManager

```

the systemd service reads as follows:

```
 $ cat /lib/systemd/system/NetworkManager.service | grep Exec

ExecReload=/usr/bin/dbus-send --print-reply --system --type=method_call --dest=org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager.Reload uint32:0

#ExecReload=/bin/kill -HUP $MAINPID

ExecStart=/usr/sbin/NetworkManager --no-daemon

```

So I suppose adding a hook to those should work.

----------

## Jaglover

I suppose reading the Gentoo Wiki would help. No?

----------

## Fitzcarraldo

 *potuz wrote:*   

> ...having a curses interface (nmtui) is useful when in places that  I need to search for a network

 

Agreed. I like nmcli and nmtui, particularly nmtui. The latter has made life easier when a DE won't start for whatever reason and I need to connect to a network in order to install/re-install some package or other to fix something. Had to use it again just last week.

----------

