linux - How to get the gateway MAC address -


i'm connected private network ip addresses 192.168.xxx.xxx. know ip address of default gateway how gateway mac address. i'm working on imac , linux machines. unix command that?

this gives list of everything:

netstat -rn  

or 1 default gateway:

netstat -rn | grep 'default' 

what want:

netstat -rn | grep 'default' | awk '{print $2}' 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -