User Tools

Site Tools


ubuntu:network:get_local_ip_address

This is an old revision of the document!


Ubuntu - Network - Get local IP address

ip route show default 0.0.0.0/0

returns:

default via 192.168.1.1 dev br0 proto static 

ip route get 1 | sed 's/^.*src \([^ ]*\).*$/\1/;q'

returns:

192.168.1.69

ip route get 1 | awk '{print $7}'

returns:

192.168.1.69
ubuntu/network/get_local_ip_address.1610108180.txt.gz ยท Last modified: 2021/01/08 12:16 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki