Blame SOURCES/conntrackd.conf

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