Solved

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

Posted on 2014-10-20
5
167 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 23

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 61

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Join & Write a Comment

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…
This video discusses moving either the default database or any database to a new volume.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

744 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

11 Experts available now in Live!

Get 1:1 Help Now