You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
#!/bin/sh
|
|
|
|
function arp {
|
|
printf "$(cat /proc/net/arp)"
|
|
}
|
|
|
|
gateway_ip="$(ip route | grep default | awk '{print $3}')"
|
|
ping -c 1 "$gateway_ip" -W 1 &> /dev/null
|
|
gateway_mac="$(arp | grep -w "$gateway_ip" | awk '{print $4}')"
|
|
|
|
echo "$gateway_mac"
|