Network Manager - CLI

 

get your connection name

nmcli connection

Example for connection name "Wired connection 1":

set IP address to 192.168.0.100

nmcli connection edit 'Wired connection 1' ipv4.addresses 192.168.0.100/24

disable DHCP

nmcli connection edit 'Wired connection 1' ipv4.method manual

set DNS server

nmcli connection edit 'Wired connection 1' ipv4.dns 8.8.8.8

set gateway

nmcli connection edit 'Wired connection 1' ipv4.gateway 192.168.0.1