# [SOLVED]NetworkManager: can't connect using dhcp.

## alexcortes

Hello Fellows!

I am having issues to use dhcp with NetworkManager. It simple does not work. There is "setting network address" thing then fail. On some rarelly times works...

I did not touch on the configuration files assuming it should be handled by NetworkManager. I tested with dhcpcd instead dhclient and it worked.

 *Quote:*   

> 
> 
> Portage 2.3.0 (python 3.4.4-final-0, default/linux/amd64/13.0/desktop/plasma, gcc-5.4.0, glibc-2.23-r2, 4.6.4-gentoo x86_64)
> 
> =================================================================
> ...

 

Thanks!Last edited by alexcortes on Wed Jul 20, 2016 5:50 am; edited 1 time in total

----------

## Fitzcarraldo

Did you specify dhclient in NetworkManager.conf? In my case, for example:

```
clevow230ss ~ # cat /etc/NetworkManager/NetworkManager.conf 

[main]

plugins=keyfile

rc-manager=none

dhcp=dhclient

no-auto-default=*

[keyfile]

hostname=clevow230ss
```

Below is how NetworkManager is installed in my case:

```
clevow230ss ~ # eix -I net-misc/networkmanager

[I] net-misc/networkmanager

     Available versions:  1.0.12-r1 ~1.2.2 {bluetooth connection-sharing consolekit +dhclient dhcpcd gnutls +introspection +modemmanager ncurses +nss +ppp resolvconf selinux systemd teamd test vala +wext +wifi zeroconf ABI_MIPS="n32 n64 o32" ABI_PPC="32 64" ABI_S390="32 64" ABI_X86="32 64 x32" KERNEL="linux"}

     Installed versions:  1.0.12-r1(10:55:59 18/04/16)(bluetooth consolekit dhclient introspection modemmanager ncurses nss ppp wext wifi zeroconf -connection-sharing -dhcpcd -gnutls -resolvconf -selinux -systemd -teamd -test -vala ABI_MIPS="-n32 -n64 -o32" ABI_PPC="-32 -64" ABI_S390="-32 -64" ABI_X86="64 -32 -x32" KERNEL="linux")

     Homepage:            https://wiki.gnome.org/Projects/NetworkManager

     Description:         A set of co-operative tools that make networking simple and straightforward
```

----------

## alexcortes

 *Fitzcarraldo wrote:*   

> Did you specify dhclient in NetworkManager.conf? In my case, for example:
> 
> ```
> clevow230ss ~ # cat /etc/NetworkManager/NetworkManager.conf 
> 
> ...

 

@Fitzcarraldo

I don't ever have a /etc/NetworkManager/NetworkManager.conf file.

I barely use dhcp, so I never bored to look at this issue.

I will try now.

----------

## alexcortes

Creating /etc/NetworkManager/NetworkManager.conf won't help either.   :Mad: 

----------

## alexcortes

I tried running dhclient manually:

 *Quote:*   

> irs_resconf_load failed: 30.
> 
> Unable to set resolver from resolv.conf; startup continuing but DDNS support may be affected
> 
> /sbin/dhclient-script: line 152: /bin/ifconfig: Permission denied
> ...

 

I found something here.

EDIT: downgrading it does not helped.

----------

## UberLord

 *Quote:*   

> I tested with dhcpcd instead dhclient and it worked. 

 

Silly question I know ..... if dhcpcd works why not stay with dhcpcd?

----------

## alexcortes

 *UberLord wrote:*   

>  *Quote:*   I tested with dhcpcd instead dhclient and it worked.  
> 
> Silly question I know ..... if dhcpcd works why not stay with dhcpcd?

 

I am trying to stay with defaults flags as possible. If I will need to install/use dhcpcd I will ditch NetworkManager in favor of /etc/init.d/net.XXX way.   :Very Happy: 

Thanks.

----------

## UberLord

The dhcpcd "way" is not init.d/net.* ..... It is just dhcpcd  :Smile: 

----------

## alexcortes

Yes, but I still need to connect with static address, I barely use dhcp, to not say rarely.

Basically a connect using  ethernet with static address, and use dhcp on wireless when I need it for some reason.

----------

## UberLord

And you can configure that... It's all document ed in dhcpcd.conf(5)

----------

## alexcortes

 *UberLord wrote:*   

> And you can configure that... It's all document ed in dhcpcd.conf(5)

 

Thanks, I will take a look there!   :Surprised: 

----------

## alexcortes

At the end NetworkManager worked very well with the internal dhcp. I am still considering move on dhcpcd.

Thanks!

----------

