Solved

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

Posted on 2014-10-20
5
172 Views
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
0
Comment
Question by:jimmycher
5 Comments
 
LVL 16

Assisted Solution

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

Accepted Solution

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

/etc/network/interfaces

delete this if exists
iface eth0 inet dhcp

add this
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1
0
 
LVL 26

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 192.168.0.1
# NOTE:  NAMESERVERS ARE NOT DEFINED HERE.
# Nameservers are defined in /etc/resolv.conf
#
iface eth0 inet static
address 192.168.0.201
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1

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.
#
search testbed.com
nameserver 192.168.0.1

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

Open in new window

0
 
LVL 62

Expert Comment

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

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

Author Closing Comment

by:jimmycher
ID: 40394736
Thanks.
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

840 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