Blame SOURCES/conntrackd.conf

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