Using dhcpcd to reset manually set interface

0

1

  1. Use dhcpcd to get IP address (dhcpcd -p eth0)
  2. Manually change the IP address (ifconfig eth0 x.x.x.x)
  3. Kill dhcpcd (dhcpcd -k eth0)
  4. Restart dhcpcd (dhcpcd -p eth0)

In this case dhcpcd will not set the IP address of the interface, the interface will come up with the manually set IP address. Why is it not configuring the interface?

dhcpcd -d eth0 shows:

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

Terminal

Posted 2010-10-26T15:04:38.653

Reputation: 23

Answers

1

Turns out that dhcpcd will not configure the interface if the interface has a valid static IP address assigned to it.

By adding a step: 3b. change eth0 IP to an invalid value (ifconfig eth0 0.0.0.0)

the interface is configured to the IP address assigned by the DHCP when dhcpcd is restarted.

Terminal

Posted 2010-10-26T15:04:38.653

Reputation: 23