summaryrefslogtreecommitdiffstats
path: root/usr/local/www
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-04-18 20:27:51 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-04-18 20:27:51 +0000
commit1e694beecf622f2100f639179b484f60d5e1f41f (patch)
tree6df91506a58cf71b635b5631d72acb0c31ea35d7 /usr/local/www
parent5690b66b48c1b51f6462974275526129c272d4e4 (diff)
downloadpfsense-1e694beecf622f2100f639179b484f60d5e1f41f.zip
pfsense-1e694beecf622f2100f639179b484f60d5e1f41f.tar.gz
Add "Copy my MAC address" feature which copies the mac address of the person surfing into pfSense. Useful when a user needs to override their wan with their machines mac address
Diffstat (limited to 'usr/local/www')
-rwxr-xr-xusr/local/www/interfaces.php8
-rwxr-xr-xusr/local/www/interfaces_wan.php8
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 (&quot;spoof&quot;) 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 (&quot;spoof&quot;) the MAC
address of the WAN interface<br>
(may be required with some cable connections)<br>
OpenPOWER on IntegriCloud