To set an interface to use DHCP with nmcli, you can follow these steps:
Identify the interface you want to configure. You can list all available interfaces using:
nmcli device statusSet the interface to use DHCP. Replace
INTERFACE_NAMEwith the name of your interface:nmcli device modify INTERFACE_NAME ipv4.method autoBring the interface up to apply the changes:
nmcli device connect INTERFACE_NAME
Here's an example for an interface named eth0:
nmcli device modify eth0 ipv4.method auto
nmcli device connect eth0
This will configure the eth0 interface to obtain an IP address via DHCP. If you have any more questions or need further assistance, feel free to ask!
Comments
0 comments
Please sign in to leave a comment.