diff options
Diffstat (limited to 'usr/local')
-rwxr-xr-x | usr/local/www/interfaces.php | 8 | ||||
-rwxr-xr-x | usr/local/www/interfaces_wan.php | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php index 4edb6fe..0b5ddd6 100755 --- a/usr/local/www/interfaces.php +++ b/usr/local/www/interfaces.php @@ -437,7 +437,13 @@ function type_change(enable_change,enable_change_pptp) { <tr> <td valign="top" class="vncell">MAC address</td> <td class="vtable"> <input name="spoofmac" type="text" class="formfld" id="spoofmac" size="30" value="<?=htmlspecialchars($pconfig['spoofmac']);?>"> - <br> + <?php + $ip = getenv('REMOTE_ADDR'); + $mac = `/usr/sbin/arp -an | grep {$ip} | cut -d" " -f4`; + $mac = str_replace("\n","",$mac); + ?> + <a OnClick="document.forms[0].spoofmac.value='<?=$mac?>';" href="#">Copy my MAC address</a> + <br> This field can be used to modify ("spoof") the MAC address of the WAN interface<br> (may be required with some cable connections)<br> diff --git a/usr/local/www/interfaces_wan.php b/usr/local/www/interfaces_wan.php index 4edb6fe..0b5ddd6 100755 --- a/usr/local/www/interfaces_wan.php +++ b/usr/local/www/interfaces_wan.php @@ -437,7 +437,13 @@ function type_change(enable_change,enable_change_pptp) { <tr> <td valign="top" class="vncell">MAC address</td> <td class="vtable"> <input name="spoofmac" type="text" class="formfld" id="spoofmac" size="30" value="<?=htmlspecialchars($pconfig['spoofmac']);?>"> - <br> + <?php + $ip = getenv('REMOTE_ADDR'); + $mac = `/usr/sbin/arp -an | grep {$ip} | cut -d" " -f4`; + $mac = str_replace("\n","",$mac); + ?> + <a OnClick="document.forms[0].spoofmac.value='<?=$mac?>';" href="#">Copy my MAC address</a> + <br> This field can be used to modify ("spoof") the MAC address of the WAN interface<br> (may be required with some cable connections)<br> |