Firewall functions: IPTABLES
U
SER
G
UIDE
188
show conntrack
that can be used in the following modalities
show conntrack all
shows all the active sessions.
To select a subset of the active sessions, you can apply the following filters:
show conntrack from ADDR
shows the active sessions that are originated by the specified address
show conntrack from ADDR1 to ADDR2
shows the active sessions that are originated from
ADDR1
to
ADDR2
show conntrack proto PROT
shows the active sessions that are originated by the specified protocol
show conntrack proto PROTO from ADDR source-port PORT to ADDR dest-port PORT
shows the sessions related to the specified protocol, with the specified address and destinations.
PROT
values can be
icmp
,
udp
,
tcp
or
any
ADDR
can be a valid IP address or the keyword
any
.
PORT
can be any port number or the keyword
any
Displays can be restricted only to the sessions for which a Source Nat operation has been made by:
show conntrack snat
show conntrack snat from ADDR
show conntrack snat from ADDR1 to ADDR2
show conntrack snat proto PROT
show conntrack snat proto PROTO from ADDR source-port PORT to ADDR dest-port
PORT
It is possible to display only the sessions for which a Dest-Nat operation has been made by:
show conntrack dnat
show conntrack dnat from ADDR
show conntrack dnat from ADDR1 to ADDR2
show conntrack dnat proto PROT
show conntrack dnat proto PROTO from ADDR source-port PORT to ADDR dest-port PORT
Stateful NAT
The modality Stateful NAT, when configured and activated, allows to periodically exchange the
tables containing the connections of two or more routers. Each one will keep in memory two tables:
the first will store the locally created
connection track
, while the second will store the connections
created by other routers.
Let‟s do an example: if you have a redundant configuration in which you have a Master router and
another that is a Backup one, if the first has problems and show a failover, the Backup will start up,
but the active connections will not be cut off. You can achieve this just using the
vrrp
and the
stateful-nat
functionalities.