Blame SOURCES/conntrackd.conf

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