From Notes Wiki
Jump to: navigation, search
Home > Shell scripting > Useful bash shell scripts > Capture gateway IP using shell script

Capture gateway IP using shell script

To capture gateway IP using shell-script use:

IP=$(/sbin/ip route | awk '/default/ { print $3 }')