Conntrack

Test suite to validate conntrack-related operations

Test commit keep-contracks command

Description

Test to validate commit keep-conntracks command

Scenario

Step 1: Set the following configuration in DUT1 :

set interfaces ethernet eth0 address 10.0.0.2/24
set protocols static route 0.0.0.0/0 next-hop 10.0.0.1
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address 10.0.0.1/24
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Ping the IP address 10.0.0.1 from DUT1:

admin@DUT1$ ping 10.0.0.1 count 1 size 56 timeout 1
Show output
PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.
64 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=0.760 ms

--- 10.0.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.760/0.760/0.760/0.000 ms

Step 4: Initiate a tcp connection from DUT1 to DUT0 and exchange messages between both endpoints

admin@DUT0$ monitor test connection server 4321 tcp local-interface eth0
admin@DUT1$ monitor test connection client 10.0.0.1 4321 tcp local-interface eth0 source-port 54361

Step 5: Run the command configure on DUT0 and expect no output.

Step 6: Run the command set system alarm TEST on DUT0 and expect no output.

Step 7: Run the command commit keep-conntracks on DUT0 and expect no output.

Step 8: Run the command system conntrack show on DUT0 and check whether the output does not contain the following tokens:

0 flow entries have been shown
Show output
icmp     1 26 src=10.0.0.2 dst=10.0.0.1 type=8 code=0 id=329 packets=1 bytes=84 src=10.0.0.1 dst=10.0.0.2 type=0 code=0 id=329 packets=1 bytes=84 mark=0 use=1
tcp      6 19 TIME_WAIT src=10.0.0.2 dst=10.0.0.1 sport=54361 dport=4321 packets=11 bytes=680 src=10.0.0.1 dst=10.0.0.2 sport=4321 dport=54361 packets=11 bytes=680 [ASSURED] mark=0 use=1
conntrack v1.4.7 (conntrack-tools): 2 flow entries have been shown.