Results 1 to 5 of 5

Thread: Permanently Disable DHCP

  1. #1
    Join Date
    Jan 2010
    Beans
    2

    Question Permanently Disable DHCP

    Hello all - I need to permanently disable DHCP on all of my machines I support. For Windows, this is just disabling the DHCP Client service. Is there a way to disable the DHCP Client for Ubuntu? I have found very little online - the most I can think of is deleting /etc/dhcp3 or at least take all permissions away (including root).

    All machines are assigned a static address, but since my Linux users still have root access, I cannot have them change any settings - whether through the GUI or CLI.

    TIA

  2. #2
    Join Date
    Aug 2005
    Location
    South Carolina, USA
    Beans
    20,452
    Distro
    Ubuntu 14.10 Utopic Unicorn

    Re: Permanently Disable DHCP

    I cannot have them change any settings - whether through the GUI or CLI.
    Aren't iwconfig and ifconfig changes privileged, that is, requiring the super user's password? Can you not withdraw priveleges in System -> Administration -> Users and Groups?

    https://help.ubuntu.com/community/RootSudo
    "Oh, Ubuntu, you are my favorite Linux-based operating system" --Dr. Sheldon Cooper, Ph.D.

  3. #3
    Join Date
    Nov 2008
    Location
    Sheffield, UK
    Beans
    1,517
    Distro
    Ubuntu

    Re: Permanently Disable DHCP

    Quote Originally Posted by FJTim View Post
    Hello all - I need to permanently disable DHCP on all of my machines I support. For Windows, this is just disabling the DHCP Client service. Is there a way to disable the DHCP Client for Ubuntu? I have found very little online - the most I can think of is deleting /etc/dhcp3 or at least take all permissions away (including root).

    All machines are assigned a static address, but since my Linux users still have root access, I cannot have them change any settings - whether through the GUI or CLI.

    TIA
    setup /etc/network/interfaces

    auto lo
    iface lo inet loopback

    auto eth0
    iface eth0 inet static
    address 192.168.1.10
    netmask 255.255.255.0
    gateway 192.168.1.254

    or what ever your network settings are
    and then sudo chattr +i /etc/network/interfaces

    should do the trick

  4. #4
    Join Date
    May 2006
    Location
    Amsterdam
    Beans
    1,731
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Permanently Disable DHCP

    Removing the dhcp3-client package will make sure DHCP can never be enabled again.

    and to prevent people from installing it if they are root:

    Code:
    echo -e "Package: dhcp3-client dhcp3-common\nPin: release\nPin-Priority: -10" | sudo tee /etc/apt/preferences
    sudo aptitude remove dhcp3-client dhcp3-common
    After you have done this:

    Code:
    sudo aptitude install dhcp3-client
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Reading extended state information... Done
    Initializing package states... Done
    Reading task descriptions... Done
    No candidate version found for dhcp3-client
    No candidate version found for dhcp3-client
    No packages will be installed, upgraded, or removed.
    0 packages upgraded, 0 newly installed, 0 to remove and 128 not upgraded.
    Need to get 0B of archives. After unpacking 0B will be used.
    Writing extended state information... Done
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Reading extended state information... Done
    Initializing package states... Done
    Reading task descriptions... Done
    Hope this helps.
    Last edited by slakkie; January 7th, 2010 at 02:41 PM.
    Upgrade Ubuntu | Upgrade unsupported Ubuntu versions | Always backup | Howto upgrade flash
    Minimal CD install | Remove old kernels | My blog | Linux user #462801 | Conscience doth make cowards of us all. -- Shakespeare

  5. #5
    Join Date
    Jan 2010
    Beans
    2

    Re: Permanently Disable DHCP

    SlugSlug & slakkie -

    Thanks for these tips. I combined both of your recommendations and also removed avahi-autoipd.

    Thanks again.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •