Conntag

The following scenarios show how to configure traffic policies using the conntag feature. Conntag allows tagging conntrack entries with string values (up to 255 characters) for traffic classification and filtering. This is similar to connmark but uses human-readable string tags instead of numeric marks.

../../../_images/topology34.svg

Test Policy Set Conntag Basic

Description

In this scenario, an ingress traffic policy is configured in DUT0 to set a basic conntag string on incoming packets. The conntag value is stored in the conntrack entry and can be verified using the system conntrack show command.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 vif 100 address 10.0.0.1/24
set interfaces ethernet eth0 vif 100 traffic policy in POLICY_IN
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set traffic policy POLICY_IN rule 1 set conntag my-traffic-tag

Step 2: Set the following configuration in DUT1 :

set interfaces ethernet eth0 vif 100 address 10.0.0.2/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.620 ms

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

Step 4: Run the command system conntrack clear on DUT0 and expect the following output:

Show output
Connection tracking table has been emptied

Step 5: Ping the IP address 10.0.0.1 from DUT1:

admin@DUT1$ ping 10.0.0.1 count 3 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.828 ms
64 bytes from 10.0.0.1: icmp_seq=2 ttl=64 time=0.328 ms
64 bytes from 10.0.0.1: icmp_seq=3 ttl=64 time=0.311 ms

--- 10.0.0.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2026ms
rtt min/avg/max/mdev = 0.311/0.489/0.828/0.239 ms

Step 6: Run the command system conntrack show on DUT0 and check whether the output contains the following tokens:

conntag=my-traffic-tag
Show output
icmp     1 29 src=10.0.0.2 dst=10.0.0.1 type=8 code=0 id=151 packets=3 bytes=252 src=10.0.0.1 dst=10.0.0.2 type=0 code=0 id=151 packets=3 bytes=252 mark=0 conntag=my-traffic-tag use=1
conntrack v1.4.7 (conntrack-tools): 1 flow entries have been shown.

Test Policy Set Conntag With Numbers

Description

This scenario tests setting a conntag that includes numeric characters mixed with text, demonstrating that conntag values can contain alphanumeric strings with hyphens.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 vif 100 address 10.0.0.1/24
set interfaces ethernet eth0 vif 100 traffic policy in POLICY_IN
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set traffic policy POLICY_IN rule 1 set conntag traffic-123-test

Step 2: Set the following configuration in DUT1 :

set interfaces ethernet eth0 vif 100 address 10.0.0.2/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=2.49 ms

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

Step 4: Run the command system conntrack clear on DUT0 and expect the following output:

Show output
Connection tracking table has been emptied

Step 5: Ping the IP address 10.0.0.1 from DUT1:

admin@DUT1$ ping 10.0.0.1 count 3 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.497 ms
64 bytes from 10.0.0.1: icmp_seq=2 ttl=64 time=0.333 ms
64 bytes from 10.0.0.1: icmp_seq=3 ttl=64 time=0.287 ms

--- 10.0.0.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2055ms
rtt min/avg/max/mdev = 0.287/0.372/0.497/0.090 ms

Step 6: Run the command system conntrack show on DUT0 and check whether the output contains the following tokens:

conntag=traffic-123-test
Show output
icmp     1 29 src=10.0.0.2 dst=10.0.0.1 type=8 code=0 id=153 packets=3 bytes=252 src=10.0.0.1 dst=10.0.0.2 type=0 code=0 id=153 packets=3 bytes=252 mark=0 conntag=traffic-123-test use=1
conntrack v1.4.7 (conntrack-tools): 1 flow entries have been shown.

Test Policy Set Conntag Special Characters

Description

This scenario tests setting a conntag that includes special characters like underscores, dots, and hyphens, which are commonly used in application versioning and environment naming.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 vif 100 address 10.0.0.1/24
set interfaces ethernet eth0 vif 100 traffic policy in POLICY_IN
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set traffic policy POLICY_IN rule 1 set conntag app_v2.0-prod

Step 2: Set the following configuration in DUT1 :

set interfaces ethernet eth0 vif 100 address 10.0.0.2/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.517 ms

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

Step 4: Run the command system conntrack clear on DUT0 and expect the following output:

Show output
Connection tracking table has been emptied

Step 5: Ping the IP address 10.0.0.1 from DUT1:

admin@DUT1$ ping 10.0.0.1 count 3 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.514 ms
64 bytes from 10.0.0.1: icmp_seq=2 ttl=64 time=0.359 ms
64 bytes from 10.0.0.1: icmp_seq=3 ttl=64 time=0.408 ms

--- 10.0.0.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2035ms
rtt min/avg/max/mdev = 0.359/0.427/0.514/0.064 ms

Step 6: Run the command system conntrack show on DUT0 and check whether the output contains the following tokens:

conntag=app_v2.0-prod
Show output
icmp     1 29 src=10.0.0.2 dst=10.0.0.1 type=8 code=0 id=155 packets=3 bytes=252 src=10.0.0.1 dst=10.0.0.2 type=0 code=0 id=155 packets=3 bytes=252 mark=0 conntag=app_v2.0-prod use=1
conntrack v1.4.7 (conntrack-tools): 1 flow entries have been shown.

Test Policy Set Conntag Maximum Length

Description

This scenario tests the conntag feature with the maximum allowed string length of 255 characters. The system should accept and correctly store strings up to this limit.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 vif 100 address 10.0.0.1/24
set interfaces ethernet eth0 vif 100 traffic policy in POLICY_IN
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set traffic policy POLICY_IN rule 1 set conntag Lorem-ipsum-dolor-sit-amet-consectetur-adipiscing-elit-sed-do-eiusmod-tempor-incididunt-ut-labore-et-dolore-magna-aliqua-Ut-enim-ad-minim-veniam-quis-nostrud-exercitation-ullamco-laboris-nisi-ut-aliquip-ex-ea-commodo-consequat-Duis-aute-irure-dolor-len255

Step 2: Set the following configuration in DUT1 :

set interfaces ethernet eth0 vif 100 address 10.0.0.2/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.628 ms

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

Step 4: Run the command system conntrack clear on DUT0 and expect the following output:

Show output
Connection tracking table has been emptied

Step 5: Ping the IP address 10.0.0.1 from DUT1:

admin@DUT1$ ping 10.0.0.1 count 3 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.552 ms
64 bytes from 10.0.0.1: icmp_seq=2 ttl=64 time=0.379 ms
64 bytes from 10.0.0.1: icmp_seq=3 ttl=64 time=0.363 ms

--- 10.0.0.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2048ms
rtt min/avg/max/mdev = 0.363/0.431/0.552/0.085 ms

Step 6: Run the command system conntrack show on DUT0 and expect the following output:

Show output
icmp     1 29 src=10.0.0.2 dst=10.0.0.1 type=8 code=0 id=157 packets=3 bytes=252 src=10.0.0.1 dst=10.0.0.2 type=0 code=0 id=157 packets=3 bytes=252 mark=0 conntag=Lorem-ipsum-dolor-sit-amet-consectetur-adipiscing-elit-sed-do-eiusmod-tempor-incididunt-ut-labore-et-dolore-magna-aliqua-Ut-enim-ad-minim-veniam-quis-nostrud-exercitation-ullamco-laboris-nisi-ut-aliquip-ex-ea-commodo-consequat-Duis-aute-
irure-dolor-len255 use=1
conntrack v1.4.7 (conntrack-tools): 1 flow entries have been shown.

Test Policy Set Conntag Invalid Length

Description

This scenario tests that the system correctly rejects conntag strings that exceed the maximum allowed length of 255 characters with an appropriate error message.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 vif 100 address 10.0.0.1/24
set interfaces ethernet eth0 vif 100 traffic policy in POLICY_IN
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set traffic policy POLICY_IN

Step 2: Expect a failure in the following command: Run the command set traffic policy POLICY_IN rule 1 set conntag Lorem-ipsum-dolor-sit-amet-consectetur-adipiscing-elit-sed-do-eiusmod-tempor-incididunt-ut-labore-et-dolore-magna-aliqua-Ut-enim-ad-minim-veniam-quis-nostrud-exercitation-ullamco-laboris-nisi-ut-aliquip-ex-ea-commodo-consequat-Duis-aute-irure-dolor-len_256 on DUT0 and expect the following output:

Show output
tag string must be 1..255 non-space printable characters
Value validation failed
CLI Error: Command error

Test Policy Set Conntag Empty String

Description

This scenario tests that the system correctly rejects empty or whitespace-only conntag strings.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 vif 100 address 10.0.0.1/24
set interfaces ethernet eth0 vif 100 traffic policy in POLICY_IN
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set traffic policy POLICY_IN

Step 2: Run the command configure on DUT0 and expect the following output:

Show output
admin@osdx#

Step 3: Run the command set traffic policy POLICY_IN rule 1 set conntag on DUT0 and check whether the output contains the following tokens:

requires a value
Show output
Configuration path: [traffic policy POLICY_IN rule 1 set conntag] requires a value
CLI Error: Command error

Test Policy Set Conntag With Connmark

Description

This scenario demonstrates using both conntag and connmark together on the same traffic flow. This allows numeric classification (connmark) alongside descriptive string tagging (conntag) for comprehensive traffic identification.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 vif 100 address 10.0.0.1/24
set interfaces ethernet eth0 vif 100 traffic policy in POLICY_IN
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set traffic policy POLICY_IN rule 1 set connmark 42
set traffic policy POLICY_IN rule 1 set conntag my-traffic-tag

Step 2: Set the following configuration in DUT1 :

set interfaces ethernet eth0 vif 100 address 10.0.0.2/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.388 ms

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

Step 4: Run the command system conntrack clear on DUT0 and expect the following output:

Show output
Connection tracking table has been emptied

Step 5: Ping the IP address 10.0.0.1 from DUT1:

admin@DUT1$ ping 10.0.0.1 count 3 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.410 ms
64 bytes from 10.0.0.1: icmp_seq=2 ttl=64 time=0.255 ms
64 bytes from 10.0.0.1: icmp_seq=3 ttl=64 time=0.342 ms

--- 10.0.0.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2051ms
rtt min/avg/max/mdev = 0.255/0.335/0.410/0.063 ms

Step 6: Run the command system conntrack show on DUT0 and expect the following output:

Show output
icmp     1 29 src=10.0.0.2 dst=10.0.0.1 type=8 code=0 id=159 packets=3 bytes=252 src=10.0.0.1 dst=10.0.0.2 type=0 code=0 id=159 packets=3 bytes=252 mark=42 conntag=my-traffic-tag use=1
conntrack v1.4.7 (conntrack-tools): 1 flow entries have been shown.

Test Policy Set Conntag With VRF

Description

This scenario demonstrates using conntag in combination with VRF routing. Traffic is tagged with a conntag and also assigned to a specific VRF for routing purposes.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 vif 100 address 10.0.0.1/24
set interfaces ethernet eth0 vif 100 traffic policy in POLICY_IN
set interfaces ethernet eth0 vif 100 vrf RED
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set system vrf RED
set traffic policy POLICY_IN rule 1 set conntag my-traffic-tag
set traffic policy POLICY_IN rule 1 set vrf RED

Step 2: Set the following configuration in DUT1 :

set interfaces ethernet eth0 vif 100 address 10.0.0.2/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=2.11 ms

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

Step 4: Run the command system conntrack clear on DUT0 and expect the following output:

Show output
Connection tracking table has been emptied

Step 5: Ping the IP address 10.0.0.1 from DUT1:

admin@DUT1$ ping 10.0.0.1 count 3 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=1.13 ms
64 bytes from 10.0.0.1: icmp_seq=2 ttl=64 time=5.09 ms
64 bytes from 10.0.0.1: icmp_seq=3 ttl=64 time=0.339 ms

--- 10.0.0.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 0.339/2.184/5.086/2.076 ms

Step 6: Run the command system conntrack show on DUT0 and expect the following output:

Show output
icmp     1 29 src=10.0.0.2 dst=10.0.0.1 type=8 code=0 id=161 vrf=RED packets=3 bytes=252 src=10.0.0.1 dst=10.0.0.2 type=0 code=0 id=161 vrf=RED packets=3 bytes=252 mark=0 conntag=my-traffic-tag use=1
conntrack v1.4.7 (conntrack-tools): 1 flow entries have been shown.

Test Policy Modify Conntag

Description

This scenario demonstrates modifying the conntag value on an existing traffic policy rule and verifying that new connections use the updated tag value.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 vif 100 address 10.0.0.1/24
set interfaces ethernet eth0 vif 100 traffic policy in POLICY_IN
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set traffic policy POLICY_IN rule 1 set conntag initial-tag

Step 2: Set the following configuration in DUT1 :

set interfaces ethernet eth0 vif 100 address 10.0.0.2/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=1.14 ms

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

Step 4: Run the command system conntrack clear on DUT0 and expect the following output:

Show output
Connection tracking table has been emptied

Step 5: Ping the IP address 10.0.0.1 from DUT1:

admin@DUT1$ ping 10.0.0.1 count 3 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.720 ms
64 bytes from 10.0.0.1: icmp_seq=2 ttl=64 time=0.477 ms
64 bytes from 10.0.0.1: icmp_seq=3 ttl=64 time=0.309 ms

--- 10.0.0.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2027ms
rtt min/avg/max/mdev = 0.309/0.502/0.720/0.168 ms

Step 6: Run the command system conntrack show on DUT0 and check whether the output contains the following tokens:

conntag=initial-tag
Show output
icmp     1 29 src=10.0.0.2 dst=10.0.0.1 type=8 code=0 id=163 packets=3 bytes=252 src=10.0.0.1 dst=10.0.0.2 type=0 code=0 id=163 packets=3 bytes=252 mark=0 conntag=initial-tag use=1
conntrack v1.4.7 (conntrack-tools): 1 flow entries have been shown.

Step 7: Run the command system conntrack clear on DUT0 and expect the following output:

Show output
Connection tracking table has been emptied

Step 8: Modify the following configuration lines in DUT0 :

set traffic policy POLICY_IN rule 1 set conntag modified-tag

Step 9: Ping the IP address 10.0.0.1 from DUT1:

admin@DUT1$ ping 10.0.0.1 count 3 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.421 ms
64 bytes from 10.0.0.1: icmp_seq=2 ttl=64 time=0.314 ms
64 bytes from 10.0.0.1: icmp_seq=3 ttl=64 time=0.637 ms

--- 10.0.0.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2056ms
rtt min/avg/max/mdev = 0.314/0.457/0.637/0.134 ms

Step 10: Run the command system conntrack show on DUT0 and check whether the output contains the following tokens:

conntag=modified-tag
Show output
icmp     1 29 src=10.0.0.2 dst=10.0.0.1 type=8 code=0 id=164 packets=3 bytes=252 src=10.0.0.1 dst=10.0.0.2 type=0 code=0 id=164 packets=3 bytes=252 mark=0 conntag=modified-tag use=1
conntrack v1.4.7 (conntrack-tools): 1 flow entries have been shown.

Test Policy Delete Conntag

Description

This scenario tests removing a conntag configuration from a traffic policy and verifying that new connections no longer have the tag applied.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 vif 100 address 10.0.0.1/24
set interfaces ethernet eth0 vif 100 traffic policy in POLICY_IN
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set traffic policy POLICY_IN rule 1 set conntag my-traffic-tag

Step 2: Set the following configuration in DUT1 :

set interfaces ethernet eth0 vif 100 address 10.0.0.2/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.797 ms

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

Step 4: Run the command system conntrack clear on DUT0 and expect the following output:

Show output
Connection tracking table has been emptied

Step 5: Ping the IP address 10.0.0.1 from DUT1:

admin@DUT1$ ping 10.0.0.1 count 3 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.373 ms
64 bytes from 10.0.0.1: icmp_seq=2 ttl=64 time=0.295 ms
64 bytes from 10.0.0.1: icmp_seq=3 ttl=64 time=0.363 ms

--- 10.0.0.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2030ms
rtt min/avg/max/mdev = 0.295/0.343/0.373/0.034 ms

Step 6: Run the command system conntrack show on DUT0 and check whether the output contains the following tokens:

conntag=my-traffic-tag
Show output
icmp     1 29 src=10.0.0.2 dst=10.0.0.1 type=8 code=0 id=166 packets=3 bytes=252 src=10.0.0.1 dst=10.0.0.2 type=0 code=0 id=166 packets=3 bytes=252 mark=0 conntag=my-traffic-tag use=1
conntrack v1.4.7 (conntrack-tools): 1 flow entries have been shown.

Step 7: Run the command system conntrack clear on DUT0 and expect the following output:

Show output
Connection tracking table has been emptied

Step 8: Modify the following configuration lines in DUT0 :

delete traffic policy POLICY_IN rule 1 set
set traffic policy POLICY_IN rule 1 action accept

Step 9: Ping the IP address 10.0.0.1 from DUT1:

admin@DUT1$ ping 10.0.0.1 count 3 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.744 ms
64 bytes from 10.0.0.1: icmp_seq=2 ttl=64 time=0.406 ms
64 bytes from 10.0.0.1: icmp_seq=3 ttl=64 time=0.291 ms

--- 10.0.0.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2054ms
rtt min/avg/max/mdev = 0.291/0.480/0.744/0.192 ms

Step 10: Run the command system conntrack show on DUT0 and expect the following output:

Show output
icmp     1 29 src=10.0.0.2 dst=10.0.0.1 type=8 code=0 id=167 packets=3 bytes=252 src=10.0.0.1 dst=10.0.0.2 type=0 code=0 id=167 packets=3 bytes=252 mark=0 use=1
conntrack v1.4.7 (conntrack-tools): 1 flow entries have been shown.