3 // /etc/sysctl.conf generator
5 // Mark Huang <mlhuang@cs.princeton.edu>
6 // Copyright (C) 2006 The Trustees of Princeton University
11 // Get admin API handle
12 require_once 'plc_api.php';
18 // backwards compatibility with the old 4.2 API
19 global $__PLC_API_VERSION;
20 if ( ! method_exists ($adm,"GetInterfaces"))
21 $__PLC_API_VERSION = 4.2;
23 $__PLC_API_VERSION = 4.3;
25 if ($__PLC_API_VERSION==4.2)
26 $interfaces = $adm->GetNodeNetworks(array('ip' => $_SERVER['REMOTE_ADDR']));
28 $interfaces = $adm->GetInterfaces(array('ip' => $_SERVER['REMOTE_ADDR']));
30 if (!empty($interfaces)) {
31 $nodes = $adm->GetNodes(array($interfaces[0]['node_id']));
34 if ($__PLC_API_VERSION==4.2)
35 $interfaces = $adm->GetInterfaces($node['nodenetwork_ids']);
37 $interfaces = $adm->GetInterfaces($node['interface_ids']);
39 foreach ($interfaces as $interface) {
40 // Nodes with proxy socket interfaces need to be able to forward
41 // between the fake proxy0 interface and the real interface.
42 if ($interface['method'] == 'proxy') {
52 # Kernel sysctl configuration file for Red Hat Linux
54 # For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
55 # sysctl.conf(5) for more details.
59 # Controls IP packet forwarding
60 net.ipv4.ip_forward = <?php echo $ip_forward; ?>
62 # Controls source route verification
63 net.ipv4.conf.default.rp_filter = 1
65 # Controls the System Request debugging functionality of the kernel
68 # Controls whether core dumps will append the PID to the core filename.
69 # Useful for debugging multi-threaded applications.
70 kernel.core_uses_pid = 1
72 # TCP window scaling and broken routers
73 net.ipv4.tcp_moderate_rcvbuf=0
74 net.ipv4.tcp_default_win_scale=0
75 net.ipv4.tcp_window_scaling=0
77 # Mark only out of window RST segments as INVALID. This setting, among
78 # other things, allows data to be sent with SYN packets.
79 net.ipv4.netfilter.ip_conntrack_tcp_be_liberal=1
81 # Fixes dst cache overflow bug
82 net.ipv4.route.max_size=262144