How do I turn off a linux server from recieveing a DHCP address

Posted on 2014-10-20
Last Modified: 2014-10-21
I want to manually configure an interface address; I use ifconfig.   But when ever I plug that interface into the switch, it picks up a DHCP address (i think) .   How do I stop it so I can only use manually config ip addresses
Question by:jimmycher
LVL 16

Assisted Solution

by:Joshua Grantom
Joshua Grantom earned 400 total points
ID: 40393022
What line did you use for ifconfig?
LVL 16

Accepted Solution

Joshua Grantom earned 400 total points
ID: 40393033
Have you tried to editing your interface file?


delete this if exists
iface eth0 inet dhcp

add this
iface eth0 inet static
LVL 24

Assisted Solution

by:Dr. Klahn
Dr. Klahn earned 100 total points
ID: 40393212
This is the /etc/networks/interfaces from the linux server on my LAN.

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0

# The following section is for use when on a 192.168.0 LAN
# with a gateway at
# Nameservers are defined in /etc/resolv.conf
iface eth0 inet static

Open in new window

As the file notes, nameservers are not defined in /etc/networks/interfaces,
but instead in /etc/resolv.conf

The /etc/resolv.conf from the same system.  Note that if
the system runs pdnsd or other caching DNS resolver, the
requests should be redirected to 127.0.01 rather than to the
real nameservers.  On your system this will probably not be
the case and you should use the real nameserver.  That is
probably the router itself.

# This section is for use when running on a 192.168 LAN.
# without pdnsd or other caching DNS resolver.

# This section is for use when pdnsd is resolving requests
#  nameserver

Open in new window

LVL 61

Expert Comment

ID: 40393681
edit /etc/sysconfig/network-scripts ifcfg-eth0

make sure
BOOTPROTO=none (other options are bootp and dhcp)

Author Closing Comment

ID: 40394736

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
OpenVPN running on Ubuntu 14.4 x64 5 91
Exploits in Kali Linux 4 266
Cron jobs 12 116
Linux Ubuntu - Gave up waiting for root device. ALERT! /dev/sda1 does not exist 16 125
I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now