Setup DHCP or static IP address from command line in Linux

Ifconfig DHCP : Configure Your DHCP from the Command Line The ifconfig command is the DHCP utility program that is found in Unix-based operating systems. It allows you to configure your TCP/IP address parameters, and to control and query it in general. If you’re familiar with Windows operating systems, you might recognize the ipconfig command that lets you access the Windows DHCP client. ifconfig Command Options Used With DHCP Client (System The command ifconfig interfacedhcp startinitiates the interaction between the DHCP client and DHCP server to obtain an IP address and a new set of configuration options. This might be useful when you change information that you want a client to use immediately, such as when you add IP addresses or change the subnet mask.

The command ifconfig interface dhcp start initiates the interaction between the DHCP client and DHCP server for the purpose of obtaining an IP address and a new set of configuration options. This might be useful when you change options on the server, such as adding IP addresses or changing the subnet mask, that you want clients to use immediately.

ifconfig Command Options Used With DHCP Client (System The command ifconfig interfacedhcp startinitiates the interaction between the DHCP client and DHCP server to obtain an IP address and a new set of configuration options. This might be useful when you change information that you want a client to use immediately, such as when you add IP addresses or change the subnet mask. ifconfig Command Options Used With the DHCP Client (System The command ifconfiginterface[inet6] dhcp startinitiates the interaction between dhcpagentand the DHCP server to obtain an IP address and a new set of configuration options. This command is useful when you change information that you want a client to use immediately, such as when you add IP addresses or change the subnet mask.

-a : This option is used to display all the interfaces available, even if they are down. Syntax: ifconfig …

I now need to switch between DHCP and an address quite often. I know I can easily give a port an address via ifconfig eth0 x.x.x.x netmask x.x.x.x, but, is there an alternative that can be used in order to set a port to use DHCP? ipconfig | Microsoft Docs Oct 16, 2017 How to view the DNS address assigned by DHCP? - Ask Ubuntu