Knowledge Base

Commands to Get Private IP Address

  1. ifconfig -a
  2. /sbin/ip addr or /sbin/ip a
  3. hostname -I | awk '{print $1}'
  4. /sbin/ip route get 1.2.3.4 | awk '{print $7}'
  5. nmcli -p device show
NULL