Geek Times - Getting a TCP/IP address from a DHCP server

Welcome to Geek Times!
spacer
Getting a TCP/IP address from a DHCP server
home
search
archive
about

Tux

Linux

Contents

System Administration

Hardware

Networking

Security

Software

Hardware

U. I.

3rd Parties

Mac-on-Linux

Troubleshooting


 
.
I have my Linux laptop configured (via netcfg) to use a static IP address (assigned to me by my Internet Service Provider). At client sites I usually connect to the Ethernet network and obtain an IP address by querying a Dynamic Host Configuration Protocol (DHCP) server. How? It's frightfully easy.

Gotcha! A typo!

Make sure you type that command correctly - there is no dhcpd command, it's spelled dhcpcd.
1. Issue the dhcpcd command.

# /sbin/dhcpcd
dhcpcd: your IP address = 10.2.199.139
#

That's all there is to it.

I assume of course that your kernel has Ethernet support, you have a Ethernet port on your computer, and an Ethernet device in the /dev directory. I used the dmesg | grep eth command to see what my system had to offer:

eth0: BMAC+ at 00:50:e4:20:7f:78

Once back at home, to stop using DHCP and return to the static IP I configured with netcfg, I shutdown dhcpcd and cycle the networking with these commands (run as the superuser or with sudo):

# dhcpcd -k
# /etc/rc.d/init.d/network stop
# /etc/rc.d/init.d/network start
 

Geek Times copyright information
This page is copyrighted 1993-2006 by Geek Times, all rights reserved. Questions and comments? Send email to the Geek Times Webmaster. Web space graciously donated by rawbandwidth.com, an Internet Service Provider in San Francisco. FOO

email