Blame SOURCES/conntrackd.conf

7d290b
7d290b
# See also: http://conntrack-tools.netfilter.org/support.html
7d290b
# 
7d290b
# There are 3 different modes of running conntrackd: "alarm", "notrack" and "ftfw"
7d290b
#
7d290b
# The default package ships with a FTFW configuration, see /usr/share/doc/conntrackd*
7d290b
# for example configurations for other modes.
7d290b
7d290b
7d290b
#
7d290b
# Synchronizer settings
7d290b
#
7d290b
Sync {
7d290b
	Mode FTFW {
7d290b
		#
7d290b
		# Size of the resend queue (in objects). This is the maximum
7d290b
		# number of objects that can be stored waiting to be confirmed
7d290b
		# via acknoledgment. If you keep this value low, the daemon
7d290b
		# will have less chances to recover state-changes under message
7d290b
		# omission. On the other hand, if you keep this value high,
7d290b
		# the daemon will consume more memory to store dead objects.
7d290b
		# Default is 131072 objects.
7d290b
		#
7d290b
		# ResendQueueSize 131072
7d290b
7d290b
		#
7d290b
		# This parameter allows you to set an initial fixed timeout
7d290b
		# for the committed entries when this node goes from backup
7d290b
		# to primary. This mechanism provides a way to purge entries
7d290b
		# that were not recovered appropriately after the specified
7d290b
		# fixed timeout. If you set a low value, TCP entries in
7d290b
		# Established states with no traffic may hang. For example,
7d290b
		# an SSH connection without KeepAlive enabled. If not set,
7d290b
		# the daemon uses an approximate timeout value calculation
7d290b
		# mechanism. By default, this option is not set.
7d290b
		#
7d290b
		# CommitTimeout 180
7d290b
7d290b
		#
7d290b
		# If the firewall replica goes from primary to backup,
7d290b
		# the conntrackd -t command is invoked in the script. 
7d290b
		# This command schedules a flush of the table in N seconds.
7d290b
		# This is useful to purge the connection tracking table of
7d290b
		# zombie entries and avoid clashes with old entries if you
7d290b
		# trigger several consecutive hand-overs. Default is 60 seconds.
7d290b
		#
7d290b
		# PurgeTimeout 60
7d290b
7d290b
		# Set the acknowledgement window size. If you decrease this
7d290b
		# value, the number of acknowlegdments increases. More
7d290b
		# acknowledgments means more overhead as conntrackd has to
7d290b
		# handle more control messages. On the other hand, if you
7d290b
		# increase this value, the resend queue gets more populated.
7d290b
		# This results in more overhead in the queue releasing.
7d290b
		# The following value is based on some practical experiments
7d290b
		# measuring the cycles spent by the acknowledgment handling
7d290b
		# with oprofile. If not set, default window size is 300.
7d290b
		#
7d290b
		# ACKWindowSize 300
7d290b
7d290b
		#
7d290b
		# This clause allows you to disable the external cache. Thus,
7d290b
		# the state entries are directly injected into the kernel
7d290b
		# conntrack table. As a result, you save memory in user-space
7d290b
		# but you consume slots in the kernel conntrack table for
7d290b
		# backup state entries. Moreover, disabling the external cache
7d290b
		# means more CPU consumption. You need a Linux kernel
7d290b
		# >= 2.6.29 to use this feature. By default, this clause is
7d290b
		# set off. If you are installing conntrackd for first time,
7d290b
		# please read the user manual and I encourage you to consider
7d290b
		# using the fail-over scripts instead of enabling this option!
7d290b
		#
7d290b
		# DisableExternalCache Off
7d290b
	}
7d290b
7d290b
	#
7d290b
	# Multicast IP and interface where messages are
7d290b
	# broadcasted (dedicated link). IMPORTANT: Make sure
7d290b
	# that iptables accepts traffic for destination
7d290b
	# 225.0.0.50, eg:
7d290b
	#
7d290b
	#	iptables -I INPUT -d 225.0.0.50 -j ACCEPT
7d290b
	#	iptables -I OUTPUT -d 225.0.0.50 -j ACCEPT
7d290b
	#
7d290b
	Multicast {
7d290b
		# 
7d290b
		# Multicast address: The address that you use as destination
7d290b
		# in the synchronization messages. You do not have to add
7d290b
		# this IP to any of your existing interfaces. If any doubt,
7d290b
		# do not modify this value.
7d290b
		#
7d290b
		IPv4_address 225.0.0.50
7d290b
7d290b
		#
7d290b
		# The multicast group that identifies the cluster. If any
7d290b
		# doubt, do not modify this value.
7d290b
		#
7d290b
		Group 3780
7d290b
7d290b
		#
7d290b
		# IP address of the interface that you are going to use to
7d290b
		# send the synchronization messages. Remember that you must
7d290b
		# use a dedicated link for the synchronization messages.
7d290b
		#
7d290b
		IPv4_interface 192.168.100.100
7d290b
7d290b
		#
7d290b
		# The name of the interface that you are going to use to
7d290b
		# send the synchronization messages.
7d290b
		#
7d290b
		Interface eth2
7d290b
7d290b
		# The multicast sender uses a buffer to enqueue the packets
7d290b
		# that are going to be transmitted. The default size of this
7d290b
		# socket buffer is available at /proc/sys/net/core/wmem_default.
7d290b
		# This value determines the chances to have an overrun in the
7d290b
		# sender queue. The overrun results packet loss, thus, losing
7d290b
		# state information that would have to be retransmitted. If you
7d290b
		# notice some packet loss, you may want to increase the size
7d290b
		# of the sender buffer. The default size is usually around
7d290b
		# ~100 KBytes which is fairly small for busy firewalls.
7d290b
		#
7d290b
		SndSocketBuffer 1249280
7d290b
7d290b
		# The multicast receiver uses a buffer to enqueue the packets
7d290b
		# that the socket is pending to handle. The default size of this
7d290b
		# socket buffer is available at /proc/sys/net/core/rmem_default.
7d290b
		# This value determines the chances to have an overrun in the
7d290b
		# receiver queue. The overrun results packet loss, thus, losing
7d290b
		# state information that would have to be retransmitted. If you
7d290b
		# notice some packet loss, you may want to increase the size of
7d290b
		# the receiver buffer. The default size is usually around
7d290b
		# ~100 KBytes which is fairly small for busy firewalls.
7d290b
		#
7d290b
		RcvSocketBuffer 1249280
7d290b
7d290b
		# 
7d290b
		# Enable/Disable message checksumming. This is a good
7d290b
		# property to achieve fault-tolerance. In case of doubt, do
7d290b
		# not modify this value.
7d290b
		#
7d290b
		Checksum on
7d290b
	}
7d290b
	#
7d290b
	# You can specify more than one dedicated link. Thus, if one dedicated
7d290b
	# link fails, conntrackd can fail-over to another. Note that adding
7d290b
	# more than one dedicated link does not mean that state-updates will
7d290b
	# be sent to all of them. There is only one active dedicated link at
7d290b
	# a given moment. The `Default' keyword indicates that this interface
7d290b
	# will be selected as the initial dedicated link. You can have 
7d290b
	# up to 4 redundant dedicated links. Note: Use different multicast 
7d290b
	# groups for every redundant link.
7d290b
	#
7d290b
	# Multicast Default {
7d290b
	#	IPv4_address 225.0.0.51
7d290b
	#	Group 3781
7d290b
	#	IPv4_interface 192.168.100.101
7d290b
	#	Interface eth3
7d290b
	#	# SndSocketBuffer 1249280
7d290b
	#	# RcvSocketBuffer 1249280
7d290b
	#	Checksum on
7d290b
	# }
7d290b
7d290b
	#
7d290b
	# You can use Unicast UDP instead of Multicast to propagate events.
7d290b
	# Note that you cannot use unicast UDP and Multicast at the same
7d290b
	# time, you can only select one.
7d290b
	# 
7d290b
	# UDP {
7d290b
		# 
7d290b
		# UDP address that this firewall uses to listen to events.
7d290b
		#
7d290b
		# IPv4_address 192.168.2.100
7d290b
		#
7d290b
		# or you may want to use an IPv6 address:
7d290b
		#
7d290b
		# IPv6_address fe80::215:58ff:fe28:5a27
7d290b
7d290b
		#
7d290b
		# Destination UDP address that receives events, ie. the other
7d290b
		# firewall's dedicated link address.
7d290b
		#
7d290b
		# IPv4_Destination_Address 192.168.2.101
7d290b
		#
7d290b
		# or you may want to use an IPv6 address:
7d290b
		#
7d290b
		# IPv6_Destination_Address fe80::2d0:59ff:fe2a:775c
7d290b
7d290b
		#
7d290b
		# UDP port used
7d290b
		#
7d290b
		# Port 3780
7d290b
7d290b
		#
7d290b
		# The name of the interface that you are going to use to
7d290b
		# send the synchronization messages.
7d290b
		#
7d290b
		# Interface eth2
7d290b
7d290b
		# 
7d290b
		# The sender socket buffer size
7d290b
		#
7d290b
		# SndSocketBuffer 1249280
7d290b
7d290b
		#
7d290b
		# The receiver socket buffer size
7d290b
		#
7d290b
		# RcvSocketBuffer 1249280
7d290b
7d290b
		# 
7d290b
		# Enable/Disable message checksumming. 
7d290b
		#
7d290b
		# Checksum on
7d290b
	# }
7d290b
7d290b
	# 
7d290b
	# Other unsorted options that are related to the synchronization.
7d290b
	# 
7d290b
	# Options {
7d290b
		#
7d290b
		# TCP state-entries have window tracking disabled by default,
7d290b
		# you can enable it with this option. As said, default is off.
7d290b
		# This feature requires a Linux kernel >= 2.6.36.
7d290b
		#
7d290b
		# TCPWindowTracking Off
7d290b
	# }
7d290b
}
7d290b
7d290b
#
7d290b
# General settings
7d290b
#
7d290b
General {
7d290b
	#
7d290b
	# Set the nice value of the daemon, this value goes from -20
7d290b
	# (most favorable scheduling) to 19 (least favorable). Using a
7d290b
	# very low value reduces the chances to lose state-change events.
7d290b
	# Default is 0 but this example file sets it to most favourable
7d290b
	# scheduling as this is generally a good idea. See man nice(1) for
7d290b
	# more information.
7d290b
	#
7d290b
	Nice -20
7d290b
7d290b
	#
7d290b
	# Select a different scheduler for the daemon, you can select between
7d290b
	# RR and FIFO and the process priority (minimum is 0, maximum is 99).
7d290b
	# See man sched_setscheduler(2) for more information. Using a RT
7d290b
	# scheduler reduces the chances to overrun the Netlink buffer.
7d290b
	#
7d290b
	# Scheduler {
7d290b
	#	Type FIFO
7d290b
	#	Priority 99
7d290b
	# }
7d290b
7d290b
	#
7d290b
	# Number of buckets in the cache hashtable. The bigger it is,
7d290b
	# the closer it gets to O(1) at the cost of consuming more memory.
7d290b
	# Read some documents about tuning hashtables for further reference.
7d290b
	#
7d290b
	HashSize 32768
7d290b
7d290b
	#
7d290b
	# Maximum number of conntracks, it should be double of: 
7d290b
	# $ cat /proc/sys/net/netfilter/nf_conntrack_max
7d290b
	# since the daemon may keep some dead entries cached for possible
7d290b
	# retransmission during state synchronization.
7d290b
	#
7d290b
	HashLimit 131072
7d290b
7d290b
	#
7d290b
	# Logfile: on (/var/log/conntrackd.log), off, or a filename
7d290b
	# Default: off
7d290b
	#
7d290b
	LogFile on
7d290b
7d290b
	#
7d290b
	# Syslog: on, off or a facility name (daemon (default) or local0..7)
7d290b
	# Default: off
7d290b
	#
7d290b
	#Syslog on
7d290b
7d290b
	#
7d290b
	# Lockfile
7d290b
	# 
7d290b
	LockFile /var/lock/conntrack.lock
7d290b
7d290b
	#
7d290b
	# Unix socket configuration
7d290b
	#
7d290b
	UNIX {
7d290b
		Path /var/run/conntrackd.ctl
7d290b
		Backlog 20
7d290b
	}
7d290b
7d290b
	#
7d290b
	# Netlink event socket buffer size. If you do not specify this clause,
7d290b
	# the default buffer size value in /proc/net/core/rmem_default is
7d290b
	# used. This default value is usually around 100 Kbytes which is
7d290b
	# fairly small for busy firewalls. This leads to event message dropping
7d290b
	# and high CPU consumption. This example configuration file sets the
7d290b
	# size to 2 MBytes to avoid this sort of problems.
7d290b
	#
7d290b
	NetlinkBufferSize 2097152
7d290b
7d290b
	#
7d290b
	# The daemon doubles the size of the netlink event socket buffer size
7d290b
	# if it detects netlink event message dropping. This clause sets the
7d290b
	# maximum buffer size growth that can be reached. This example file
7d290b
	# sets the size to 8 MBytes.
7d290b
	#
7d290b
	NetlinkBufferSizeMaxGrowth 8388608
7d290b
7d290b
	#
7d290b
	# If the daemon detects that Netlink is dropping state-change events,
7d290b
	# it automatically schedules a resynchronization against the Kernel
7d290b
	# after 30 seconds (default value). Resynchronizations are expensive
7d290b
	# in terms of CPU consumption since the daemon has to get the full
7d290b
	# kernel state-table and purge state-entries that do not exist anymore.
7d290b
	# Be careful of setting a very small value here. You have the following
7d290b
	# choices: On (enabled, use default 30 seconds value), Off (disabled)
7d290b
	# or Value (in seconds, to set a specific amount of time). If not
7d290b
	# specified, the daemon assumes that this option is enabled.
7d290b
	#
7d290b
	# NetlinkOverrunResync On
7d290b
7d290b
	#
7d290b
	# If you want reliable event reporting over Netlink, set on this
7d290b
	# option. If you set on this clause, it is a good idea to set off
7d290b
	# NetlinkOverrunResync. This option is off by default and you need
7d290b
	# a Linux kernel >= 2.6.31.
7d290b
	#
7d290b
	# NetlinkEventsReliable Off
7d290b
7d290b
	# 
7d290b
	# By default, the daemon receives state updates following an
7d290b
	# event-driven model. You can modify this behaviour by switching to
7d290b
	# polling mode with the PollSecs clause. This clause tells conntrackd
7d290b
	# to dump the states in the kernel every N seconds. With regards to
7d290b
	# synchronization mode, the polling mode can only guarantee that
7d290b
	# long-lifetime states are recovered. The main advantage of this method
7d290b
	# is the reduction in the state replication at the cost of reducing the
7d290b
	# chances of recovering connections.
7d290b
	#
7d290b
	# PollSecs 15
7d290b
7d290b
	#
7d290b
	# The daemon prioritizes the handling of state-change events coming
7d290b
	# from the core. With this clause, you can set the maximum number of
7d290b
	# state-change events (those coming from kernel-space) that the daemon
7d290b
	# will handle after which it will handle other events coming from the
7d290b
	# network or userspace. A low value improves interactivity (in terms of
7d290b
	# real-time behaviour) at the cost of extra CPU consumption.
7d290b
	# Default (if not set) is 100.
7d290b
	#
7d290b
	# EventIterationLimit 100
7d290b
7d290b
	#
7d290b
	# Event filtering: This clause allows you to filter certain traffic,
7d290b
	# There are currently three filter-sets: Protocol, Address and
7d290b
	# State. The filter is attached to an action that can be: Accept or
7d290b
	# Ignore. Thus, you can define the event filtering policy of the
7d290b
	# filter-sets in positive or negative logic depending on your needs.
7d290b
	# You can select if conntrackd filters the event messages from 
7d290b
	# user-space or kernel-space. The kernel-space event filtering
7d290b
	# saves some CPU cycles by avoiding the copy of the event message
7d290b
	# from kernel-space to user-space. The kernel-space event filtering
7d290b
	# is prefered, however, you require a Linux kernel >= 2.6.29 to
7d290b
	# filter from kernel-space. If you want to select kernel-space 
7d290b
	# event filtering, use the keyword 'Kernelspace' instead of 
7d290b
	# 'Userspace'.
7d290b
	#
7d290b
	Filter From Userspace {
7d290b
		#
7d290b
		# Accept only certain protocols: You may want to replicate
7d290b
		# the state of flows depending on their layer 4 protocol.
7d290b
		#
7d290b
		Protocol Accept {
7d290b
			TCP
7d290b
			SCTP
7d290b
			DCCP
7d290b
			# UDP
7d290b
			# ICMP # This requires a Linux kernel >= 2.6.31
7d290b
			# IPv6-ICMP # This requires a Linux kernel >= 2.6.31
7d290b
		}
7d290b
7d290b
		#
7d290b
		# Ignore traffic for a certain set of IP's: Usually all the
7d290b
		# IP assigned to the firewall since local traffic must be
7d290b
		# ignored, only forwarded connections are worth to replicate.
7d290b
		# Note that these values depends on the local IPs that are
7d290b
		# assigned to the firewall.
7d290b
		#
7d290b
		Address Ignore {
7d290b
			IPv4_address 127.0.0.1 # loopback
7d290b
			IPv4_address 192.168.0.100 # virtual IP 1
7d290b
			IPv4_address 192.168.1.100 # virtual IP 2
7d290b
			IPv4_address 192.168.0.1
7d290b
			IPv4_address 192.168.1.1
7d290b
			IPv4_address 192.168.100.100 # dedicated link ip
7d290b
			#
7d290b
			# You can also specify networks in format IP/cidr.
7d290b
			# IPv4_address 192.168.0.0/24
7d290b
			#
7d290b
			# You can also specify an IPv6 address
7d290b
			# IPv6_address ::1
7d290b
		}
7d290b
7d290b
		#
7d290b
		# Uncomment this line below if you want to filter by flow state.
7d290b
		# This option introduces a trade-off in the replication: it
7d290b
		# reduces CPU consumption at the cost of having lazy backup 
7d290b
		# firewall replicas. The existing TCP states are: SYN_SENT,
7d290b
		# SYN_RECV, ESTABLISHED, FIN_WAIT, CLOSE_WAIT, LAST_ACK,
7d290b
		# TIME_WAIT, CLOSED, LISTEN.
7d290b
		#
7d290b
		# State Accept {
7d290b
		#	ESTABLISHED CLOSED TIME_WAIT CLOSE_WAIT for TCP
7d290b
		# }
7d290b
	}
7d290b
}