Capture gateway IP using shell script

From Notes_Wiki
Revision as of 11:24, 15 December 2015 by Saurabh (talk | contribs) (Created page with "<yambe:breadcrumb>Useful_bash_shell_scripts|Useful bash shell scripts</yambe:breadcrumb> =Capture gateway IP using shell script= To capture gateway IP using shell-script use:...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

<yambe:breadcrumb>Useful_bash_shell_scripts|Useful bash shell scripts</yambe:breadcrumb>

Capture gateway IP using shell script

To capture gateway IP using shell-script use:

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