Automate running dhclient in Ubuntu

Well, this is basically a reminder to the future when you need to reconfigure my network. haha!

Since I’m using a DHCP service on a router “D-Link”, I needed to automate my settings on my network interface to avoid always run the command “dhclient”.

/etc/nework/interfaces

auto eth0
iface eth0 inet dhcp

So save the file “interfaces”, run “ifdown eth0″ to stop the service and “ifup eth0″ to starter again.

- Now run the command “ifdown eth0″ for stop service

root@btlagutoli-desktop:/home/btlagutoli# ifdown eth0
There is already a pid file /var/run/dhclient.eth0.pid with pid 1125
killed old client process, removed PID file
Internet Systems Consortium DHCP Client V3.1.3
Copyright 2004-2009 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/00:xx:aa:dd:dd:dff
Sending on   LPF/eth0/00:xx:aa:dd:dd:dff
Sending on   Socket/fallback
DHCPRELEASE on eth0 to 192.168.0.1 port 67
suspect value in server_name option - discarded



- Finally, run “ifup eth0″ for start the service again

root@btlagutoli-desktop:/home/btlagutoli# ifdown eth0
There is already a pid file /var/run/dhclient.eth0.pid with pid 1125
killed old client process, removed PID file
Internet Systems Consortium DHCP Client V3.1.3
Copyright 2004-2009 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/00:xx:aa:dd:dd:dff
Sending on   LPF/eth0/00:xx:aa:dd:dd:dff
Sending on   Socket/fallback
DHCPRELEASE on eth0 to 192.168.0.1 port 67
suspect value in server_name option - discarded

That’s it!

Artigos Relacionados

Artigos Relacionados

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

  • RSS
  • Facebook
  • Google+
  • LinkedIn
  • Twitter
  • Git Hub
  • YouTube