Tuesday, July 3, 2018

Conntrackd connection sync checking.

Setup:
Setup is a redundant router setup with one master router and one backup router.


Before making connection  (ssh to VM which is behind this nat router) the conntrackd states:
1. -i shows the internal connection states
2. -e shows the external connection states

For master the connection will be internal. For backup the connection entries will be external because it is synced from master. 

root@r-15-JAY:~# checkrouter.sh
Status: MASTER
root@r-15-JAY:~# conntrackd -i
root@r-15-JAY:~# conntrackd -e
root@r-15-JAY:~# conntrackd -s
cache internal:
current active connections:               0
connections created:                  15    failed:               0
connections updated:                  39    failed:               0
connections destroyed:                  15    failed:               0

cache external:
current active connections:               0
connections created:                   3    failed:               0
connections updated:                   2    failed:               0
connections destroyed:                   3    failed:               0

traffic processed:
                   0 Bytes                         0 Pckts

multicast traffic (active device=eth0):
               86876 Bytes sent                26508 Bytes recv
                8749 Pckts sent                 1638 Pckts recv
                   0 Error send                    0 Error recv

message tracking:
                   0 Malformed msgs                    0 Lost msgs


root@r-16-JAY:~# checkrouter.sh
Status: BACKUP
root@r-16-JAY:~# conntrackd -i
root@r-16-JAY:~# conntrackd -e
root@r-16-JAY:~# conntrackd -s
cache internal:
current active connections:               0
connections created:                   0    failed:               0
connections updated:                   0    failed:               0
connections destroyed:                   0    failed:               0

cache external:
current active connections:               0
connections created:                  11    failed:               0
connections updated:                  38    failed:               0
connections destroyed:                  11    failed:               0

traffic processed:
                   0 Bytes                         0 Pckts

multicast traffic (active device=eth0):
               21576 Bytes sent                25324 Bytes recv
                1354 Pckts sent                 1398 Pckts recv
                   0 Error send                    0 Error recv

message tracking:
                   0 Malformed msgs                    0 Lost msgs

After ssh connection is made to VM which is behind the router:

root@r-15-JAY:~# conntrackd -i
tcp      6 ESTABLISHED src=10.233.88.78 dst=10.147.52.202 sport=63913 dport=22 src=10.1.1.218 dst=10.233.88.78 sport=22 dport=63913 [ASSURED] mark=2 [active since 5s]
root@r-15-JAY:~# conntrackd -e
root@r-15-JAY:~# conntrackd -s
cache internal:
current active connections:               1
connections created:                  16    failed:               0
connections updated:                  41    failed:               0
connections destroyed:                  15    failed:               0

cache external:
current active connections:               0
connections created:                   3    failed:               0
connections updated:                   2    failed:               0
connections destroyed:                   3    failed:               0

traffic processed:
                   0 Bytes                         0 Pckts

multicast traffic (active device=eth0):
               88040 Bytes sent                27452 Bytes recv
                8811 Pckts sent                 1697 Pckts recv
                   0 Error send                    0 Error recv

message tracking:
                   0 Malformed msgs                    0 Lost msgs
root@r-16-JAY:~# conntrackd -e
tcp      6 ESTABLISHED src=10.233.88.78 dst=10.147.52.202 sport=63913 dport=22 [ASSURED] mark=2 [active since 11s]
root@r-16-JAY:~# conntrackd -i
root@r-16-JAY:~# conntrackd -s
cache internal:
current active connections:               0   ------------------- Here connection is not active.
connections created:                   0    failed:               0
connections updated:                   0    failed:               0
connections destroyed:                   0    failed:               0

cache external:
current active connections:               1
connections created:                  12    failed:               0
connections updated:                  40    failed:               0
connections destroyed:                  11    failed:               0

traffic processed:
                   0 Bytes                         0 Pckts

multicast traffic (active device=eth0):
               22152 Bytes sent                26096 Bytes recv
                1390 Pckts sent                 1436 Pckts recv
                   0 Error send                    0 Error recv

message tracking:
                   0 Malformed msgs                    0 Lost msgs

root@r-16-JAY:~#

When there is switch (Backup becomes Master) the conntrack active since will be reset in the new Master.

No comments:

Post a Comment