1 |
5b237745
|
Scott Ullrich
|
#!/usr/local/bin/php
|
2 |
8cccee1c
|
Scott Ullrich
|
<?php
|
3 |
2bdf4a03
|
Scott Ullrich
|
/* $Id$ */
|
4 |
5b237745
|
Scott Ullrich
|
/*
|
5 |
|
|
status_interfaces.php
|
6 |
8c3e8725
|
Scott Ullrich
|
part of pfSense
|
7 |
|
|
Copyright (C) 2005 Scott Ullrich <sullrich@gmail.com>.
|
8 |
|
|
All rights reserved.
|
9 |
8cccee1c
|
Scott Ullrich
|
|
10 |
8c3e8725
|
Scott Ullrich
|
originally part of m0n0wall (http://m0n0.ch/wall)
|
11 |
c26e2cf0
|
Scott Ullrich
|
Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
|
12 |
5b237745
|
Scott Ullrich
|
All rights reserved.
|
13 |
8cccee1c
|
Scott Ullrich
|
|
14 |
5b237745
|
Scott Ullrich
|
Redistribution and use in source and binary forms, with or without
|
15 |
|
|
modification, are permitted provided that the following conditions are met:
|
16 |
8cccee1c
|
Scott Ullrich
|
|
17 |
5b237745
|
Scott Ullrich
|
1. Redistributions of source code must retain the above copyright notice,
|
18 |
|
|
this list of conditions and the following disclaimer.
|
19 |
8cccee1c
|
Scott Ullrich
|
|
20 |
5b237745
|
Scott Ullrich
|
2. Redistributions in binary form must reproduce the above copyright
|
21 |
|
|
notice, this list of conditions and the following disclaimer in the
|
22 |
|
|
documentation and/or other materials provided with the distribution.
|
23 |
8cccee1c
|
Scott Ullrich
|
|
24 |
5b237745
|
Scott Ullrich
|
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
25 |
|
|
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
26 |
|
|
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
27 |
|
|
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
28 |
|
|
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
29 |
|
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
30 |
|
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
31 |
|
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
32 |
|
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
33 |
|
|
POSSIBILITY OF SUCH DAMAGE.
|
34 |
|
|
*/
|
35 |
|
|
|
36 |
51caa77a
|
Scott Ullrich
|
require_once("guiconfig.inc");
|
37 |
5b237745
|
Scott Ullrich
|
|
38 |
c26e2cf0
|
Scott Ullrich
|
$wancfg = &$config['interfaces']['wan'];
|
39 |
|
|
|
40 |
|
|
if ($_POST) {
|
41 |
b99895fe
|
Bill Marquette
|
$interface = $_POST['interface'];
|
42 |
|
|
$ifcfg = &$config['interfaces'][$interface];
|
43 |
c26e2cf0
|
Scott Ullrich
|
if ($_POST['submit'] == "Disconnect" || $_POST['submit'] == "Release") {
|
44 |
b99895fe
|
Bill Marquette
|
if ($ifcfg['ipaddr'] == "dhcp")
|
45 |
a8826fb4
|
Scott Ullrich
|
interfaces_dhcp_down($interface);
|
46 |
b99895fe
|
Bill Marquette
|
else if ($ifcfg['ipaddr'] == "pppoe")
|
47 |
|
|
interfaces_wan_pppoe_down(); // FIXME: when we support multi-pppoe
|
48 |
|
|
else if ($ifcfg['ipaddr'] == "pptp")
|
49 |
|
|
interfaces_wan_pptp_down(); // FIXME: when we support multi-pptp
|
50 |
c26e2cf0
|
Scott Ullrich
|
} else if ($_POST['submit'] == "Connect" || $_POST['submit'] == "Renew") {
|
51 |
b99895fe
|
Bill Marquette
|
if ($ifcfg['ipaddr'] == "dhcp")
|
52 |
a8826fb4
|
Scott Ullrich
|
interfaces_dhcp_up($interface);
|
53 |
b99895fe
|
Bill Marquette
|
else if ($ifcfg['ipaddr'] == "pppoe")
|
54 |
|
|
interfaces_wan_pppoe_up(); // FIXME: when we support multi-pppoe
|
55 |
|
|
else if ($ifcfg['ipaddr'] == "pptp")
|
56 |
|
|
interfaces_wan_pptp_up(); // FIXME: when we support multi-pptp
|
57 |
c26e2cf0
|
Scott Ullrich
|
} else {
|
58 |
|
|
header("Location: index.php");
|
59 |
|
|
exit;
|
60 |
|
|
}
|
61 |
|
|
}
|
62 |
|
|
|
63 |
5b237745
|
Scott Ullrich
|
function get_interface_info($ifdescr) {
|
64 |
8cccee1c
|
Scott Ullrich
|
|
65 |
767a716e
|
Scott Ullrich
|
global $config, $linkinfo, $netstatrninfo;
|
66 |
8cccee1c
|
Scott Ullrich
|
|
67 |
5b237745
|
Scott Ullrich
|
$ifinfo = array();
|
68 |
8cccee1c
|
Scott Ullrich
|
|
69 |
5b237745
|
Scott Ullrich
|
/* find out interface name */
|
70 |
c26e2cf0
|
Scott Ullrich
|
$ifinfo['hwif'] = $config['interfaces'][$ifdescr]['if'];
|
71 |
5b237745
|
Scott Ullrich
|
if ($ifdescr == "wan")
|
72 |
|
|
$ifinfo['if'] = get_real_wan_interface();
|
73 |
|
|
else
|
74 |
c26e2cf0
|
Scott Ullrich
|
$ifinfo['if'] = $ifinfo['hwif'];
|
75 |
8cccee1c
|
Scott Ullrich
|
|
76 |
5b237745
|
Scott Ullrich
|
/* run netstat to determine link info */
|
77 |
767a716e
|
Scott Ullrich
|
|
78 |
5b237745
|
Scott Ullrich
|
unset($linkinfo);
|
79 |
c26e2cf0
|
Scott Ullrich
|
exec("/usr/bin/netstat -I " . $ifinfo['hwif'] . " -nWb -f link", $linkinfo);
|
80 |
5b237745
|
Scott Ullrich
|
$linkinfo = preg_split("/\s+/", $linkinfo[1]);
|
81 |
|
|
if (preg_match("/\*$/", $linkinfo[0])) {
|
82 |
|
|
$ifinfo['status'] = "down";
|
83 |
|
|
} else {
|
84 |
|
|
$ifinfo['status'] = "up";
|
85 |
|
|
}
|
86 |
8cccee1c
|
Scott Ullrich
|
|
87 |
c26e2cf0
|
Scott Ullrich
|
if (!strstr($ifinfo['if'],'tun')) {
|
88 |
5b237745
|
Scott Ullrich
|
$ifinfo['macaddr'] = $linkinfo[3];
|
89 |
|
|
$ifinfo['inpkts'] = $linkinfo[4];
|
90 |
|
|
$ifinfo['inerrs'] = $linkinfo[5];
|
91 |
|
|
$ifinfo['inbytes'] = $linkinfo[6];
|
92 |
|
|
$ifinfo['outpkts'] = $linkinfo[7];
|
93 |
|
|
$ifinfo['outerrs'] = $linkinfo[8];
|
94 |
|
|
$ifinfo['outbytes'] = $linkinfo[9];
|
95 |
|
|
$ifinfo['collisions'] = $linkinfo[10];
|
96 |
|
|
} else {
|
97 |
|
|
$ifinfo['inpkts'] = $linkinfo[3];
|
98 |
|
|
$ifinfo['inbytes'] = $linkinfo[5];
|
99 |
|
|
$ifinfo['outpkts'] = $linkinfo[6];
|
100 |
|
|
$ifinfo['outbytes'] = $linkinfo[8];
|
101 |
|
|
}
|
102 |
8cccee1c
|
Scott Ullrich
|
|
103 |
c26e2cf0
|
Scott Ullrich
|
/* DHCP? -> see if dhclient is up */
|
104 |
|
|
if (($ifdescr == "wan") && ($config['interfaces']['wan']['ipaddr'] == "dhcp")) {
|
105 |
|
|
/* see if dhclient is up */
|
106 |
8ff8520f
|
Scott Ullrich
|
if (is_dhcp_running("wan") == true)
|
107 |
c26e2cf0
|
Scott Ullrich
|
$ifinfo['dhcplink'] = "up";
|
108 |
|
|
else
|
109 |
|
|
$ifinfo['dhcplink'] = "down";
|
110 |
|
|
}
|
111 |
02787f50
|
Scott Ullrich
|
/* loop through optional interfaces looking to see if they are dhcp */
|
112 |
b5ce5ea8
|
Scott Ullrich
|
for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++) {
|
113 |
|
|
$ifdescrs['opt' . $j] = $config['interfaces']['opt' . $j]['descr'];
|
114 |
8c3e8725
|
Scott Ullrich
|
if (($ifdescr == "opt{$j}") && ($config['interfaces']['opt' . $j]['ipaddr'] == "dhcp")) {
|
115 |
b5ce5ea8
|
Scott Ullrich
|
/* see if dhclient is up */
|
116 |
8ff8520f
|
Scott Ullrich
|
if (is_dhcp_running("opt{$j}") == true)
|
117 |
b5ce5ea8
|
Scott Ullrich
|
$ifinfo['dhcplink'] = "up";
|
118 |
|
|
else
|
119 |
|
|
$ifinfo['dhcplink'] = "down";
|
120 |
|
|
}
|
121 |
|
|
}
|
122 |
8cccee1c
|
Scott Ullrich
|
|
123 |
c26e2cf0
|
Scott Ullrich
|
/* PPPoE interface? -> get status from virtual interface */
|
124 |
|
|
if (($ifdescr == "wan") && ($config['interfaces']['wan']['ipaddr'] == "pppoe")) {
|
125 |
|
|
unset($linkinfo);
|
126 |
|
|
exec("/usr/bin/netstat -I " . $ifinfo['if'] . " -nWb -f link", $linkinfo);
|
127 |
|
|
$linkinfo = preg_split("/\s+/", $linkinfo[1]);
|
128 |
|
|
if (preg_match("/\*$/", $linkinfo[0])) {
|
129 |
|
|
$ifinfo['pppoelink'] = "down";
|
130 |
|
|
} else {
|
131 |
|
|
/* get PPPoE link status for dial on demand */
|
132 |
767a716e
|
Scott Ullrich
|
$ifconfiginfo = "";
|
133 |
c26e2cf0
|
Scott Ullrich
|
unset($ifconfiginfo);
|
134 |
|
|
exec("/sbin/ifconfig " . $ifinfo['if'], $ifconfiginfo);
|
135 |
8cccee1c
|
Scott Ullrich
|
|
136 |
c26e2cf0
|
Scott Ullrich
|
$ifinfo['pppoelink'] = "up";
|
137 |
8cccee1c
|
Scott Ullrich
|
|
138 |
c26e2cf0
|
Scott Ullrich
|
foreach ($ifconfiginfo as $ici) {
|
139 |
|
|
if (strpos($ici, 'LINK0') !== false)
|
140 |
|
|
$ifinfo['pppoelink'] = "down";
|
141 |
5b237745
|
Scott Ullrich
|
}
|
142 |
|
|
}
|
143 |
c26e2cf0
|
Scott Ullrich
|
}
|
144 |
8cccee1c
|
Scott Ullrich
|
|
145 |
c26e2cf0
|
Scott Ullrich
|
/* PPTP interface? -> get status from virtual interface */
|
146 |
|
|
if (($ifdescr == "wan") && ($config['interfaces']['wan']['ipaddr'] == "pptp")) {
|
147 |
|
|
unset($linkinfo);
|
148 |
|
|
exec("/usr/bin/netstat -I " . $ifinfo['if'] . " -nWb -f link", $linkinfo);
|
149 |
|
|
$linkinfo = preg_split("/\s+/", $linkinfo[1]);
|
150 |
|
|
if (preg_match("/\*$/", $linkinfo[0])) {
|
151 |
|
|
$ifinfo['pptplink'] = "down";
|
152 |
|
|
} else {
|
153 |
|
|
/* get PPTP link status for dial on demand */
|
154 |
|
|
unset($ifconfiginfo);
|
155 |
|
|
exec("/sbin/ifconfig " . $ifinfo['if'], $ifconfiginfo);
|
156 |
8cccee1c
|
Scott Ullrich
|
|
157 |
c26e2cf0
|
Scott Ullrich
|
$ifinfo['pptplink'] = "up";
|
158 |
8cccee1c
|
Scott Ullrich
|
|
159 |
c26e2cf0
|
Scott Ullrich
|
foreach ($ifconfiginfo as $ici) {
|
160 |
|
|
if (strpos($ici, 'LINK0') !== false)
|
161 |
|
|
$ifinfo['pptplink'] = "down";
|
162 |
|
|
}
|
163 |
|
|
}
|
164 |
|
|
}
|
165 |
8cccee1c
|
Scott Ullrich
|
|
166 |
c26e2cf0
|
Scott Ullrich
|
if ($ifinfo['status'] == "up") {
|
167 |
|
|
/* try to determine media with ifconfig */
|
168 |
5b237745
|
Scott Ullrich
|
unset($ifconfiginfo);
|
169 |
c26e2cf0
|
Scott Ullrich
|
exec("/sbin/ifconfig " . $ifinfo['hwif'], $ifconfiginfo);
|
170 |
767a716e
|
Scott Ullrich
|
$matches = "";
|
171 |
5b237745
|
Scott Ullrich
|
foreach ($ifconfiginfo as $ici) {
|
172 |
192845df
|
Scott Ullrich
|
|
173 |
|
|
/* don't list media/speed for wireless cards, as it always
|
174 |
|
|
displays 2 Mbps even though clients can connect at 11 Mbps */
|
175 |
|
|
if (preg_match("/media: .*? \((.*?)\)/", $ici, $matches)) {
|
176 |
|
|
$ifinfo['media'] = $matches[1];
|
177 |
|
|
} else if (preg_match("/media: Ethernet (.*)/", $ici, $matches)) {
|
178 |
|
|
$ifinfo['media'] = $matches[1];
|
179 |
|
|
} else if (preg_match("/media: IEEE 802.11 Wireless Ethernet (.*)/", $ici, $matches)) {
|
180 |
|
|
$ifinfo['media'] = $matches[1];
|
181 |
5b237745
|
Scott Ullrich
|
}
|
182 |
192845df
|
Scott Ullrich
|
|
183 |
5b237745
|
Scott Ullrich
|
if (preg_match("/status: (.*)$/", $ici, $matches)) {
|
184 |
|
|
if ($matches[1] != "active")
|
185 |
|
|
$ifinfo['status'] = $matches[1];
|
186 |
|
|
}
|
187 |
|
|
if (preg_match("/channel (\S*)/", $ici, $matches)) {
|
188 |
|
|
$ifinfo['channel'] = $matches[1];
|
189 |
|
|
}
|
190 |
c26e2cf0
|
Scott Ullrich
|
if (preg_match("/ssid (\".*?\"|\S*)/", $ici, $matches)) {
|
191 |
|
|
if ($matches[1][0] == '"')
|
192 |
|
|
$ifinfo['ssid'] = substr($matches[1], 1, -1);
|
193 |
|
|
else
|
194 |
|
|
$ifinfo['ssid'] = $matches[1];
|
195 |
5b237745
|
Scott Ullrich
|
}
|
196 |
|
|
}
|
197 |
8cccee1c
|
Scott Ullrich
|
|
198 |
c26e2cf0
|
Scott Ullrich
|
if ($ifinfo['pppoelink'] != "down" && $ifinfo['pptplink'] != "down") {
|
199 |
|
|
/* try to determine IP address and netmask with ifconfig */
|
200 |
5b237745
|
Scott Ullrich
|
unset($ifconfiginfo);
|
201 |
c26e2cf0
|
Scott Ullrich
|
exec("/sbin/ifconfig " . $ifinfo['if'], $ifconfiginfo);
|
202 |
8cccee1c
|
Scott Ullrich
|
|
203 |
5b237745
|
Scott Ullrich
|
foreach ($ifconfiginfo as $ici) {
|
204 |
c26e2cf0
|
Scott Ullrich
|
if (preg_match("/inet (\S+)/", $ici, $matches)) {
|
205 |
|
|
$ifinfo['ipaddr'] = $matches[1];
|
206 |
|
|
}
|
207 |
|
|
if (preg_match("/netmask (\S+)/", $ici, $matches)) {
|
208 |
|
|
if (preg_match("/^0x/", $matches[1]))
|
209 |
|
|
$ifinfo['subnet'] = long2ip(hexdec($matches[1]));
|
210 |
5b237745
|
Scott Ullrich
|
}
|
211 |
|
|
}
|
212 |
8cccee1c
|
Scott Ullrich
|
|
213 |
c26e2cf0
|
Scott Ullrich
|
if ($ifdescr == "wan") {
|
214 |
|
|
/* run netstat to determine the default gateway */
|
215 |
|
|
unset($netstatrninfo);
|
216 |
|
|
exec("/usr/bin/netstat -rnf inet", $netstatrninfo);
|
217 |
8cccee1c
|
Scott Ullrich
|
|
218 |
c26e2cf0
|
Scott Ullrich
|
foreach ($netstatrninfo as $nsr) {
|
219 |
|
|
if (preg_match("/^default\s*(\S+)/", $nsr, $matches)) {
|
220 |
|
|
$ifinfo['gateway'] = $matches[1];
|
221 |
|
|
}
|
222 |
|
|
}
|
223 |
5b237745
|
Scott Ullrich
|
}
|
224 |
|
|
}
|
225 |
|
|
}
|
226 |
8cccee1c
|
Scott Ullrich
|
|
227 |
5b237745
|
Scott Ullrich
|
return $ifinfo;
|
228 |
|
|
}
|
229 |
|
|
|
230 |
4df96eff
|
Scott Ullrich
|
$pgtitle = "Status: Interfaces";
|
231 |
|
|
include("head.inc");
|
232 |
|
|
|
233 |
5b237745
|
Scott Ullrich
|
?>
|
234 |
8cccee1c
|
Scott Ullrich
|
|
235 |
|
|
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
|
236 |
5b237745
|
Scott Ullrich
|
<?php include("fbegin.inc"); ?>
|
237 |
74f446e8
|
Bill Marquette
|
<p class="pgtitle"><?=$pgtitle?></p>
|
238 |
5b237745
|
Scott Ullrich
|
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
239 |
|
|
<?php $i = 0; $ifdescrs = array('wan' => 'WAN', 'lan' => 'LAN');
|
240 |
51caa77a
|
Scott Ullrich
|
for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++) {
|
241 |
|
|
$ifdescrs['opt' . $j] = $config['interfaces']['opt' . $j]['descr'];
|
242 |
|
|
}
|
243 |
|
|
foreach ($ifdescrs as $ifdescr => $ifname):
|
244 |
|
|
$ifinfo = get_interface_info($ifdescr);
|
245 |
|
|
?>
|
246 |
fae80dfc
|
Scott Ullrich
|
<form action="status_interfaces.php" method="post">
|
247 |
312536e5
|
Scott Ullrich
|
<input type="hidden" name="interface" value="<?php echo $ifdescr; ?>">
|
248 |
5b237745
|
Scott Ullrich
|
<?php if ($i): ?>
|
249 |
|
|
<tr>
|
250 |
51caa77a
|
Scott Ullrich
|
<td colspan="8" class="list" height="12"></td>
|
251 |
|
|
</tr>
|
252 |
|
|
<?php endif; ?>
|
253 |
8cccee1c
|
Scott Ullrich
|
<tr>
|
254 |
|
|
<td colspan="2" class="listtopic">
|
255 |
5b237745
|
Scott Ullrich
|
<?=htmlspecialchars($ifname);?>
|
256 |
97593aa4
|
Scott Ullrich
|
interface
|
257 |
|
|
(<?=convert_friendly_interface_to_real_interface_name($ifname);?>)
|
258 |
|
|
</td>
|
259 |
5b237745
|
Scott Ullrich
|
</tr>
|
260 |
8cccee1c
|
Scott Ullrich
|
<tr>
|
261 |
c26e2cf0
|
Scott Ullrich
|
<td width="22%" class="vncellt">Status</td>
|
262 |
8cccee1c
|
Scott Ullrich
|
<td width="78%" class="listr">
|
263 |
5b237745
|
Scott Ullrich
|
<?=htmlspecialchars($ifinfo['status']);?>
|
264 |
|
|
</td>
|
265 |
c26e2cf0
|
Scott Ullrich
|
</tr><?php if ($ifinfo['dhcplink']): ?>
|
266 |
8cccee1c
|
Scott Ullrich
|
<tr>
|
267 |
c26e2cf0
|
Scott Ullrich
|
<td width="22%" class="vncellt">DHCP</td>
|
268 |
8cccee1c
|
Scott Ullrich
|
<td width="78%" class="listr">
|
269 |
c26e2cf0
|
Scott Ullrich
|
<?=htmlspecialchars($ifinfo['dhcplink']);?>
|
270 |
|
|
<?php if ($ifinfo['dhcplink'] == "up"): ?>
|
271 |
|
|
<input type="submit" name="submit" value="Release" class="formbtns">
|
272 |
|
|
<?php else: ?>
|
273 |
|
|
<input type="submit" name="submit" value="Renew" class="formbtns">
|
274 |
|
|
<?php endif; ?>
|
275 |
|
|
</td>
|
276 |
|
|
</tr><?php endif; if ($ifinfo['pppoelink']): ?>
|
277 |
8cccee1c
|
Scott Ullrich
|
<tr>
|
278 |
c26e2cf0
|
Scott Ullrich
|
<td width="22%" class="vncellt">PPPoE</td>
|
279 |
8cccee1c
|
Scott Ullrich
|
<td width="78%" class="listr">
|
280 |
c26e2cf0
|
Scott Ullrich
|
<?=htmlspecialchars($ifinfo['pppoelink']);?>
|
281 |
|
|
<?php if ($ifinfo['pppoelink'] == "up"): ?>
|
282 |
|
|
<input type="submit" name="submit" value="Disconnect" class="formbtns">
|
283 |
|
|
<?php else: ?>
|
284 |
|
|
<input type="submit" name="submit" value="Connect" class="formbtns">
|
285 |
|
|
<?php endif; ?>
|
286 |
5b237745
|
Scott Ullrich
|
</td>
|
287 |
|
|
</tr><?php endif; if ($ifinfo['pptplink']): ?>
|
288 |
8cccee1c
|
Scott Ullrich
|
<tr>
|
289 |
c26e2cf0
|
Scott Ullrich
|
<td width="22%" class="vncellt">PPTP</td>
|
290 |
8cccee1c
|
Scott Ullrich
|
<td width="78%" class="listr">
|
291 |
c26e2cf0
|
Scott Ullrich
|
<?=htmlspecialchars($ifinfo['pptplink']);?>
|
292 |
|
|
<?php if ($ifinfo['pptplink'] == "up"): ?>
|
293 |
|
|
<input type="submit" name="submit" value="Disconnect" class="formbtns">
|
294 |
|
|
<?php else: ?>
|
295 |
|
|
<input type="submit" name="submit" value="Connect" class="formbtns">
|
296 |
|
|
<?php endif; ?>
|
297 |
5b237745
|
Scott Ullrich
|
</td>
|
298 |
|
|
</tr><?php endif; if ($ifinfo['macaddr']): ?>
|
299 |
8cccee1c
|
Scott Ullrich
|
<tr>
|
300 |
c26e2cf0
|
Scott Ullrich
|
<td width="22%" class="vncellt">MAC address</td>
|
301 |
8cccee1c
|
Scott Ullrich
|
<td width="78%" class="listr">
|
302 |
5b237745
|
Scott Ullrich
|
<?=htmlspecialchars($ifinfo['macaddr']);?>
|
303 |
|
|
</td>
|
304 |
a8826fb4
|
Scott Ullrich
|
</tr>
|
305 |
|
|
</form>
|
306 |
|
|
<?php endif; if ($ifinfo['status'] != "down"): ?>
|
307 |
c26e2cf0
|
Scott Ullrich
|
<?php if ($ifinfo['dhcplink'] != "down" && $ifinfo['pppoelink'] != "down" && $ifinfo['pptplink'] != "down"): ?>
|
308 |
5b237745
|
Scott Ullrich
|
<?php if ($ifinfo['ipaddr']): ?>
|
309 |
8cccee1c
|
Scott Ullrich
|
<tr>
|
310 |
c26e2cf0
|
Scott Ullrich
|
<td width="22%" class="vncellt">IP address</td>
|
311 |
8cccee1c
|
Scott Ullrich
|
<td width="78%" class="listr">
|
312 |
5b237745
|
Scott Ullrich
|
<?=htmlspecialchars($ifinfo['ipaddr']);?>
|
313 |
|
|
</td>
|
314 |
|
|
</tr><?php endif; ?><?php if ($ifinfo['subnet']): ?>
|
315 |
8cccee1c
|
Scott Ullrich
|
<tr>
|
316 |
c26e2cf0
|
Scott Ullrich
|
<td width="22%" class="vncellt">Subnet mask</td>
|
317 |
8cccee1c
|
Scott Ullrich
|
<td width="78%" class="listr">
|
318 |
5b237745
|
Scott Ullrich
|
<?=htmlspecialchars($ifinfo['subnet']);?>
|
319 |
|
|
</td>
|
320 |
|
|
</tr><?php endif; ?><?php if ($ifinfo['gateway']): ?>
|
321 |
8cccee1c
|
Scott Ullrich
|
<tr>
|
322 |
c26e2cf0
|
Scott Ullrich
|
<td width="22%" class="vncellt">Gateway</td>
|
323 |
8cccee1c
|
Scott Ullrich
|
<td width="78%" class="listr">
|
324 |
5b237745
|
Scott Ullrich
|
<?=htmlspecialchars($ifinfo['gateway']);?>
|
325 |
|
|
</td>
|
326 |
c394a5d1
|
Scott Ullrich
|
</tr><?php endif; if ($ifdescr == "wan" && file_exists("{$g['varetc_path']}/resolv.conf")): ?>
|
327 |
c26e2cf0
|
Scott Ullrich
|
<td width="22%" class="vncellt">ISP DNS servers</td>
|
328 |
6205a304
|
Scott Ullrich
|
<td width="78%" class="listr">
|
329 |
|
|
<?php
|
330 |
|
|
$dns_servers = get_dns_servers();
|
331 |
|
|
foreach($dns_servers as $dns) {
|
332 |
|
|
echo "{$dns}<br>";
|
333 |
|
|
}
|
334 |
|
|
?>
|
335 |
|
|
</td>
|
336 |
c26e2cf0
|
Scott Ullrich
|
<?php endif; endif; if ($ifinfo['media']): ?>
|
337 |
8cccee1c
|
Scott Ullrich
|
<tr>
|
338 |
c26e2cf0
|
Scott Ullrich
|
<td width="22%" class="vncellt">Media</td>
|
339 |
8cccee1c
|
Scott Ullrich
|
<td width="78%" class="listr">
|
340 |
5b237745
|
Scott Ullrich
|
<?=htmlspecialchars($ifinfo['media']);?>
|
341 |
|
|
</td>
|
342 |
|
|
</tr><?php endif; ?><?php if ($ifinfo['channel']): ?>
|
343 |
8cccee1c
|
Scott Ullrich
|
<tr>
|
344 |
c26e2cf0
|
Scott Ullrich
|
<td width="22%" class="vncellt">Channel</td>
|
345 |
8cccee1c
|
Scott Ullrich
|
<td width="78%" class="listr">
|
346 |
5b237745
|
Scott Ullrich
|
<?=htmlspecialchars($ifinfo['channel']);?>
|
347 |
|
|
</td>
|
348 |
|
|
</tr><?php endif; ?><?php if ($ifinfo['ssid']): ?>
|
349 |
8cccee1c
|
Scott Ullrich
|
<tr>
|
350 |
c26e2cf0
|
Scott Ullrich
|
<td width="22%" class="vncellt">SSID</td>
|
351 |
8cccee1c
|
Scott Ullrich
|
<td width="78%" class="listr">
|
352 |
5b237745
|
Scott Ullrich
|
<?=htmlspecialchars($ifinfo['ssid']);?>
|
353 |
|
|
</td>
|
354 |
|
|
</tr><?php endif; ?>
|
355 |
8cccee1c
|
Scott Ullrich
|
<tr>
|
356 |
c26e2cf0
|
Scott Ullrich
|
<td width="22%" class="vncellt">In/out packets</td>
|
357 |
8cccee1c
|
Scott Ullrich
|
<td width="78%" class="listr">
|
358 |
|
|
<?=htmlspecialchars($ifinfo['inpkts'] . "/" . $ifinfo['outpkts'] . " (" .
|
359 |
8c3e8725
|
Scott Ullrich
|
format_bytes($ifinfo['inbytes']) . "/" . format_bytes($ifinfo['outbytes']) . ")");?>
|
360 |
5b237745
|
Scott Ullrich
|
</td>
|
361 |
|
|
</tr><?php if (isset($ifinfo['inerrs'])): ?>
|
362 |
8cccee1c
|
Scott Ullrich
|
<tr>
|
363 |
c26e2cf0
|
Scott Ullrich
|
<td width="22%" class="vncellt">In/out errors</td>
|
364 |
8cccee1c
|
Scott Ullrich
|
<td width="78%" class="listr">
|
365 |
5b237745
|
Scott Ullrich
|
<?=htmlspecialchars($ifinfo['inerrs'] . "/" . $ifinfo['outerrs']);?>
|
366 |
|
|
</td>
|
367 |
|
|
</tr><?php endif; ?><?php if (isset($ifinfo['collisions'])): ?>
|
368 |
8cccee1c
|
Scott Ullrich
|
<tr>
|
369 |
c26e2cf0
|
Scott Ullrich
|
<td width="22%" class="vncellt">Collisions</td>
|
370 |
8cccee1c
|
Scott Ullrich
|
<td width="78%" class="listr">
|
371 |
5b237745
|
Scott Ullrich
|
<?=htmlspecialchars($ifinfo['collisions']);?>
|
372 |
|
|
</td>
|
373 |
|
|
</tr><?php endif; ?>
|
374 |
|
|
<?php endif; ?>
|
375 |
|
|
<?php $i++; endforeach; ?>
|
376 |
|
|
</table>
|
377 |
d290167c
|
Seth Mos
|
<br/>
|
378 |
c26e2cf0
|
Scott Ullrich
|
</strong>Using dial-on-demand will bring the connection up again if any packet
|
379 |
8cccee1c
|
Scott Ullrich
|
triggers it. To substantiate this point: disconnecting manually
|
380 |
c26e2cf0
|
Scott Ullrich
|
will <strong>not</strong> prevent dial-on-demand from making connections
|
381 |
8c3e8725
|
Scott Ullrich
|
to the outside! Don't use dial-on-demand if you want to make sure that the line
|
382 |
|
|
is kept disconnected.
|
383 |
eb9b9c5c
|
Scott Ullrich
|
<p>
|
384 |
987fe4ba
|
Scott Ullrich
|
<span class="red"><strong>Note:</strong></span> In/out counters will wrap at 32bit (4 Gigabyte) ! <br/>
|
385 |
20d1251d
|
Scott Ullrich
|
|
386 |
555d3758
|
Scott Ullrich
|
<meta http-equiv="refresh" content="120;url=<?php print $_SERVER['SCRIPT_NAME']; ?>">
|
387 |
20d1251d
|
Scott Ullrich
|
|
388 |
5b237745
|
Scott Ullrich
|
<?php include("fend.inc"); ?>
|