4

I usually run with eth0 config'd statically from info in /etc/network/interfaces, but sometimes need to use a dhcp acquired config. Running dhclient just tells me it's now an upstart job and suggests running reload, but reload dhclient responds 'Unknown job: dhclient.'

How can I make it run?

2 Answers2

2

Configuring an interface to use DHCP (client), just put this in your /etc/network/interfaces:

auto eth0
iface eth0 inet dhcp

to avoid NetworkManager managing it. Restart NetworkManager to pick up on that:

# service network-manager restart

If you need to run dhclient manually after configuring it yourself using ifconfig or ip commands, you just can and I don't see how upstart is involved here.

For example:

Have it configured manually in /etc/network/interfaces:

auto eth0
iface eth0 inet manual

Then the interface is down by default,

# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr b4:b5:2f:xx
          BROADCAST MULTICAST  MTU:1500  Metric:1

so, bring it up with

# ifconfig eth0 up
# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr b4:b5:2f:xx
          UP BROADCAST MULTICAST  MTU:1500  Metric:1

and start dhclient:

# dhclient eth0
# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr b4:b5:2f:xx
          inet addr:192.168.0.134  Bcast:192.168.0.255  Mask:255.255.255.0
gertvdijk
  • 69,427
1

While everything gertvdijk says is true, the warning message is also real:

# dhclient eth0
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service smbd reload

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the reload(8) utility, e.g. reload smbd
#

It doesn't keep the command from working though.

Marce
  • 11