Blame SOURCES/conntrackd.conf

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