摘要 |
Embodiments of the present invention provide a method and an apparatus for obtaining an IP address by a DHCP client, and relate to the field of communications, so as to solve the problems of a waste of the network bandwidth, reduced network efficiency and inconvenience to the maintenance of a user in the prior art, thereby providing the DHCP client with convenience for obtaining an IP address of the DHCP client. The method comprises: a controller generating a first DHCP discovery packet and forwarding the first DHCP discovery packet to a DHCP server through a switch, so that the DHCP server generates a DHCP provision packet and sends the DHCP provision packet to the switch; the controller receiving the DHCP provision packet reported by the switch and a port of the switch for communicating with the DHCP server, and obtaining address information about the DHCP server; and the controller generating a forwarding rule from the switch to the DHCP server according to the address information and the port, so as to assist the DHCP client to obtain an IP address of the DHCP client. |