![]() |
![]() |
![]() |
![]() |
Get or set the system state
sysctl [-n] name... sysctl [-n] -w name=value... sysctl [-n] -a|A
set ipttl=`sysctl -n net.inet.ip.ttl`
The sysctl utility retrieves the system state and allows processes with appropriate privilege to set the system state. The state to be retrieved or set is described using a Management Information Base (MIB) stylename, described as a dotted set of components.
The information available from sysctl consists of integers and tables. The tabular information can only be retrieved by special purpose programs such as netstat and arp. The integer information is summarized below. For a detailed description of these variable see sysctl(). The changeable column indicates whether a process with appropriate privilege can change the value.
Name Type Changeable net.inet.ip.forwarding integer yes net.inet.ip.redirect integer yes net.inet.ip.ttl integer yes net.inet.ip.forwsrcrt integer yes net.inet.ip.directed-broadcast integer yes net.inet.ip.allowsrcrt integer yes net.inet.ip.subnetsarelocal integer yes net.inet.ip.mtudisc integer yes net.inet.ip.maxfragpackets integer yes net.inet.ip.sourcecheck integer yes net.inet.ip.sourcecheck_logint integer yes net.inet.icmp.maskrepl integer yes net.inet.tcp.rfc1323 integer yes net.inet.tcp.sendspace integer yes net.inet.tcp.recvspace integer yes net.inet.tcp.mssdflt integer yes net.inet.tcp.syn_cache_limit integer yes net.inet.tcp.syn_bucket_limit integer yes net.inet.tcp.syn_cache_interval integer yes net.inet.udp.checksum integer yes net.inet.udp.sendspace integer yes net.inet.udp.recvspace integer yes
Check to see if the UDP checksum is enabled:
sysctl net.inet.udp.checksum
Enable IP forwarding so that the host acts as a router:
sysctl -w net.inet.ip.forwarding=1
![]() |
![]() |
![]() |
![]() |