setting static ip address debian using cli

  • Author: Admin
  • Published On: 4/3/2026
  • Category: editor

  1. Look for the connection name, for example Wired connection 1

    nmcli connection show
    

  2. configure

    sudo nmcli connection modify "Wired connection 1" \
    ipv4.addresses 192.168.1.50/24 \
    ipv4.gateway 192.168.1.1 \
    ipv4.dns "8.8.8.8 1.1.1.1" \
    ipv4.method manual
    

    connection up

    sudo nmcli connection up "Wired connection 1"
    
  3. check result

    ip addr
    ip route
    cat /etc/resolv.conf
    

  • Share On: