Complete Tests

The following scenario shows how to place an OSDx router between two machines to allow them to communicate with each other and to provide protection when accessing one another and the external WAN.

../../../_images/topology24.svg

Test Simple Ruleset With Queues

Description

Configures the three DUTs that will be used and checks that they are capable of pinging each other but not of connecting via SSH, since these connections are being dropped by the firewall.

Scenario

Step 1: Set the following configuration in DUT0:

set service firewall FW ruleset file running://base.rules
set service firewall FW mode inline queue FW_Q
set service firewall FW logging outputs fast
set service firewall FW logging level config
set service firewall FW validator-timeout 20
set interfaces ethernet eth0 traffic policy in FW_PWAN
set interfaces ethernet eth0 traffic policy out FW_PWAN
set interfaces ethernet eth1 vif 101 traffic policy in FW_PLAN
set interfaces ethernet eth1 vif 201 traffic policy in FW_PLAN
set traffic queue FW_Q elements 1
set traffic policy FW_PWAN
set traffic policy FW_PLAN
set traffic selector FW_SEL
set traffic policy FW_PLAN rule 1 action enqueue FW_Q
set traffic policy FW_PWAN rule 1 action enqueue FW_Q

Step 2: Ping IP address 20.0.0.2 from DUT1:

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

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

Step 3: Ping IP address 40.0.0.2 from DUT2:

admin@DUT2$ ping 40.0.0.2 count 1 size 56 timeout 1
Show output
PING 40.0.0.2 (40.0.0.2) 56(84) bytes of data.
64 bytes from 40.0.0.2: icmp_seq=1 ttl=63 time=0.967 ms

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

Step 4: Expect a failure in the following command: Init an SSH connection from DUT1 to IP address 20.0.0.2 with the user admin:

admin@DUT1$ ssh admin@20.0.0.2 option StrictHostKeyChecking=no option UserKnownHostsFile=/dev/null option ConnectTimeout=1 option ServerAliveInterval=1 option ServerAliveCountMax=1

Step 5: Expect a failure in the following command: Init an SSH connection from DUT2 to IP address 40.0.0.2 with the user admin:

admin@DUT2$ ssh admin@40.0.0.2 option StrictHostKeyChecking=no option UserKnownHostsFile=/dev/null option ConnectTimeout=1 option ServerAliveInterval=1 option ServerAliveCountMax=1

Step 6: Run command service firewall FW show logging fast | tail at DUT0 and check if output matches the following regular expressions:

(?m)^.+[Drop].+(SSH not allowed in this network).+$
Show output
02/26/2024-19:18:44.799551  [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:36568 -> 20.0.0.2:22
02/26/2024-19:18:46.978751  [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:52932 -> 40.0.0.2:22

Test Simple Ruleset With Custom Action-order

Description

Configures the three DUTs that will be used and checks that initially they are capable of pinging each other but after changing the priority of rule actions, ICMP traffic is not passed, but dropped by the firewall.

Scenario

Step 1: Set the following configuration in DUT0:

set service firewall FW ruleset file running://base.rules
set service firewall FW mode inline queue FW_Q
set service firewall FW logging outputs fast
set service firewall FW logging level config
set service firewall FW validator-timeout 20
set interfaces ethernet eth0 traffic policy in FW_PWAN
set interfaces ethernet eth0 traffic policy out FW_PWAN
set interfaces ethernet eth1 vif 101 traffic policy in FW_PLAN
set interfaces ethernet eth1 vif 201 traffic policy in FW_PLAN
set traffic queue FW_Q elements 1
set traffic policy FW_PWAN
set traffic policy FW_PLAN
set traffic selector FW_SEL
set traffic policy FW_PLAN rule 1 action enqueue FW_Q
set traffic policy FW_PWAN rule 1 action enqueue FW_Q

Step 2: Ping IP address 20.0.0.2 from DUT1:

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

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

Step 3: Ping IP address 40.0.0.2 from DUT2:

admin@DUT2$ ping 40.0.0.2 count 1 size 56 timeout 1
Show output
PING 40.0.0.2 (40.0.0.2) 56(84) bytes of data.
64 bytes from 40.0.0.2: icmp_seq=1 ttl=63 time=0.828 ms

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

Step 4: Set the following configuration in DUT0:

set service firewall FW action-order "drop, reject, alert, pass"

Step 5: Expect a failure in the following command: Ping IP address 20.0.0.2 from DUT1:

admin@DUT1$ ping 20.0.0.2 count 1 size 56 timeout 1
Show output
PING 20.0.0.2 (20.0.0.2) 56(84) bytes of data.

--- 20.0.0.2 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms

Step 6: Expect a failure in the following command: Ping IP address 40.0.0.2 from DUT2:

admin@DUT2$ ping 40.0.0.2 count 1 size 56 timeout 1
Show output
PING 40.0.0.2 (40.0.0.2) 56(84) bytes of data.

--- 40.0.0.2 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms

Step 7: Run command service firewall FW show logging fast | tail at DUT0 and check if output matches the following regular expressions:

(?m)^.+[Drop].+(ICMP traffic dropped).+$
Show output
02/26/2024-19:19:18.895489  [Drop] [**] [1:30:0] ICMP traffic dropped [**] [Classification: (null)] [Priority: 3] {ICMP} 40.0.0.2:8 -> 20.0.0.2:0
02/26/2024-19:19:20.032376  [Drop] [**] [1:30:0] ICMP traffic dropped [**] [Classification: (null)] [Priority: 3] {ICMP} 20.0.0.2:8 -> 40.0.0.2:0

Test Simple Ruleset With Queues IDS Mode

Description

Configures the three DUTs that will be used and checks that they are capable of pinging each other and of connecting via SSH. Since the firewall is set to IDS mode, these connections are not being dropped.

Scenario

Step 1: Set the following configuration in DUT0:

set service firewall FW ruleset file running://base.rules
set service firewall FW mode monitor interfaces eth0,eth1
set service firewall FW logging outputs fast

Step 2: Ping IP address 20.0.0.2 from DUT1:

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

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

Step 3: Ping IP address 40.0.0.2 from DUT2:

admin@DUT2$ ping 40.0.0.2 count 1 size 56 timeout 1
Show output
PING 40.0.0.2 (40.0.0.2) 56(84) bytes of data.
64 bytes from 40.0.0.2: icmp_seq=1 ttl=63 time=0.806 ms

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

Step 4: Init an SSH connection from DUT1 to IP address 20.0.0.2 with the user admin:

admin@DUT1$ ssh admin@20.0.0.2 option StrictHostKeyChecking=no option UserKnownHostsFile=/dev/null option ConnectTimeout=1 option ServerAliveInterval=1 option ServerAliveCountMax=1
Show output
Warning: Permanently added '20.0.0.2' (ED25519) to the list of known hosts.
admin@20.0.0.2's password:
Welcome to Teldat OSDx v3.10.1.1

This system includes free software.
Contact Teldat for licenses information and source code.

Last login: Mon Feb 26 18:34:03 2024
admin@osdx$

Step 5: Init an SSH connection from DUT2 to IP address 40.0.0.2 with the user admin:

admin@DUT2$ ssh admin@40.0.0.2 option StrictHostKeyChecking=no option UserKnownHostsFile=/dev/null option ConnectTimeout=1 option ServerAliveInterval=1 option ServerAliveCountMax=1
Show output
Warning: Permanently added '40.0.0.2' (ED25519) to the list of known hosts.
admin@40.0.0.2's password:
Welcome to Teldat OSDx v3.10.1.1

This system includes free software.
Contact Teldat for licenses information and source code.

Last login: Mon Feb 26 18:34:01 2024
admin@osdx$

Step 6: Run command service firewall FW show logging fast | tail at DUT0 and check if output matches the following regular expressions:

(?m)^.+[wDrop].+(SSH not allowed in this network).+$
Show output
02/26/2024-19:19:44.987623  [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:37560 -> 40.0.0.2:22
02/26/2024-19:19:44.987625  [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:37560 -> 40.0.0.2:22
02/26/2024-19:19:44.991187  [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:37560 -> 40.0.0.2:22
02/26/2024-19:19:44.991191  [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:37560 -> 40.0.0.2:22
02/26/2024-19:19:44.991205  [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:37560 -> 40.0.0.2:22
02/26/2024-19:19:44.991207  [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:37560 -> 40.0.0.2:22
02/26/2024-19:19:44.991208  [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:37560 -> 40.0.0.2:22
02/26/2024-19:19:44.991268  [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:37560 -> 40.0.0.2:22
02/26/2024-19:19:44.994303  [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:37560 -> 40.0.0.2:22
02/26/2024-19:19:44.994311  [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:37560 -> 40.0.0.2:22

Test Encrypted Ruleset

Description

Configures the three DUTs, encrypts an arbitrary ruleset file and checks that the firewall is handling said file as expected. The firewall behaves the same way as for Test Simple Ruleset With Queues but with an encrypted ruleset.

Scenario

Step 1: Run command file copy http://10.215.168.1/~robot/base-enc.rules running:// force at DUT0 and expect this output:

Show output
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   272  100   272    0     0  12363      0 --:--:-- --:--:-- --:--:-- 12363

Step 2: Set the following configuration in DUT0:

set service firewall FW ruleset file running://base-enc.rules
set service firewall FW ruleset file running://base-enc.rules digest sha512
set service firewall FW ruleset file running://base-enc.rules iterations 100000
set service firewall FW ruleset file running://base-enc.rules key-length 256
set service firewall FW ruleset file running://base-enc.rules password 'dV^F$@i!zLWLG#ZLU55ditGi'
set service firewall FW mode inline queue FW_Q
set service firewall FW logging outputs fast
set service firewall FW logging level config
set service firewall FW validator-timeout 20
set interfaces ethernet eth0 traffic policy in FW_PWAN
set interfaces ethernet eth0 traffic policy out FW_PWAN
set interfaces ethernet eth1 vif 101 traffic policy in FW_PLAN
set interfaces ethernet eth1 vif 201 traffic policy in FW_PLAN
set traffic queue FW_Q elements 1
set traffic policy FW_PWAN
set traffic policy FW_PLAN
set traffic selector FW_SEL
set traffic policy FW_PLAN rule 1 action enqueue FW_Q
set traffic policy FW_PWAN rule 1 action enqueue FW_Q

Step 3: Ping IP address 20.0.0.2 from DUT1:

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

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

Step 4: Ping IP address 40.0.0.2 from DUT2:

admin@DUT2$ ping 40.0.0.2 count 1 size 56 timeout 1
Show output
PING 40.0.0.2 (40.0.0.2) 56(84) bytes of data.
64 bytes from 40.0.0.2: icmp_seq=1 ttl=63 time=0.903 ms

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

Step 5: Expect a failure in the following command: Init an SSH connection from DUT1 to IP address 20.0.0.2 with the user admin:

admin@DUT1$ ssh admin@20.0.0.2 option StrictHostKeyChecking=no option UserKnownHostsFile=/dev/null option ConnectTimeout=1 option ServerAliveInterval=1 option ServerAliveCountMax=1

Step 6: Expect a failure in the following command: Init an SSH connection from DUT2 to IP address 40.0.0.2 with the user admin:

admin@DUT2$ ssh admin@40.0.0.2 option StrictHostKeyChecking=no option UserKnownHostsFile=/dev/null option ConnectTimeout=1 option ServerAliveInterval=1 option ServerAliveCountMax=1

Step 7: Run command service firewall FW show logging fast | tail at DUT0 and check if output matches the following regular expressions:

(?m)^.+[Drop].+(SSH not allowed in this network).+$
Show output
02/26/2024-19:20:12.037573  [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:55016 -> 20.0.0.2:22
02/26/2024-19:20:14.225537  [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:58502 -> 40.0.0.2:22

Test Encrypted Patch

Description

Configures three DUTs, encrypts a patch that allows SSH communication between the DUTs and enables bypass. The original input file was:

drop ssh any any -> any any (msg: "SSH not allowed in this network"; sid: 2;)
pass icmp any any -> any any (msg: "ICMP traffic ignored"; sid: 3;)

After applying the following patch:

1c1
< drop ssh any any -> any any (msg: "SSH not allowed in this network"; sid: 2;)
---
> alert ssh any any -> any any (msg: "SSH traffic detected - bypassing"; bypass; sid: 2;)

The resulting file must be:

alert ssh any any -> any any (msg: "SSH traffic detected - bypassing"; bypass; sid: 2;)
pass icmp any any -> any any (msg: "ICMP traffic ignored"; sid: 3;)

This not only allows SSH traffic but also enables the bypass feature (not tested here yet).

Scenario

Step 1: Run command file copy http://10.215.168.1/~robot/base-enc.rules running:// force at DUT0 and expect this output:

Show output
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   272  100   272    0     0  15111      0 --:--:-- --:--:-- --:--:-- 15111

Step 2: Run command file copy http://10.215.168.1/~robot/base-enc.diff1 running:// force at DUT0 and expect this output:

Show output
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   256  100   256    0     0  11130      0 --:--:-- --:--:-- --:--:-- 11130

Step 3: Set the following configuration in DUT0:

set service firewall FW ruleset file running://base-enc.rules
set service firewall FW ruleset file running://base-enc.rules digest sha512
set service firewall FW ruleset file running://base-enc.rules iterations 100000
set service firewall FW ruleset file running://base-enc.rules key-length 256
set service firewall FW ruleset file running://base-enc.rules password 'dV^F$@i!zLWLG#ZLU55ditGi'
set service firewall FW ruleset patch running://base-enc.diff1
set service firewall FW ruleset patch running://base-enc.diff1 digest sha512
set service firewall FW ruleset patch running://base-enc.diff1 iterations 100000
set service firewall FW ruleset patch running://base-enc.diff1 key-length 256
set service firewall FW ruleset patch running://base-enc.diff1 password '5YG9F@H4V!#s&LVKqQ6uehy7'
set service firewall FW mode inline queue FW_Q
set service firewall FW logging outputs fast
set service firewall FW logging level config
set service firewall FW validator-timeout 20
set interfaces ethernet eth0 traffic policy in FW_PWAN
set interfaces ethernet eth0 traffic policy out FW_PWAN
set interfaces ethernet eth1 vif 101 traffic policy in FW_PLAN
set interfaces ethernet eth1 vif 201 traffic policy in FW_PLAN
set traffic queue FW_Q elements 1
set traffic policy FW_PWAN
set traffic policy FW_PLAN
set traffic selector FW_SEL
set traffic policy FW_PLAN rule 1 action enqueue FW_Q
set traffic policy FW_PWAN rule 1 action enqueue FW_Q

Step 4: Ping IP address 20.0.0.2 from DUT1:

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

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

Step 5: Ping IP address 40.0.0.2 from DUT2:

admin@DUT2$ ping 40.0.0.2 count 1 size 56 timeout 1
Show output
PING 40.0.0.2 (40.0.0.2) 56(84) bytes of data.
64 bytes from 40.0.0.2: icmp_seq=1 ttl=63 time=0.789 ms

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

Step 6: Init an SSH connection from DUT1 to IP address 20.0.0.2 with the user admin:

admin@DUT1$ ssh admin@20.0.0.2 option StrictHostKeyChecking=no option UserKnownHostsFile=/dev/null option ConnectTimeout=1 option ServerAliveInterval=1 option ServerAliveCountMax=1
Show output
Warning: Permanently added '20.0.0.2' (ED25519) to the list of known hosts.
admin@20.0.0.2's password:
Welcome to Teldat OSDx v3.10.1.1

This system includes free software.
Contact Teldat for licenses information and source code.

Last login: Mon Feb 26 19:19:45 2024 from 40.0.0.2
admin@osdx$

Step 7: Init an SSH connection from DUT2 to IP address 40.0.0.2 with the user admin:

admin@DUT2$ ssh admin@40.0.0.2 option StrictHostKeyChecking=no option UserKnownHostsFile=/dev/null option ConnectTimeout=1 option ServerAliveInterval=1 option ServerAliveCountMax=1
Show output
Warning: Permanently added '40.0.0.2' (ED25519) to the list of known hosts.
admin@40.0.0.2's password:
Welcome to Teldat OSDx v3.10.1.1

This system includes free software.
Contact Teldat for licenses information and source code.

Last login: Mon Feb 26 19:19:45 2024 from 20.0.0.2
admin@osdx$

Step 8: Run command service firewall FW show logging fast | tail at DUT0 and check if output matches the following regular expressions:

(?m)^.+(SSH traffic detected - bypassing).+$
Show output
02/26/2024-19:20:45.558266  [**] [1:2:0] SSH traffic detected - bypassing [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:51170 -> 20.0.0.2:22
02/26/2024-19:20:45.998736  [**] [1:2:0] SSH traffic detected - bypassing [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:45348 -> 40.0.0.2:22

Test Compressed Ruleset With Patch

Description

Configures three DUTs, places a patch between the DUTs that allows SSH communication, and enables bypass. In addition, there are two source rules that are compressed into a tar.gz file whose content is used by the firewall to define the rules. One of the files is named base.rules``and is the file that the patch is meant for. The second one is ``test-performance.rules whose contents are:: The original input file was:

alert tcp any any -> any 5001 (msg: "Skipping test network performance traffic"; bypass; flow: established, to_server; sid: 4;)

This rule simply bypasses traffic that is deemed “performance traffic”, which is directly associated with the monitor test performance command.

Scenario

Step 1: Run command file copy http://10.215.168.1/~robot/ruleset.tar.gz running:// force at DUT0 and expect this output:

Show output
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   332  100   332    0     0  18444      0 --:--:-- --:--:-- --:--:-- 18444

Step 2: Run command file copy http://10.215.168.1/~robot/base.diff1 running:// force at DUT0 and expect this output:

Show output
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   238  100   238    0     0  13222      0 --:--:-- --:--:-- --:--:-- 13222

Step 3: Set the following configuration in DUT0:

set service firewall FW ruleset compressed running://ruleset.tar.gz
set service firewall FW ruleset patch running://base.diff1
set service firewall FW mode inline queue FW_Q
set service firewall FW logging outputs fast
set service firewall FW logging level config
set service firewall FW validator-timeout 20
set interfaces ethernet eth0 traffic policy in FW_PWAN
set interfaces ethernet eth0 traffic policy out FW_PWAN
set interfaces ethernet eth1 vif 101 traffic policy in FW_PLAN
set interfaces ethernet eth1 vif 201 traffic policy in FW_PLAN
set traffic queue FW_Q elements 1
set traffic policy FW_PWAN
set traffic policy FW_PLAN
set traffic selector FW_SEL
set traffic policy FW_PLAN rule 1 action enqueue FW_Q
set traffic policy FW_PWAN rule 1 action enqueue FW_Q

Step 4: Ping IP address 20.0.0.2 from DUT1:

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

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

Step 5: Ping IP address 40.0.0.2 from DUT2:

admin@DUT2$ ping 40.0.0.2 count 1 size 56 timeout 1
Show output
PING 40.0.0.2 (40.0.0.2) 56(84) bytes of data.
64 bytes from 40.0.0.2: icmp_seq=1 ttl=63 time=0.944 ms

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

Step 6: Init an SSH connection from DUT1 to IP address 20.0.0.2 with the user admin:

admin@DUT1$ ssh admin@20.0.0.2 option StrictHostKeyChecking=no option UserKnownHostsFile=/dev/null option ConnectTimeout=1 option ServerAliveInterval=1 option ServerAliveCountMax=1
Show output
Warning: Permanently added '20.0.0.2' (ED25519) to the list of known hosts.
admin@20.0.0.2's password:
Welcome to Teldat OSDx v3.10.1.1

This system includes free software.
Contact Teldat for licenses information and source code.

Last login: Mon Feb 26 19:20:46 2024 from 40.0.0.2
admin@osdx$

Step 7: Init an SSH connection from DUT2 to IP address 40.0.0.2 with the user admin:

admin@DUT2$ ssh admin@40.0.0.2 option StrictHostKeyChecking=no option UserKnownHostsFile=/dev/null option ConnectTimeout=1 option ServerAliveInterval=1 option ServerAliveCountMax=1
Show output
Warning: Permanently added '40.0.0.2' (ED25519) to the list of known hosts.
admin@40.0.0.2's password:
Welcome to Teldat OSDx v3.10.1.1

This system includes free software.
Contact Teldat for licenses information and source code.

Last login: Mon Feb 26 19:20:46 2024 from 20.0.0.2
admin@osdx$

Step 8: Run command service firewall FW show logging fast | tail at DUT0 and check if output matches the following regular expressions:

(?m)^.+(SSH traffic detected - bypassing).+$
Show output
02/26/2024-19:21:13.684032  [**] [1:2:0] SSH traffic detected - bypassing [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:48776 -> 20.0.0.2:22
02/26/2024-19:21:14.126346  [**] [1:2:0] SSH traffic detected - bypassing [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:50708 -> 40.0.0.2:22

Step 9: Initiate a bandwidth test from DUT2 to DUT1

admin@DUT1$ monitor test performance server port 5001
admin@DUT2$ monitor test performance client 40.0.0.2 duration 1 port 5001
Expect this output in DUT2:
Connecting to host 40.0.0.2, port 5001
[  5] local 20.0.0.2 port 58374 connected to 40.0.0.2 port 5001
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  15.9 MBytes   133 Mbits/sec    0    646 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-1.00   sec  15.9 MBytes   133 Mbits/sec    0             sender
[  5]   0.00-1.02   sec  13.0 MBytes   107 Mbits/sec                  receiver

iperf Done.

Step 10: Run command service firewall FW show logging fast | tail at DUT0 and check if output matches the following regular expressions:

(?m)^.+(Skipping test network performance traffic).+$
Show output
02/26/2024-19:21:13.684032  [**] [1:2:0] SSH traffic detected - bypassing [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:48776 -> 20.0.0.2:22
02/26/2024-19:21:14.126346  [**] [1:2:0] SSH traffic detected - bypassing [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:50708 -> 40.0.0.2:22
02/26/2024-19:21:14.784476  [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:58372 -> 40.0.0.2:5001
02/26/2024-19:21:14.787019  [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:58374 -> 40.0.0.2:5001

Test Single File In Compressed Ruleset

Description

Compresses two ruleset files but only chooses the test-performance.rules from within the compressed file. Lastly, checks that performance traffic is detected but no message is generated for SSH traffic, indicating that only one file is being used.

Scenario

Step 1: Run command file copy http://10.215.168.1/~robot/ruleset.tar.gz running:// force at DUT0 and expect this output:

Show output
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   332  100   332    0     0  18444      0 --:--:-- --:--:-- --:--:-- 18444

Step 2: Set the following configuration in DUT0:

set service firewall FW ruleset compressed running://ruleset.tar.gz
set service firewall FW ruleset compressed running://ruleset.tar.gz file test-performance.rules
set service firewall FW mode inline queue FW_Q
set service firewall FW logging outputs fast
set service firewall FW logging level config
set service firewall FW validator-timeout 20
set interfaces ethernet eth0 traffic policy in FW_PWAN
set interfaces ethernet eth0 traffic policy out FW_PWAN
set interfaces ethernet eth1 vif 101 traffic policy in FW_PLAN
set interfaces ethernet eth1 vif 201 traffic policy in FW_PLAN
set traffic queue FW_Q elements 1
set traffic policy FW_PWAN
set traffic policy FW_PLAN
set traffic selector FW_SEL
set traffic policy FW_PLAN rule 1 action enqueue FW_Q
set traffic policy FW_PWAN rule 1 action enqueue FW_Q

Step 3: Ping IP address 20.0.0.2 from DUT1:

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

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

Step 4: Ping IP address 40.0.0.2 from DUT2:

admin@DUT2$ ping 40.0.0.2 count 1 size 56 timeout 1
Show output
PING 40.0.0.2 (40.0.0.2) 56(84) bytes of data.
64 bytes from 40.0.0.2: icmp_seq=1 ttl=63 time=0.918 ms

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

Step 5: Init an SSH connection from DUT1 to IP address 20.0.0.2 with the user admin:

admin@DUT1$ ssh admin@20.0.0.2 option StrictHostKeyChecking=no option UserKnownHostsFile=/dev/null option ConnectTimeout=1 option ServerAliveInterval=1 option ServerAliveCountMax=1
Show output
Warning: Permanently added '20.0.0.2' (ED25519) to the list of known hosts.
admin@20.0.0.2's password:
Welcome to Teldat OSDx v3.10.1.1

This system includes free software.
Contact Teldat for licenses information and source code.

Last login: Mon Feb 26 19:21:13 2024 from 40.0.0.2
admin@osdx$

Step 6: Init an SSH connection from DUT2 to IP address 40.0.0.2 with the user admin:

admin@DUT2$ ssh admin@40.0.0.2 option StrictHostKeyChecking=no option UserKnownHostsFile=/dev/null option ConnectTimeout=1 option ServerAliveInterval=1 option ServerAliveCountMax=1
Show output
Warning: Permanently added '40.0.0.2' (ED25519) to the list of known hosts.
admin@40.0.0.2's password:
Welcome to Teldat OSDx v3.10.1.1

This system includes free software.
Contact Teldat for licenses information and source code.

Last login: Mon Feb 26 19:21:14 2024 from 20.0.0.2
admin@osdx$

Step 7: Run command service firewall FW show logging fast | tail at DUT0 and check if output does not match the following regular expressions:

(?m)^.+(SSH traffic detected - bypassing).+$
Show output
No fast logs yet for client "FW"

Step 8: Initiate a bandwidth test from DUT2 to DUT1

admin@DUT1$ monitor test performance server port 5001
admin@DUT2$ monitor test performance client 40.0.0.2 duration 1 port 5001
Expect this output in DUT2:
Connecting to host 40.0.0.2, port 5001
[  5] local 20.0.0.2 port 50118 connected to 40.0.0.2 port 5001
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  15.4 MBytes   129 Mbits/sec    0    655 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-1.00   sec  15.4 MBytes   129 Mbits/sec    0             sender
[  5]   0.00-1.02   sec  13.0 MBytes   106 Mbits/sec                  receiver

iperf Done.

Step 9: Run command service firewall FW show logging fast | tail at DUT0 and check if output matches the following regular expressions:

(?m)^.+(Skipping test network performance traffic).+$
Show output
02/26/2024-19:21:49.358119  [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:50108 -> 40.0.0.2:5001
02/26/2024-19:21:49.360674  [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:50118 -> 40.0.0.2:5001

Test Local Bypass

Description

Builds a scenario with three DUTs in which a performance test is carried out between DUT1 and DUT2, and DUT0 is the router running the firewall. “Local bypass” is set to allow the firewall to internally skips packets belonging to a flow that must be bypassed. The performance test may produce better results than the previous test.

Scenario

Step 1: Run command file copy http://10.215.168.1/~robot/test-performance.rules running:// force at DUT0 and expect this output:

Show output
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   129  100   129    0     0   5863      0 --:--:-- --:--:-- --:--:--  5863

Step 2: Set the following configuration in DUT0:

set service firewall FW ruleset file running://test-performance.rules
set service firewall FW mode inline queue FW_Q
set service firewall FW logging outputs fast
set service firewall FW logging level config
set service firewall FW validator-timeout 20
set interfaces ethernet eth0 traffic policy in FW_PWAN
set interfaces ethernet eth0 traffic policy out FW_PWAN
set interfaces ethernet eth1 vif 101 traffic policy in FW_PLAN
set interfaces ethernet eth1 vif 201 traffic policy in FW_PLAN
set traffic queue FW_Q elements 1
set traffic policy FW_PWAN
set traffic policy FW_PLAN
set traffic selector FW_SEL
set traffic policy FW_PLAN rule 1 action enqueue FW_Q
set traffic policy FW_PWAN rule 1 action enqueue FW_Q
set service firewall FW stream bypass

Step 3: Ping IP address 20.0.0.2 from DUT1:

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

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

Step 4: Ping IP address 40.0.0.2 from DUT2:

admin@DUT2$ ping 40.0.0.2 count 1 size 56 timeout 1
Show output
PING 40.0.0.2 (40.0.0.2) 56(84) bytes of data.
64 bytes from 40.0.0.2: icmp_seq=1 ttl=63 time=0.758 ms

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

Step 5: Initiate a bandwidth test from DUT2 to DUT1

admin@DUT1$ monitor test performance server port 5001
admin@DUT2$ monitor test performance client 40.0.0.2 duration 10 port 5001
Expect this output in DUT2:
Connecting to host 40.0.0.2, port 5001
[  5] local 20.0.0.2 port 56284 connected to 40.0.0.2 port 5001
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  15.0 MBytes   126 Mbits/sec    0    609 KBytes
[  5]   1.00-2.00   sec  13.8 MBytes   115 Mbits/sec    0   1.30 MBytes
[  5]   2.00-3.00   sec  26.2 MBytes   220 Mbits/sec    0   2.61 MBytes
[  5]   3.00-4.00   sec  21.2 MBytes   178 Mbits/sec  918   2.02 MBytes
[  5]   4.00-5.00   sec  26.2 MBytes   220 Mbits/sec    0   2.20 MBytes
[  5]   5.00-10.57  sec  7.50 MBytes  11.3 Mbits/sec    0   2.24 MBytes
[  5]  10.57-12.96  sec  0.00 Bytes  0.00 bits/sec    9   43.8 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-12.96  sec   110 MBytes  71.2 Mbits/sec  961             sender
[  5]   0.00-12.96  sec   108 MBytes  69.9 Mbits/sec                  receiver

iperf Done.

Step 6: Run command service firewall FW show logging fast | tail at DUT0 and check if output matches the following regular expressions:

(?m)^.+(Skipping test network performance traffic).+$
Show output
02/26/2024-19:22:21.518868  [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:56280 -> 40.0.0.2:5001
02/26/2024-19:22:21.521485  [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:56284 -> 40.0.0.2:5001

Test Capture Bypass

Description

Builds a scenario with three DUTs in which a performance test is conducted between DUT1 and DUT2, and DUT0 is the router running the firewall. “Capture bypass” is set to allow the firewall to mark packets. An external tool can then decide what to do with the flow when the mark is seen. For this example, when packet marks are detected, the traffic is assigned a label, thereby allowing the possibility of classifying traffic. In particular, labeling avoids traffic from entering the firewall.

Performance must improve considerably compared to the previous test.

Scenario

Step 1: Run command file copy http://10.215.168.1/~robot/test-performance.rules running:// force at DUT0 and expect this output:

Show output
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   129  100   129    0     0   3486      0 --:--:-- --:--:-- --:--:--  3486

Step 2: Set the following configuration in DUT0:

set service firewall FW ruleset file running://test-performance.rules
set service firewall FW mode inline queue FW_Q
set service firewall FW logging outputs fast
set service firewall FW logging level config
set service firewall FW validator-timeout 20
set interfaces ethernet eth0 traffic policy in FW_PWAN
set interfaces ethernet eth0 traffic policy out FW_PWAN
set interfaces ethernet eth1 vif 101 traffic policy in FW_PLAN
set interfaces ethernet eth1 vif 201 traffic policy in FW_PLAN
set traffic queue FW_Q elements 1
set traffic policy FW_PWAN
set traffic policy FW_PLAN
set traffic selector FW_SEL
set service firewall FW stream bypass mark 129834765
set service firewall FW stream bypass mask 129834765
set traffic label BYPASS
set traffic policy FW-SKIP rule 1 log prefix SKIP
set traffic policy FW-SKIP rule 1 selector MARKED-PACKETS
set traffic policy FW-SKIP rule 1 set label BYPASS
set traffic selector MARKED-PACKETS rule 1 mark 129834765
set traffic selector FW_SEL rule 1 not label BYPASS
set traffic policy FW_PLAN rule 1 selector FW_SEL
set traffic policy FW_PWAN rule 1 selector FW_SEL
set interfaces ethernet eth1 vif 101 traffic policy out FW-SKIP
set interfaces ethernet eth1 vif 201 traffic policy out FW-SKIP
set traffic policy FW_PLAN rule 1 action enqueue FW_Q
set traffic policy FW_PWAN rule 1 action enqueue FW_Q

Step 3: Ping IP address 20.0.0.2 from DUT1:

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

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

Step 4: Ping IP address 40.0.0.2 from DUT2:

admin@DUT2$ ping 40.0.0.2 count 1 size 56 timeout 1
Show output
PING 40.0.0.2 (40.0.0.2) 56(84) bytes of data.
64 bytes from 40.0.0.2: icmp_seq=1 ttl=63 time=0.870 ms

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

Step 5: Initiate a bandwidth test from DUT2 to DUT1

admin@DUT1$ monitor test performance server port 5001
admin@DUT2$ monitor test performance client 40.0.0.2 duration 10 port 5001
Expect this output in DUT2:
Connecting to host 40.0.0.2, port 5001
[  5] local 20.0.0.2 port 45154 connected to 40.0.0.2 port 5001
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  32.4 MBytes   271 Mbits/sec    0   1.29 MBytes
[  5]   1.00-2.00   sec   110 MBytes   923 Mbits/sec  713   1.23 MBytes
[  5]   2.00-3.00   sec   116 MBytes   975 Mbits/sec    0   1.30 MBytes
[  5]   3.00-4.00   sec   118 MBytes   986 Mbits/sec    0   1.36 MBytes
[  5]   4.00-5.00   sec   121 MBytes  1.02 Gbits/sec    0   1.40 MBytes
[  5]   5.00-6.00   sec   136 MBytes  1.14 Gbits/sec   44   1.02 MBytes
[  5]   6.00-7.00   sec   132 MBytes  1.11 Gbits/sec    0   1.15 MBytes
[  5]   7.00-8.00   sec   130 MBytes  1.09 Gbits/sec    0   1.25 MBytes
[  5]   8.00-9.00   sec   130 MBytes  1.09 Gbits/sec    0   1.32 MBytes
[  5]   9.00-10.00  sec   130 MBytes  1.09 Gbits/sec    0   1.38 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.13 GBytes   970 Mbits/sec  757             sender
[  5]   0.00-10.00  sec  1.13 GBytes   968 Mbits/sec                  receiver

iperf Done.

Step 6: Run command service firewall FW show logging fast | tail at DUT0 and check if output matches the following regular expressions:

(?m)^.+(Skipping test network performance traffic).+$
Show output
02/26/2024-19:23:07.877097  [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:45140 -> 40.0.0.2:5001
02/26/2024-19:23:07.879580  [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:45154 -> 40.0.0.2:5001

Step 7: Run command system journal show | cat at DUT0 and check if output matches the following regular expressions:

(?m)^.*\[SKIP\-1\].*$
Show output
-- Logs begin at Mon 2024-02-26 19:22:54 UTC, end at Mon 2024-02-26 19:23:18 UTC. --
Feb 26 19:22:54.023576 osdx systemd-timedated[28001]: Changed local time to Mon Feb 26 19:22:54 2024
Feb 26 19:22:54.026441 osdx OSDxCLI[27578]: User 'admin' executed a new command: 'set date 2024-02-26 19:22:54'.
Feb 26 19:22:54.472657 osdx systemd-journald[1369]: Runtime journal (/run/log/journal/bb5e03885d754db09ee63ec3d68ce029) is 4.0M, max 16.0M, 12.0M free.
Feb 26 19:22:54.490561 osdx OSDxCLI[27578]: User 'admin' executed a new command: 'system journal clear'.
Feb 26 19:22:55.175308 osdx osdx-coredump[28034]: Deleting all coredumps in /opt/vyatta/etc/config/coredump...
Feb 26 19:22:55.175443 osdx osdx-coredump[28034]: Removing coredump /opt/vyatta/etc/config/coredump/core.Suricata-Main.0.8d2f1409a5874154b106135a1cc1b2f0.27305.1708975369000000.lz4 from 2024-02-26 19:22:50
Feb 26 19:22:55.186469 osdx OSDxCLI[27578]: User 'admin' executed a new command: 'system coredump delete all'.
Feb 26 19:22:56.238514 osdx OSDxCLI[27578]: User 'admin' entered the configuration menu.
Feb 26 19:22:56.361473 osdx OSDxCLI[27578]: User 'admin' added a new cfg line: 'set interfaces ethernet eth0 address 10.215.168.64/24'.
Feb 26 19:22:56.503794 osdx OSDxCLI[27578]: User 'admin' added a new cfg line: 'set interfaces ethernet eth0 traffic nat source rule 1 address masquerade'.
Feb 26 19:22:56.613908 osdx OSDxCLI[27578]: User 'admin' added a new cfg line: 'set interfaces ethernet eth1 vif 101 address 40.0.0.1/8'.
Feb 26 19:22:56.726978 osdx OSDxCLI[27578]: User 'admin' added a new cfg line: 'set interfaces ethernet eth1 vif 201 address 20.0.0.1/8'.
Feb 26 19:22:56.840554 osdx OSDxCLI[27578]: User 'admin' added a new cfg line: 'set protocols static route 0.0.0.0/0 next-hop 10.215.168.1'.
Feb 26 19:22:56.955010 osdx OSDxCLI[27578]: User 'admin' added a new cfg line: 'set service dns static host-name WAN inet 10.215.168.1'.
Feb 26 19:22:57.118038 osdx kernel: 8021q: adding VLAN 0 to HW filter on device eth1
Feb 26 19:22:57.178128 osdx kernel: 8021q: adding VLAN 0 to HW filter on device eth0
Feb 26 19:22:57.226821 osdx systemd-udevd[28151]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
Feb 26 19:22:57.227350 osdx systemd-udevd[28151]: Using default interface naming scheme 'v240'.
Feb 26 19:22:57.283698 osdx systemd-udevd[28151]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
Feb 26 19:22:57.466539 osdx cfgd[997]: [27578]Completed change to active configuration
Feb 26 19:22:57.537455 osdx OSDxCLI[27578]: User 'admin' committed the configuration.
Feb 26 19:22:57.592630 osdx OSDxCLI[27578]: User 'admin' left the configuration menu.
Feb 26 19:23:00.389615 osdx OSDxCLI[27578]: User 'admin' executed a new command: 'ping 10.215.168.1      count 1 size 56 timeout 1'.
Feb 26 19:23:00.528391 osdx OSDxCLI[27578]: User 'admin' executed a new command: 'ping 40.0.0.2      count 1 size 56 timeout 1'.
Feb 26 19:23:00.667496 osdx OSDxCLI[27578]: User 'admin' executed a new command: 'ping 20.0.0.2      count 1 size 56 timeout 1'.
Feb 26 19:23:01.532840 osdx file_operation[28232]: using src url: http://10.215.168.1/~robot/test-performance.rules dst url: running://
Feb 26 19:23:01.611821 osdx OSDxCLI[27578]: User 'admin' executed a new command: 'file copy http://10.215.168.1/~robot/test-performance.rules running:// force'.
Feb 26 19:23:01.830145 osdx OSDxCLI[27578]: User 'admin' entered the configuration menu.
Feb 26 19:23:01.956362 osdx OSDxCLI[27578]: User 'admin' added a new cfg line: 'set service firewall FW ruleset file running://test-performance.rules'.
Feb 26 19:23:02.069817 osdx OSDxCLI[27578]: User 'admin' added a new cfg line: 'set service firewall FW mode inline queue FW_Q'.
Feb 26 19:23:02.185148 osdx OSDxCLI[27578]: User 'admin' added a new cfg line: 'set service firewall FW logging outputs fast'.
Feb 26 19:23:02.298472 osdx OSDxCLI[27578]: User 'admin' added a new cfg line: 'set service firewall FW logging level config'.
Feb 26 19:23:02.412989 osdx OSDxCLI[27578]: User 'admin' added a new cfg line: 'set service firewall FW validator-timeout 20'.
Feb 26 19:23:02.531419 osdx OSDxCLI[27578]: User 'admin' added a new cfg line: 'set interfaces ethernet eth0 traffic policy in FW_PWAN'.
Feb 26 19:23:02.644889 osdx OSDxCLI[27578]: User 'admin' added a new cfg line: 'set interfaces ethernet eth0 traffic policy out FW_PWAN'.
Feb 26 19:23:02.763204 osdx OSDxCLI[27578]: User 'admin' added a new cfg line: 'set interfaces ethernet eth1 vif 101 traffic policy in FW_PLAN'.
Feb 26 19:23:02.876505 osdx OSDxCLI[27578]: User 'admin' added a new cfg line: 'set interfaces ethernet eth1 vif 201 traffic policy in FW_PLAN'.
Feb 26 19:23:02.985154 osdx OSDxCLI[27578]: User 'admin' added a new cfg line: 'set traffic queue FW_Q elements 1'.
Feb 26 19:23:03.099315 osdx OSDxCLI[27578]: User 'admin' added a new cfg line: 'set traffic policy FW_PWAN'.
Feb 26 19:23:03.212281 osdx OSDxCLI[27578]: User 'admin' added a new cfg line: 'set traffic policy FW_PLAN'.
Feb 26 19:23:03.351092 osdx OSDxCLI[27578]: User 'admin' added a new cfg line: 'set traffic selector FW_SEL'.
Feb 26 19:23:03.471911 osdx OSDxCLI[27578]: User 'admin' added a new cfg line: 'set service firewall FW stream bypass mark 129834765'.
Feb 26 19:23:03.614377 osdx OSDxCLI[27578]: User 'admin' added a new cfg line: 'set service firewall FW stream bypass mask 129834765'.
Feb 26 19:23:03.723389 osdx OSDxCLI[27578]: User 'admin' added a new cfg line: 'set traffic label BYPASS'.
Feb 26 19:23:03.847009 osdx OSDxCLI[27578]: User 'admin' added a new cfg line: 'set traffic policy FW-SKIP rule 1 log prefix SKIP'.
Feb 26 19:23:03.984231 osdx OSDxCLI[27578]: User 'admin' added a new cfg line: 'set traffic policy FW-SKIP rule 1 selector MARKED-PACKETS'.
Feb 26 19:23:04.100292 osdx OSDxCLI[27578]: User 'admin' added a new cfg line: 'set traffic policy FW-SKIP rule 1 set label BYPASS'.
Feb 26 19:23:04.217110 osdx OSDxCLI[27578]: User 'admin' added a new cfg line: 'set traffic selector MARKED-PACKETS rule 1 mark 129834765'.
Feb 26 19:23:04.338629 osdx OSDxCLI[27578]: User 'admin' added a new cfg line: 'set traffic selector FW_SEL rule 1 not label BYPASS'.
Feb 26 19:23:04.443328 osdx OSDxCLI[27578]: User 'admin' added a new cfg line: 'set traffic policy FW_PLAN rule 1 selector FW_SEL'.
Feb 26 19:23:04.559003 osdx OSDxCLI[27578]: User 'admin' added a new cfg line: 'set traffic policy FW_PWAN rule 1 selector FW_SEL'.
Feb 26 19:23:04.705288 osdx OSDxCLI[27578]: User 'admin' added a new cfg line: 'set interfaces ethernet eth1 vif 101 traffic policy out FW-SKIP'.
Feb 26 19:23:04.818492 osdx OSDxCLI[27578]: User 'admin' added a new cfg line: 'set interfaces ethernet eth1 vif 201 traffic policy out FW-SKIP'.
Feb 26 19:23:04.931802 osdx OSDxCLI[27578]: User 'admin' added a new cfg line: 'set traffic policy FW_PLAN rule 1 action enqueue FW_Q'.
Feb 26 19:23:05.046494 osdx OSDxCLI[27578]: User 'admin' added a new cfg line: 'set traffic policy FW_PWAN rule 1 action enqueue FW_Q'.
Feb 26 19:23:05.522625 osdx systemd[1]: Reloading.
Feb 26 19:23:05.755173 osdx systemd[1]: Starting Suricata client "FW" service...
Feb 26 19:23:05.777230 osdx systemd[1]: suricata@FW.service: Can't open PID file /run/suricata-FW.pid (yet?) after start: No such file or directory
Feb 26 19:23:05.786171 osdx systemd[1]: Started Suricata client "FW" service.
Feb 26 19:23:07.232093 osdx INFO[28366]: Rules successfully loaded
Feb 26 19:23:07.238995 osdx cfgd[997]: [27578]Completed change to active configuration
Feb 26 19:23:07.245066 osdx OSDxCLI[27578]: User 'admin' committed the configuration.
Feb 26 19:23:07.278285 osdx OSDxCLI[27578]: User 'admin' left the configuration menu.
Feb 26 19:23:07.878048 osdx kernel: [SKIP-1] ACCEPT IN=eth1.201 OUT=eth1.101 MAC=de:ad:be:ef:6c:11:de:ad:be:ef:6c:30:08:00:45:00:00:59 SRC=20.0.0.2 DST=40.0.0.2 LEN=89 TOS=0x00 PREC=0x00 TTL=63 ID=19619 DF PROTO=TCP SPT=45140 DPT=5001 WINDOW=502 RES=0x00 ACK PSH URGP=0 MARK=0x7bd1f0d
Feb 26 19:23:07.882151 osdx kernel: [SKIP-1] ACCEPT IN=eth1.201 OUT=eth1.101 MAC=de:ad:be:ef:6c:11:de:ad:be:ef:6c:30:08:00:45:00:00:59 SRC=20.0.0.2 DST=40.0.0.2 LEN=89 TOS=0x00 PREC=0x00 TTL=63 ID=57077 DF PROTO=TCP SPT=45154 DPT=5001 WINDOW=502 RES=0x00 ACK PSH URGP=0 MARK=0x7bd1f0d
Feb 26 19:23:12.226024 osdx zebra[934]: [WPPMZ-G9797] if_zebra_speed_update: eth1.201 old speed: 0 new speed: 4294967295
Feb 26 19:23:12.278898 osdx zebra[934]: [WPPMZ-G9797] if_zebra_speed_update: eth1.101 old speed: 0 new speed: 4294967295
Feb 26 19:23:18.197091 osdx OSDxCLI[27578]: User 'admin' executed a new command: 'service firewall FW show logging fast | tail'.

Test Simple Capture Bypass

Description

Builds a scenario with three DUTs in which a performance test is conducted between DUT1 and DUT2, and DUT0 is the router running the firewall. This test sets the conntrack mark directly, thus skipping all the steps required to set it later.

Performance must improve considerably compared to the previous test.

Scenario

Step 1: Run command file copy http://10.215.168.1/~robot/test-performance.rules running:// force at DUT0 and expect this output:

Show output
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   129  100   129    0     0   3685      0 --:--:-- --:--:-- --:--:--  3685

Step 2: Set the following configuration in DUT0:

set service firewall FW ruleset file running://test-performance.rules
set service firewall FW mode inline queue FW_Q
set service firewall FW logging outputs fast
set service firewall FW logging level config
set service firewall FW validator-timeout 20
set interfaces ethernet eth0 traffic policy in FW_PWAN
set interfaces ethernet eth0 traffic policy out FW_PWAN
set interfaces ethernet eth1 vif 101 traffic policy in FW_PLAN
set interfaces ethernet eth1 vif 201 traffic policy in FW_PLAN
set traffic queue FW_Q elements 1
set traffic policy FW_PWAN
set traffic policy FW_PLAN
set traffic selector FW_SEL
set service firewall FW stream bypass mark 129834765
set service firewall FW stream bypass mask 129834765
set service firewall FW stream bypass set-connmark
set traffic selector FW_SEL rule 1 not connmark 129834765
set traffic policy FW_PLAN rule 1 selector FW_SEL
set traffic policy FW_PWAN rule 1 selector FW_SEL
set traffic policy FW_PLAN rule 1 action enqueue FW_Q
set traffic policy FW_PWAN rule 1 action enqueue FW_Q

Step 3: Ping IP address 20.0.0.2 from DUT1:

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

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

Step 4: Ping IP address 40.0.0.2 from DUT2:

admin@DUT2$ ping 40.0.0.2 count 1 size 56 timeout 1
Show output
PING 40.0.0.2 (40.0.0.2) 56(84) bytes of data.
64 bytes from 40.0.0.2: icmp_seq=1 ttl=63 time=0.896 ms

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

Step 5: Initiate a bandwidth test from DUT2 to DUT1

admin@DUT1$ monitor test performance server port 5001
admin@DUT2$ monitor test performance client 40.0.0.2 duration 10 port 5001
Expect this output in DUT2:
Connecting to host 40.0.0.2, port 5001
[  5] local 20.0.0.2 port 51636 connected to 40.0.0.2 port 5001
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  27.6 MBytes   232 Mbits/sec    0   1.00 MBytes
[  5]   1.00-2.00   sec   115 MBytes   965 Mbits/sec  131   1.59 MBytes
[  5]   2.00-3.00   sec   124 MBytes  1.04 Gbits/sec    0   1.73 MBytes
[  5]   3.00-4.00   sec   125 MBytes  1.05 Gbits/sec  150   1.30 MBytes
[  5]   4.00-5.00   sec   144 MBytes  1.21 Gbits/sec    0   1.38 MBytes
[  5]   5.00-6.00   sec   132 MBytes  1.11 Gbits/sec    0   1.44 MBytes
[  5]   6.00-7.00   sec   129 MBytes  1.08 Gbits/sec    0   1.49 MBytes
[  5]   7.00-8.00   sec   131 MBytes  1.10 Gbits/sec    0   1.54 MBytes
[  5]   8.00-9.00   sec   128 MBytes  1.07 Gbits/sec    0   1.60 MBytes
[  5]   9.00-10.00  sec   128 MBytes  1.07 Gbits/sec   35   1.22 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.15 GBytes   992 Mbits/sec  316             sender
[  5]   0.00-10.01  sec  1.15 GBytes   989 Mbits/sec                  receiver

iperf Done.

Step 6: Run command service firewall FW show logging fast | tail at DUT0 and check if output matches the following regular expressions:

(?m)^.+(Skipping test network performance traffic).+$
Show output
02/26/2024-19:23:47.121475  [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:51626 -> 40.0.0.2:5001
02/26/2024-19:23:47.124458  [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:51636 -> 40.0.0.2:5001

Step 7: Run command system conntrack show at DUT0 and check if output matches the following regular expressions:

(?m)^tcp\s+.*src=20.0.0.2 dst=40.0.0.2.+dport=5001.*mark=129834765.*$
Show output
icmp     1 18 src=20.0.0.2 dst=40.0.0.2 type=8 code=0 id=32 packets=1 bytes=84 src=40.0.0.2 dst=20.0.0.2 type=0 code=0 id=32 packets=1 bytes=84 (Sc: not-bypass) mark=0 use=1
tcp      6 18 TIME_WAIT src=20.0.0.2 dst=40.0.0.2 sport=51626 dport=5001 packets=18 bytes=1373 src=40.0.0.2 dst=20.0.0.2 sport=5001 dport=51626 packets=16 bytes=1150 [ASSURED] (Sc: not-bypass) mark=129834765 use=1
icmp     1 17 src=40.0.0.2 dst=20.0.0.2 type=8 code=0 id=96 packets=1 bytes=84 src=20.0.0.2 dst=40.0.0.2 type=0 code=0 id=96 packets=1 bytes=84 (Sc: not-bypass) mark=0 use=1
tcp      6 8 CLOSE src=20.0.0.2 dst=40.0.0.2 sport=51636 dport=5001 packets=856283 bytes=1284418689 src=40.0.0.2 dst=20.0.0.2 sport=5001 dport=51636 packets=19865 bytes=1035016 [ASSURED] (Sc: not-bypass) mark=129834765 use=1
conntrack v1.4.5 (conntrack-tools): 4 flow entries have been shown.

Test Selectors

Description

Builds a scenario with three DUTs in which some selectors are applied to traffic depending on the network detected. This allows specific selector-based rules to be applied to traffic and with only one firewall instance.

To demonstrate this behavior, two labels will be set:

  1. WAN label that is applied to every packet going outside the local network.

  2. LAN label that marks every packet present in the underlying network.

For this purpose, a whole scenario will be used to enable all the features to work:

  • A compressed, encrypted ruleset will be created that contains base.rules as well as test-performance.rules.

  • A patch that will upgrade base.rules so it contains rules based on labels. The expected final result will be:

    alert ssh any any -> any any (msg: "Local SSH traffic - bypassing..."; selector: LOCAL; bypass; sid: 1; flow: established, to_server;)
    drop ip any any -> any any (msg:"GPL ATTACK_RESPONSE id check returned root"; content:"uid=0|28|root|29|"; classtype:bad-unknown; sid:2100498; rev:7; metadata:created_at 2010_09_23, updated_at 2010_09_23; selector: WAN;)
    pass icmp any any -> any any (msg: "ICMP traffic ignored"; sid: 3;)
    drop tcp any any -> any 5000 (msg: "Dropping TCP performance test traffic"; selector: WAN, LOCAL; sid: 4; flow: established, to_server;)
    

Hence, the following will be tested:

  1. SSH connection is working between the LAN nodes - DUT1 and DUT2

  2. It is impossible to get the nids.html file (i.e., a malicious file) from the WAN.

  3. ICMP messages are allowed from any node within the network.

  4. Traffic performance tests are allowed for both the WAN and LOCAL selectors but not on port 5000.

Scenario

Step 1: Run command file copy http://10.215.168.1/~robot/ruleset.tar.gz.aes256 running://ruleset.tar.gz force at DUT0 and expect this output:

Show output
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   352  100   352    0     0   1338      0 --:--:-- --:--:-- --:--:--  1343

Step 2: Run command file copy http://10.215.168.1/~robot/base.diff2-aes256 running:// force at DUT0 and expect this output:

Show output
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   528  100   528    0     0  24000      0 --:--:-- --:--:-- --:--:-- 24000

Step 3: Set the following configuration in DUT0:

set service firewall FW ruleset compressed running://ruleset.tar.gz
set service firewall FW ruleset compressed running://ruleset.tar.gz digest sha512
set service firewall FW ruleset compressed running://ruleset.tar.gz iterations 100000
set service firewall FW ruleset compressed running://ruleset.tar.gz key-length 256
set service firewall FW ruleset compressed running://ruleset.tar.gz password 'dV^F$@i!zLWLG#ZLU55ditGi'
set service firewall FW ruleset patch running://base.diff2-aes256
set service firewall FW ruleset patch running://base.diff2-aes256 digest sha512
set service firewall FW ruleset patch running://base.diff2-aes256 iterations 100000
set service firewall FW ruleset patch running://base.diff2-aes256 key-length 256
set service firewall FW ruleset patch running://base.diff2-aes256 password '5YG9F@H4V!#s&LVKqQ6uehy7'
set service firewall FW mode inline queue FW_Q
set service firewall FW logging outputs fast
set service firewall FW logging level config
set service firewall FW validator-timeout 20
set interfaces ethernet eth0 traffic policy in FW_PWAN
set interfaces ethernet eth0 traffic policy out FW_PWAN
set interfaces ethernet eth1 vif 101 traffic policy in FW_PLAN
set interfaces ethernet eth1 vif 201 traffic policy in FW_PLAN
set traffic queue FW_Q elements 1
set traffic policy FW_PWAN
set traffic policy FW_PLAN
set traffic selector FW_SEL
set traffic label LOCAL
set traffic label WAN
set traffic group address LAN element 40.0.0.0/24
set traffic group address LAN element 20.0.0.0/24
set traffic selector LAN rule 1 destination address-group LAN
set traffic selector LAN rule 1 source address-group LAN
set traffic policy FW_PLAN rule 1 selector LAN
set traffic policy FW_PLAN rule 1 set label LOCAL
set traffic policy FW_PLAN rule 1 action enqueue FW_Q
set traffic policy FW_PWAN rule 1 set label WAN
set traffic policy FW_PWAN rule 1 action enqueue FW_Q

Step 4: Ping IP address 20.0.0.2 from DUT1:

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

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

Step 5: Ping IP address 40.0.0.2 from DUT2:

admin@DUT2$ ping 40.0.0.2 count 1 size 56 timeout 1
Show output
PING 40.0.0.2 (40.0.0.2) 56(84) bytes of data.
64 bytes from 40.0.0.2: icmp_seq=1 ttl=63 time=0.741 ms

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

Step 6: Init an SSH connection from DUT1 to IP address 20.0.0.2 with the user admin:

admin@DUT1$ ssh admin@20.0.0.2 option StrictHostKeyChecking=no option UserKnownHostsFile=/dev/null option ConnectTimeout=1 option ServerAliveInterval=1 option ServerAliveCountMax=1
Show output
Warning: Permanently added '20.0.0.2' (ED25519) to the list of known hosts.
admin@20.0.0.2's password:
Welcome to Teldat OSDx v3.10.1.1

This system includes free software.
Contact Teldat for licenses information and source code.

Last login: Mon Feb 26 19:21:48 2024 from 40.0.0.2
admin@osdx$

Step 7: Init an SSH connection from DUT2 to IP address 40.0.0.2 with the user admin:

admin@DUT2$ ssh admin@40.0.0.2 option StrictHostKeyChecking=no option UserKnownHostsFile=/dev/null option ConnectTimeout=1 option ServerAliveInterval=1 option ServerAliveCountMax=1
Show output
Warning: Permanently added '40.0.0.2' (ED25519) to the list of known hosts.
admin@40.0.0.2's password:
Welcome to Teldat OSDx v3.10.1.1

This system includes free software.
Contact Teldat for licenses information and source code.

Last login: Mon Feb 26 19:21:48 2024 from 20.0.0.2
admin@osdx$

Step 8: Run command service firewall FW show logging fast | tail at DUT0 and check if output matches the following regular expressions:

(?m)^.+(Local SSH traffic - bypassing...).+$
Show output
02/26/2024-19:24:33.232761  [**] [1:1:0] Local SSH traffic - bypassing... [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:34206 -> 20.0.0.2:22
02/26/2024-19:24:33.675269  [**] [1:1:0] Local SSH traffic - bypassing... [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:34028 -> 40.0.0.2:22

Step 9: Expect a failure in the following command: Init an SSH connection from DUT1 to IP address 10.215.168.1 with the user admin:

admin@DUT1$ ssh admin@10.215.168.1 option StrictHostKeyChecking=no option UserKnownHostsFile=/dev/null option ConnectTimeout=1 option ServerAliveInterval=1 option ServerAliveCountMax=1

Step 10: Expect a failure in the following command: Init an SSH connection from DUT2 to IP address 10.215.168.1 with the user admin:

admin@DUT2$ ssh admin@10.215.168.1 option StrictHostKeyChecking=no option UserKnownHostsFile=/dev/null option ConnectTimeout=1 option ServerAliveInterval=1 option ServerAliveCountMax=1

Step 11: Run command service firewall FW show logging fast | tail at DUT0 and check if output matches the following regular expressions:

(?m)^.+(Outgoing TCP traffic to port 22 from LAN to WAN).+$
Show output
02/26/2024-19:24:33.232761  [**] [1:1:0] Local SSH traffic - bypassing... [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:34206 -> 20.0.0.2:22
02/26/2024-19:24:33.675269  [**] [1:1:0] Local SSH traffic - bypassing... [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:34028 -> 40.0.0.2:22
02/26/2024-19:24:34.240433  [Drop] [**] [1:5:0] Outgoing TCP traffic to port 22 from LAN to WAN [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:59642 -> 10.215.168.1:22
02/26/2024-19:24:36.428479  [Drop] [**] [1:5:0] Outgoing TCP traffic to port 22 from LAN to WAN [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:51924 -> 10.215.168.1:22

Step 12: Initiate a bandwidth test from DUT2 to DUT1

admin@DUT1$ monitor test performance server port 5001
admin@DUT2$ monitor test performance client 40.0.0.2 duration 10 port 5001
Expect this output in DUT2:
Connecting to host 40.0.0.2, port 5001
[  5] local 20.0.0.2 port 59120 connected to 40.0.0.2 port 5001
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  15.8 MBytes   132 Mbits/sec    0    643 KBytes
[  5]   1.00-2.00   sec  26.2 MBytes   220 Mbits/sec    0   1.91 MBytes
[  5]   2.00-3.00   sec  31.2 MBytes   262 Mbits/sec    0   3.02 MBytes
[  5]   3.00-4.00   sec  26.2 MBytes   221 Mbits/sec    0   3.02 MBytes
[  5]   4.00-5.00   sec  31.2 MBytes   262 Mbits/sec    0   3.02 MBytes
[  5]   5.00-6.00   sec  27.5 MBytes   231 Mbits/sec    0   3.02 MBytes
[  5]   6.00-7.00   sec  30.0 MBytes   252 Mbits/sec    0   3.02 MBytes
[  5]   7.00-8.00   sec  30.0 MBytes   252 Mbits/sec    4   2.12 MBytes
[  5]   8.00-9.00   sec  30.0 MBytes   252 Mbits/sec    0   2.32 MBytes
[  5]   9.00-10.00  sec  28.8 MBytes   241 Mbits/sec    0   2.50 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec   277 MBytes   232 Mbits/sec    4             sender
[  5]   0.00-10.05  sec   276 MBytes   230 Mbits/sec                  receiver

iperf Done.

Step 13: Initiate a bandwidth test from DUT2 to DUT1

admin@DUT1$ monitor test performance server port 5000
admin@DUT2$ monitor test performance client 40.0.0.2 duration 10 port 5000
Expect this output in DUT2:
^C- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
iperf3: interrupt - the client has terminated
admin@osdx$

Step 14: Run command service firewall FW show logging fast | tail at DUT0 and check if output matches the following regular expressions:

(?m)^.+(Dropping TCP performance test traffic).+$
Show output
02/26/2024-19:24:38.838170  [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:59116 -> 40.0.0.2:5001
02/26/2024-19:24:38.840587  [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:59120 -> 40.0.0.2:5001
02/26/2024-19:24:49.325398  [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:44002 -> 40.0.0.2:5000
02/26/2024-19:24:49.530146  [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:44002 -> 40.0.0.2:5000
02/26/2024-19:24:49.738133  [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:44002 -> 40.0.0.2:5000
02/26/2024-19:24:50.150126  [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:44002 -> 40.0.0.2:5000
02/26/2024-19:24:50.982281  [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:44002 -> 40.0.0.2:5000
02/26/2024-19:24:52.333130  [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:44002 -> 40.0.0.2:5000
02/26/2024-19:24:52.389003  [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:44002 -> 40.0.0.2:5000
02/26/2024-19:24:52.402111  [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:44002 -> 40.0.0.2:5000

Test XDP Filtering

Description

Builds a scenario with three DUTs and a simple ruleset to drop TCP traffic between DUT1 and DUT2. Such traffic must pass through port 5000 for the rule to match. Later, XDP is queried to check if packets are being dropped at the specified interface.

The contents of the rule file are:

drop tcp any any -> any 5000 (msg: "Dropping TCP performance test traffic"; sid: 1; flow: established, to_server;)

This rule allows the connection to be established and traffic to be dropped later.

Scenario

Step 1: Run command file copy http://10.215.168.1/~robot/drop-performance.rules running://drop-performance.rules force at DUT0 and expect this output:

Show output
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   200  100   200    0     0   1980      0 --:--:-- --:--:-- --:--:--  1980

Step 2: Set the following configuration in DUT0:

set service firewall FW ruleset file running://drop-performance.rules
set service firewall FW mode inline queue FW_Q
set service firewall FW logging outputs fast
set service firewall FW logging level config
set service firewall FW validator-timeout 20
set interfaces ethernet eth0 traffic policy in FW_PWAN
set interfaces ethernet eth0 traffic policy out FW_PWAN
set interfaces ethernet eth1 vif 101 traffic policy in FW_PLAN
set interfaces ethernet eth1 vif 201 traffic policy in FW_PLAN
set traffic queue FW_Q elements 1
set traffic policy FW_PWAN
set traffic policy FW_PLAN
set traffic selector FW_SEL
set traffic policy FW_PLAN rule 1 action enqueue FW_Q
set traffic policy FW_PWAN rule 1 action enqueue FW_Q
set service firewall FW stream bypass action drop set xdp-early-drop eth1

Step 3: Ping IP address 20.0.0.2 from DUT1:

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

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

Step 4: Ping IP address 40.0.0.2 from DUT2:

admin@DUT2$ ping 40.0.0.2 count 1 size 56 timeout 1
Show output
PING 40.0.0.2 (40.0.0.2) 56(84) bytes of data.
64 bytes from 40.0.0.2: icmp_seq=1 ttl=63 time=0.903 ms

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

Step 5: Initiate a bandwidth test from DUT2 to DUT1

admin@DUT1$ monitor test performance server port 5000
admin@DUT2$ monitor test performance client 40.0.0.2 duration 10 port 5000
Expect this output in DUT2:
^C- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
iperf3: interrupt - the client has terminated
admin@osdx$

Step 6: Run command service firewall FW show logging fast | tail at DUT0 and check if output matches the following regular expressions:

(?m)^.+(Dropping TCP performance test traffic).+$
Show output
02/26/2024-19:25:21.790175  [Drop] [**] [1:1:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:50746 -> 40.0.0.2:5000

Step 7: Run command service firewall FW show early-drop-stats eth1 at DUT0 and check if output matches the following regular expressions:

yes\s+\d+\s+\d+\s+[1-9]\d*\s+[1-9]\d*
Show output
------------------------------------------------------------------------
  src       dst     src port  dst port  tcp  vlan_0  vlan_1  pkts  bytes
------------------------------------------------------------------------
40.0.0.2  20.0.0.2      5000     50746  yes    2304       0     0      0
20.0.0.2  40.0.0.2     50746      5000  yes    2304       0     9    731

Step 8: Run command interfaces ethernet eth1 monitor xdp-stats times 1 at DUT0 and expect this output:

Show output
Pin path: /sys/fs/bpf/eth1
Period of 0.250150s ending at 1708975525.755160
XDP_DROP              10 pkts (         0 pps)           0 KiB (     0 Mbits/s)
XDP_PASS              15 pkts (         0 pps)           1 KiB (     0 Mbits/s)

Step 9: Initiate a bandwidth test from DUT2 to DUT1

admin@DUT1$ monitor test performance server port 5001
admin@DUT2$ monitor test performance client 40.0.0.2 duration 30 udp port 5001
Expect this output in DUT2:
^C- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Jitter    Lost/Total Datagrams
iperf3: interrupt - the client has terminated
admin@osdx$

Step 10: Run command service firewall FW show logging fast | tail at DUT0 and check if output matches the following regular expressions:

(?m)^.+(Dropping UDP performance test traffic).+$
Show output
02/26/2024-19:25:21.790175  [Drop] [**] [1:1:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:50746 -> 40.0.0.2:5000
02/26/2024-19:25:25.999139  [Drop] [**] [1:2:0] Dropping UDP performance test traffic [**] [Classification: (null)] [Priority: 3] {UDP} 20.0.0.2:54818 -> 40.0.0.2:5001

Step 11: Run command service firewall FW show early-drop-stats eth1 at DUT0 and check if output matches the following regular expressions:

yes\s+\d+\s+\d+\s+[1-9]\d*\s+[1-9]\d*
Show output
------------------------------------------------------------------------
  src       dst     src port  dst port  tcp  vlan_0  vlan_1  pkts  bytes
------------------------------------------------------------------------
40.0.0.2  20.0.0.2      5000     50746  yes    2304       0     0      0
20.0.0.2  40.0.0.2     54818      5001  no     2304       0     0      0
20.0.0.2  40.0.0.2     50746      5000  yes    2304       0    12    905
40.0.0.2  20.0.0.2      5001     54818  no     2304       0     0      0

Step 12: Run command interfaces ethernet eth1 monitor xdp-stats times 1 at DUT0 and expect this output:

Show output
Pin path: /sys/fs/bpf/eth1
Period of 0.250137s ending at 1708975529.856714
XDP_DROP              12 pkts (         0 pps)           0 KiB (     0 Mbits/s)
XDP_PASS              36 pkts (         0 pps)           2 KiB (     0 Mbits/s)