<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.christophchamp.com/index.php?action=history&amp;feed=atom&amp;title=Sysctl</id>
		<title>Sysctl - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.christophchamp.com/index.php?action=history&amp;feed=atom&amp;title=Sysctl"/>
		<link rel="alternate" type="text/html" href="http://wiki.christophchamp.com/index.php?title=Sysctl&amp;action=history"/>
		<updated>2026-04-30T13:42:19Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.26.2</generator>

	<entry>
		<id>http://wiki.christophchamp.com/index.php?title=Sysctl&amp;diff=6478&amp;oldid=prev</id>
		<title>Christoph: Created page with &quot;'''sysctl''' is an interface for examining and dynamically changing parameters in Unix-like operating systems. The Linux implementation primarily uses files contained in a...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wiki.christophchamp.com/index.php?title=Sysctl&amp;diff=6478&amp;oldid=prev"/>
				<updated>2016-01-14T02:14:34Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;sysctl&amp;#039;&amp;#039;&amp;#039; is an interface for examining and dynamically changing parameters in Unix-like operating systems. The &lt;a href=&quot;/index.php?title=Linux&quot; title=&quot;Linux&quot;&gt;Linux&lt;/a&gt; implementation primarily uses files contained in a...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;'''sysctl''' is an interface for examining and dynamically changing parameters in Unix-like operating systems. The [[Linux]] implementation primarily uses files contained in a virtual file system. In Linux, the sysctl interface mechanism is also exported as part of procfs under the /proc/sys directory (not to be confused with the /sys directory). This difference means checking the value of some parameter requires opening a file in a virtual file system, reading its contents, parsing them and closing the file. The sysctl system call does exist on Linux, but does not have a wrapping function in glibc and is not recommended for use.&lt;br /&gt;
&lt;br /&gt;
==How to enable IP forwarding in Linux==&lt;br /&gt;
&lt;br /&gt;
Most modern Linux distributions will have IP forwarding disabled by default. For a normal desktop/laptop setup, one does not usually need IP forwarding. However, if one is setting up a router/gateway or a VPN server, one needs to enable IP forwarding.&lt;br /&gt;
&lt;br /&gt;
* Check if IP Forwarding is enabled&lt;br /&gt;
&lt;br /&gt;
One must query the sysctl kernel value &amp;quot;&amp;lt;code&amp;gt;net.ipv4.ip_forward&amp;lt;/code&amp;gt;&amp;quot; to see if forwarding is enabled or not:&lt;br /&gt;
&lt;br /&gt;
 $ sysctl net.ipv4.ip_forward&lt;br /&gt;
 net.ipv4.ip_forward = 0&lt;br /&gt;
 #~OR~&lt;br /&gt;
 $ cat /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
 0&lt;br /&gt;
&lt;br /&gt;
The output of both of the above commands shows that IP forwarding is disabled on this system (i.e., the value of &amp;quot;0&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
* Enable IP forwarding (non-persistent)&lt;br /&gt;
&lt;br /&gt;
One can change any sysctl kernel parameter and have it go into effect immediately without rebooting the system:ng the system):&lt;br /&gt;
&lt;br /&gt;
 $ sysctl -w net.ipv4.ip_forward=1&lt;br /&gt;
 #~OR~&lt;br /&gt;
 $ echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
&lt;br /&gt;
Note, however, the setting will not be preserved after rebooting the system.&lt;br /&gt;
&lt;br /&gt;
* Enable IP forwarding (persistently)&lt;br /&gt;
&lt;br /&gt;
If one wishes to enable IP forwarding persistently (i.e., the change will remain after a reboot), one should add the sysctl kernel parameter setting desired to the &amp;lt;code&amp;gt;/etc/sysctl.conf&amp;lt;/code&amp;gt; file:&lt;br /&gt;
If we want to make this configuration permanent the best way to do it is using the file /etc/sysctl.conf where we can add a line containing net.ipv4.ip_forward = 1&lt;br /&gt;
&lt;br /&gt;
 $ echo &amp;quot;net.ipv4.ip_forward = 1&amp;quot; &amp;gt;&amp;gt;/etc/sysctl.conf:&lt;br /&gt;
&lt;br /&gt;
Note: One should preferably first check that there is not already a line in that file with a value of &amp;quot;0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
To enable the changes made in &amp;lt;code&amp;gt;sysctl.conf&amp;lt;/code&amp;gt;, one needs to run the command:&lt;br /&gt;
&lt;br /&gt;
 $ sysctl -p /etc/sysctl.conf&lt;br /&gt;
&lt;br /&gt;
On RedHat-based systems, this is also enabled when restarting the network service:&lt;br /&gt;
&lt;br /&gt;
 $ service network restart&lt;br /&gt;
&lt;br /&gt;
and on Debian/Ubuntu systems this can be also done restarting the procps service:&lt;br /&gt;
&lt;br /&gt;
 $ /etc/init.d/procps.sh restart&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://klaver.it/linux/sysctl.conf sysctl.conf example for Linux]&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux Command Line Tools]]&lt;/div&gt;</summary>
		<author><name>Christoph</name></author>	</entry>

	</feed>