Usando dhcpcd para redefinir a interface definida manualmente

Usando dhcpcd para redefinir a interface definida manualmente
  1. Use dhcpcd para obter o endereço IP ( dhcpcd -p eth0)
  2. Altere manualmente o endereço IP ( ifconfig eth0 x.x.x.x)
  3. Matar dhcpcd ( dhcpcd -k eth0)
  4. Reinicie o dhcpcd ( dhcpcd -p eth0)

Neste caso, o dhcpcd não definirá o endereço IP da interface, a interface apresentará o endereço IP definido manualmente. Por que não está configurando a interface?

dhcpcd -d eth0mostra:

eth0: dhcpcd 4.0.0-beta6 starting
eth0: hardware address = ##:##:##:##:##:##
eth0: broadcasting for a lease
eth0: sending DHCP_DISCOVER with xid 0x25fc838b
eth0: waiting for 3.241 seconds
eth0: offered 192.168.228.180 from 192.168.50.10
eth0: sending DHCP_REQUEST with xid 0x25fc838b
eth0: waiting for 7.224 seconds
eth0: lease of 192.168.228.180 acknowledged
eth0: sending ARP probe #1
eth0: waiting for 1.563 seconds
eth0: sending ARP probe #2
eth0: waiting for 1.442 seconds
eth0: sending ARP probe #3
eth0: waiting for 2.000 seconds
eth0: leased 192.168.228.180 for 691200 seconds
eth0: renew in 345600 seconds
eth0: rebind in 604800 seconds
eth0: adding IP address 192.168.228.180/23
eth0: adding route to 0.0.0.0/0 via 192.168.228.1
eth0: exec `/libexec/dhcpcd-run-hooks'
eth0: forking to background

Responder1

Acontece que o dhcpcd não configurará a interface se a interface tiver um endereço IP estático válido atribuído a ela.

Adicionando uma etapa: 3b. altere o IP eth0 para um valor inválido (ifconfig eth0 0.0.0.0)

a interface é configurada para o endereço IP atribuído pelo DHCP quando o dhcpcd é reiniciado.

informação relacionada