Blame SOURCES/conntrackd.conf

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