Starting and Stopping DHCP Clients

To be able to use DHCP, your client machines must know how to actually send DHCP requests to the network for configuration. In SUSE, you can use the Network Configuration of YaST (Network Devices O Network Card) to configure a network interface to use DHCP.

Another useful way to send a DHCP request is with ifup-dhcp and ifdown-dhcp. If you are using a wireless network, or you want to bring up a network interface temporarily using DHCP, then you can use the ifup-dhcp command:

bible:~ # ifup-dhcp eth0

Starting DHCP Client Daemon on eth0

This command starts the DHCP client and attaches it to the eth0 interface.

In the event that you want to remove the DHCP client from a network interface, thus removing its dynamic network configuration, you need to use the ifdown-dhcp command:

bible:~ # ifdown-dhcp eth0

This removes the DHCP client from the network card specified, in this case eth0.

If you are using NetworkManager, restarting NetworkManager, or choosing a different network in it, restarts the DHCP client.

You can also manually run a DHCP client with the command dhclient.

[email protected]: /root # dhclient Internet Systems Consortium DHCP Client V3.0.6 Copyright 2004-2007 Internet Systems Consortium. All rights reserved.

For info, please visit http

//www

isc

.org/sw/dhcp/

Listening on LPF/eth1/00:16

6f

6f

62:

30

Sending on LPF/eth1/00:16

6f

6f

62:

30

Listening on LPF/eth0/00:15

c5

0c

2f:

5a

Sending on LPF/eth0/00:15

c5

0c

2f:

5a

Sending on Socket/fallback

DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 5 DHCPOFFER from 192.168.1.254

DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 2 DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 5 DHCPREQUEST on eth0 to 255.255.255.255 port 67 DHCPACK from 192.168.1.254

bound to 192.168.1.4 -- renewal in 1537 seconds.

Here you see that the DHCP client tried both network interfaces (eth0 and eth1) and obtained the address 192.168.1.4 from the DHCP server 192.168.1.254. If you look in /var/log/messages on the server, you see its record of the same events:

Jan 16 11:10:58 rogerwhittaker dhcpd: DHCPDISCOVER from 00:15:c5:0c:2f:5a via eth1

Jan 16 11:10:58 rogerwhittaker dhcpd: DHCPOFFER on 192.168.1.4 to 00:15:c5: 0c:2f:5a via eth1

Jan 16 11:11:02 rogerwhittaker dhcpd: DHCPREQUEST for 192.168.1.4 (192.168.1.254) from 00:15:c5:0c:2f:5a via eth1

Jan 16 11:11:03 rogerwhittaker dhcpd: DHCPACK on 192.168.1.4 to 00:15:c5: 0c:2f:5a via eth1

Was this article helpful?

0 0

Responses

  • Ensio
    How to stop dhcpv6 client suse?
    6 years ago

Post a comment