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
Post a Comment