- add back fc2 repos for now (to support 3.x node installations for now)
[nodeconfig.git] / sysctl.php
1 <?php
2 //
3 // /etc/sysctl.conf generator
4 //
5 // Mark Huang <mlhuang@cs.princeton.edu>
6 // Copyright (C) 2006 The Trustees of Princeton University
7 //
8 // $Id: sysctl.php,v 1.1 2006/11/06 22:02:17 mlhuang Exp $
9 //
10
11 // Get admin API handle
12 require_once 'plc_api.php';
13 global $adm;
14
15 $ip_forward = 0;
16
17 // Look up the node
18 $nodenetworks = $adm->GetNodeNetworks(array('ip' => $_SERVER['REMOTE_ADDR']));
19 if (!empty($nodenetworks)) {
20   $nodes = $adm->GetNodes(array($nodenetworks[0]['node_id']));
21   if (!empty($nodes)) {
22     $node = $nodes[0];
23     $nodenetworks = $adm->GetNodeNetworks($node['nodenetwork_ids']);
24     foreach ($nodenetworks as $nodenetwork) {
25       // Nodes with proxy socket interfaces need to be able to forward
26       // between the fake proxy0 interface and the real interface.
27       if ($nodenetwork['method'] == 'proxy') {
28         $ip_forward = 1;
29         break;
30       }
31     }
32   }
33 }
34
35 ?>
36
37 # Kernel sysctl configuration file for Red Hat Linux
38 #
39 # For binary values, 0 is disabled, 1 is enabled.  See sysctl(8) and
40 # sysctl.conf(5) for more details.
41
42 # Controls IP packet forwarding
43 net.ipv4.ip_forward = <?php echo $ip_forward; ?>
44
45 # Controls source route verification
46 net.ipv4.conf.default.rp_filter = 1
47
48 # Controls the System Request debugging functionality of the kernel
49 kernel.sysrq = 0
50
51 # Controls whether core dumps will append the PID to the core filename.
52 # Useful for debugging multi-threaded applications.
53 kernel.core_uses_pid = 1
54
55 # TCP window scaling and broken routers
56 net.ipv4.tcp_moderate_rcvbuf=0
57 net.ipv4.tcp_default_win_scale=0
58 net.ipv4.tcp_window_scaling=0
59
60 # Mark only out of window RST segments as INVALID. This setting, among
61 # other things, allows data to be sent with SYN packets.
62 net.ipv4.netfilter.ip_conntrack_tcp_be_liberal=1