6 // Get admin API handle
7 require_once 'plc_api.php';
13 // backwards compatibility with the old 4.2 API
14 global $__PLC_API_VERSION;
15 if ( ! method_exists ($adm,"GetInterfaces"))
16 $__PLC_API_VERSION = 4.2;
18 $__PLC_API_VERSION = 4.3;
20 if ($__PLC_API_VERSION==4.2)
21 $interfaces = $adm->GetNodeNetworks(array('ip' => $_SERVER['REMOTE_ADDR']));
23 $interfaces = $adm->GetInterfaces(array('ip' => $_SERVER['REMOTE_ADDR']));
25 if (!empty($interfaces)) {
26 $nodes = $adm->GetNodes(array($interfaces[0]['node_id']));
29 if ($__PLC_API_VERSION==4.2)
30 $interfaces = $adm->GetInterfaces($node['nodenetwork_ids']);
32 $interfaces = $adm->GetInterfaces($node['interface_ids']);
34 foreach ($interfaces as $interface) {
35 // Nodes with proxy socket interfaces need to be able to forward
36 // between the fake proxy0 interface and the real interface.
37 if ($interface['method'] == 'proxy') {
49 # sysctl configuration file to optionally enable/disable IP forwarding
51 # For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
52 # sysctl.conf(5) for more details.
54 # This file is generated by NodeManager Configuration Files...
55 # do not manually edit
58 # Controls IP packet forwarding
59 net.ipv4.ip_forward = <?php echo $ip_forward; ?>