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 pinning 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=0.804 ms

--- 20.0.0.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.804/0.804/0.804/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.606 ms

--- 40.0.0.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.606/0.606/0.606/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:

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:

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
04/03/2024-21:12:51.708317  [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:33024 -> 20.0.0.2:22
04/03/2024-21:12:54.025665  [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:38876 -> 40.0.0.2:22

Test Simple Ruleset With Queues IDS Mode

Description

Configures the three DUTs that will be used and checks that they are capable of pinning 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.632 ms

--- 20.0.0.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.632/0.632/0.632/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=1.47 ms

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

Step 4: Init an SSH connection from DUT1 to IP address 20.0.0.2:

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.8.1.8-beta1

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

Last login: Wed Apr  3 20:46:03 2024 from 10.0.0.2
admin@osdx$

Step 5: Init an SSH connection from DUT2 to IP address 40.0.0.2:

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.8.1.8-beta1

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

Last login: Wed Apr  3 20:45:52 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
04/03/2024-21:13:21.064447  [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:47874 -> 40.0.0.2:22
04/03/2024-21:13:21.064453  [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:47874 -> 40.0.0.2:22
04/03/2024-21:13:21.064458  [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:47874 -> 40.0.0.2:22
04/03/2024-21:13:21.064459  [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:47874 -> 40.0.0.2:22
04/03/2024-21:13:21.064460  [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:47874 -> 40.0.0.2:22
04/03/2024-21:13:21.064462  [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:47874 -> 40.0.0.2:22
04/03/2024-21:13:21.064463  [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:47874 -> 40.0.0.2:22
04/03/2024-21:13:21.064481  [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:47874 -> 40.0.0.2:22
04/03/2024-21:13:21.067520  [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:47874 -> 40.0.0.2:22
04/03/2024-21:13:21.067529  [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:47874 -> 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   208  100   208    0     0  17333      0 --:--:-- --:--:-- --:--:-- 17333

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=0.763 ms

--- 20.0.0.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.763/0.763/0.763/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.557 ms

--- 40.0.0.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.557/0.557/0.557/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:

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:

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
04/03/2024-21:13:48.569529  [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:47978 -> 20.0.0.2:22
04/03/2024-21:13:50.776599  [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:45814 -> 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   208  100   208    0     0  13866      0 --:--:-- --:--:-- --:--:-- 13866

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  21333      0 --:--:-- --:--:-- --:--:-- 21333

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=0.752 ms

--- 20.0.0.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.752/0.752/0.752/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.723 ms

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

Step 6: Init an SSH connection from DUT1 to IP address 20.0.0.2:

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.8.1.8-beta1

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

Last login: Wed Apr  3 21:13:21 2024 from 40.0.0.2
admin@osdx$

Step 7: Init an SSH connection from DUT2 to IP address 40.0.0.2:

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.8.1.8-beta1

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

Last login: Wed Apr  3 21:13:21 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
04/03/2024-21:14:20.939518  [**] [1:2:0] SSH traffic detected - bypassing [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:48656 -> 20.0.0.2:22
04/03/2024-21:14:21.345209  [**] [1:2:0] SSH traffic detected - bypassing [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:37764 -> 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   318  100   318    0     0  21200      0 --:--:-- --:--:-- --:--:-- 21200

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  19833      0 --:--:-- --:--:-- --:--:-- 19833

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=0.628 ms

--- 20.0.0.2 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 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.568 ms

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

Step 6: Init an SSH connection from DUT1 to IP address 20.0.0.2:

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.8.1.8-beta1

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

Last login: Wed Apr  3 21:14:20 2024 from 40.0.0.2
admin@osdx$

Step 7: Init an SSH connection from DUT2 to IP address 40.0.0.2:

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.8.1.8-beta1

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

Last login: Wed Apr  3 21:14:21 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
04/03/2024-21:14:47.816281  [**] [1:2:0] SSH traffic detected - bypassing [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:53328 -> 20.0.0.2:22
04/03/2024-21:14:48.247790  [**] [1:2:0] SSH traffic detected - bypassing [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:52668 -> 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 42724 connected to 40.0.0.2 port 5001
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  32.7 MBytes   274 Mbits/sec    0   1.49 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-1.00   sec  32.7 MBytes   274 Mbits/sec    0             sender
[  5]   0.00-1.02   sec  31.1 MBytes   257 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
04/03/2024-21:14:47.816281  [**] [1:2:0] SSH traffic detected - bypassing [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:53328 -> 20.0.0.2:22
04/03/2024-21:14:48.247790  [**] [1:2:0] SSH traffic detected - bypassing [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:52668 -> 40.0.0.2:22
04/03/2024-21:14:48.858190  [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:42710 -> 40.0.0.2:5001
04/03/2024-21:14:48.860267  [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:42724 -> 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   318  100   318    0     0  21200      0 --:--:-- --:--:-- --:--:-- 21200

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=0.713 ms

--- 20.0.0.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.713/0.713/0.713/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.666 ms

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

Step 5: Init an SSH connection from DUT1 to IP address 20.0.0.2:

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.8.1.8-beta1

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

Last login: Wed Apr  3 21:14:48 2024 from 40.0.0.2
admin@osdx$

Step 6: Init an SSH connection from DUT2 to IP address 40.0.0.2:

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.8.1.8-beta1

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

Last login: Wed Apr  3 21:14:49 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 57256 connected to 40.0.0.2 port 5001
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  34.2 MBytes   287 Mbits/sec    0   1.50 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-1.00   sec  34.2 MBytes   287 Mbits/sec    0             sender
[  5]   0.00-1.02   sec  32.3 MBytes   266 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
04/03/2024-21:15:16.756073  [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:57250 -> 40.0.0.2:5001
04/03/2024-21:15:16.759089  [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:57256 -> 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  10750      0 --:--:-- --:--:-- --:--:-- 10750

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=0.715 ms

--- 20.0.0.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.715/0.715/0.715/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.763 ms

--- 40.0.0.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.763/0.763/0.763/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 49810 connected to 40.0.0.2 port 5001
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  32.0 MBytes   268 Mbits/sec    0   1.46 MBytes
[  5]   1.00-2.00   sec  30.0 MBytes   252 Mbits/sec    0   2.91 MBytes
[  5]   2.00-3.00   sec  32.5 MBytes   273 Mbits/sec    0   3.09 MBytes
[  5]   3.00-4.00   sec  31.2 MBytes   262 Mbits/sec    0   3.09 MBytes
[  5]   4.00-5.00   sec  36.2 MBytes   304 Mbits/sec  386   1.10 MBytes
[  5]   5.00-6.00   sec  31.2 MBytes   262 Mbits/sec    0   1.18 MBytes
[  5]   6.00-7.00   sec  32.5 MBytes   273 Mbits/sec    0   1.23 MBytes
[  5]   7.00-8.00   sec  35.0 MBytes   293 Mbits/sec    0   1.26 MBytes
[  5]   8.00-9.00   sec  32.5 MBytes   273 Mbits/sec    0   1.28 MBytes
[  5]   9.00-10.00  sec  32.5 MBytes   273 Mbits/sec    0   1.30 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec   326 MBytes   273 Mbits/sec  386             sender
[  5]   0.00-10.02  sec   324 MBytes   271 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
04/03/2024-21:15:43.022082  [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:49798 -> 40.0.0.2:5001
04/03/2024-21:15:43.023938  [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:49810 -> 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   7588      0 --:--:-- --:--:-- --:--:--  7588

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=6.75 ms

--- 20.0.0.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 6.754/6.754/6.754/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.988 ms

--- 40.0.0.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.988/0.988/0.988/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 33850 connected to 40.0.0.2 port 5001
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec   113 MBytes   943 Mbits/sec  491   1.62 MBytes
[  5]   1.00-2.00   sec   111 MBytes   934 Mbits/sec  102   1.24 MBytes
[  5]   2.00-3.00   sec   104 MBytes   869 Mbits/sec    0   1.31 MBytes
[  5]   3.00-4.00   sec   161 MBytes  1.35 Gbits/sec    0   1.36 MBytes
[  5]   4.00-5.00   sec   192 MBytes  1.61 Gbits/sec    0   1.46 MBytes
[  5]   5.00-6.00   sec   146 MBytes  1.23 Gbits/sec   62   1.14 MBytes
[  5]   6.00-7.00   sec   134 MBytes  1.12 Gbits/sec    0   1.24 MBytes
[  5]   7.00-8.00   sec   132 MBytes  1.11 Gbits/sec    0   1.32 MBytes
[  5]   8.00-9.00   sec   132 MBytes  1.11 Gbits/sec    0   1.38 MBytes
[  5]   9.00-10.00  sec   142 MBytes  1.20 Gbits/sec    5   1.02 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.34 GBytes  1.15 Gbits/sec  660             sender
[  5]   0.00-10.01  sec  1.33 GBytes  1.15 Gbits/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
04/03/2024-21:16:20.508377  [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:33840 -> 40.0.0.2:5001
04/03/2024-21:16:20.510578  [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:33850 -> 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 Wed 2024-04-03 21:16:09 UTC, end at Wed 2024-04-03 21:16:30 UTC. --
Apr 03 21:16:09.395855 osdx systemd-journald[625]: Runtime journal (/run/log/journal/c88512c9e850498898bc11ea5f3658d6) is 2.0M, max 16.0M, 14.0M free.
Apr 03 21:16:09.409480 osdx OSDxCLI[26389]: User 'admin' executed a new command: 'system journal clear'.
Apr 03 21:16:09.835178 osdx OSDxCLI[26389]: User 'admin' entered the configuration menu.
Apr 03 21:16:09.973912 osdx OSDxCLI[26389]: User 'admin' added a new cfg line: 'set interfaces ethernet eth0 address 10.215.168.100/24'.
Apr 03 21:16:10.124750 osdx OSDxCLI[26389]: User 'admin' added a new cfg line: 'set interfaces ethernet eth0 traffic nat source rule 1 address masquerade'.
Apr 03 21:16:10.245654 osdx OSDxCLI[26389]: User 'admin' added a new cfg line: 'set interfaces ethernet eth1 vif 101 address 40.0.0.1/8'.
Apr 03 21:16:10.379782 osdx OSDxCLI[26389]: User 'admin' added a new cfg line: 'set interfaces ethernet eth1 vif 201 address 20.0.0.1/8'.
Apr 03 21:16:10.464995 osdx OSDxCLI[26389]: User 'admin' added a new cfg line: 'set protocols static route 0.0.0.0/0 next-hop 10.215.168.1'.
Apr 03 21:16:10.555899 osdx OSDxCLI[26389]: User 'admin' added a new cfg line: 'set service dns static host-name WAN inet 10.215.168.1'.
Apr 03 21:16:10.707359 osdx kernel: 8021q: adding VLAN 0 to HW filter on device eth1
Apr 03 21:16:10.747106 osdx kernel: 8021q: adding VLAN 0 to HW filter on device eth0
Apr 03 21:16:10.786669 osdx systemd-udevd[26978]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
Apr 03 21:16:10.787079 osdx systemd-udevd[26978]: Using default interface naming scheme 'v240'.
Apr 03 21:16:10.835442 osdx systemd-udevd[26978]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
Apr 03 21:16:10.981057 osdx cfgd[1091]: [26389]Completed change to active configuration
Apr 03 21:16:11.029406 osdx OSDxCLI[26389]: User 'admin' committed the configuration.
Apr 03 21:16:11.064767 osdx OSDxCLI[26389]: User 'admin' left the configuration menu.
Apr 03 21:16:13.667821 osdx OSDxCLI[26389]: User 'admin' executed a new command: 'ping 10.215.168.1      count 1 size 56 timeout 1'.
Apr 03 21:16:13.799899 osdx OSDxCLI[26389]: User 'admin' executed a new command: 'ping 40.0.0.2      count 1 size 56 timeout 1'.
Apr 03 21:16:13.935039 osdx OSDxCLI[26389]: User 'admin' executed a new command: 'ping 20.0.0.2      count 1 size 56 timeout 1'.
Apr 03 21:16:14.767962 osdx file_operation[27061]: using src url: http://10.215.168.1/~robot/test-performance.rules dst url: running://
Apr 03 21:16:14.821329 osdx OSDxCLI[26389]: User 'admin' executed a new command: 'file copy http://10.215.168.1/~robot/test-performance.rules running:// force'.
Apr 03 21:16:15.002146 osdx OSDxCLI[26389]: User 'admin' entered the configuration menu.
Apr 03 21:16:15.145859 osdx OSDxCLI[26389]: User 'admin' added a new cfg line: 'set service firewall FW ruleset file running://test-performance.rules'.
Apr 03 21:16:15.211176 osdx zebra[1033]: [RZ3YY-GPH41][EC 100663310] snmp[warning]: Warning: Failed to connect to the agentx master agent ([NIL]):
Apr 03 21:16:15.260735 osdx OSDxCLI[26389]: User 'admin' added a new cfg line: 'set service firewall FW mode inline queue FW_Q'.
Apr 03 21:16:15.368690 osdx OSDxCLI[26389]: User 'admin' added a new cfg line: 'set service firewall FW logging outputs fast'.
Apr 03 21:16:15.501661 osdx OSDxCLI[26389]: User 'admin' added a new cfg line: 'set service firewall FW logging level config'.
Apr 03 21:16:15.618251 osdx OSDxCLI[26389]: User 'admin' added a new cfg line: 'set service firewall FW validator-timeout 20'.
Apr 03 21:16:15.671450 osdx zebra[1033]: [RZ3YY-GPH41][EC 100663310] snmp[warning]: Warning: Failed to connect to the agentx master agent ([NIL]):
Apr 03 21:16:15.724331 osdx OSDxCLI[26389]: User 'admin' added a new cfg line: 'set interfaces ethernet eth0 traffic policy in FW_PWAN'.
Apr 03 21:16:15.838485 osdx OSDxCLI[26389]: User 'admin' added a new cfg line: 'set interfaces ethernet eth0 traffic policy out FW_PWAN'.
Apr 03 21:16:15.932828 osdx OSDxCLI[26389]: User 'admin' added a new cfg line: 'set interfaces ethernet eth1 vif 101 traffic policy in FW_PLAN'.
Apr 03 21:16:16.021289 osdx OSDxCLI[26389]: User 'admin' added a new cfg line: 'set interfaces ethernet eth1 vif 201 traffic policy in FW_PLAN'.
Apr 03 21:16:16.109997 osdx OSDxCLI[26389]: User 'admin' added a new cfg line: 'set traffic queue FW_Q elements 1'.
Apr 03 21:16:16.197882 osdx OSDxCLI[26389]: User 'admin' added a new cfg line: 'set traffic policy FW_PWAN'.
Apr 03 21:16:16.288173 osdx OSDxCLI[26389]: User 'admin' added a new cfg line: 'set traffic policy FW_PLAN'.
Apr 03 21:16:16.378442 osdx OSDxCLI[26389]: User 'admin' added a new cfg line: 'set traffic selector FW_SEL'.
Apr 03 21:16:16.485601 osdx OSDxCLI[26389]: User 'admin' added a new cfg line: 'set service firewall FW stream bypass mark 129834765'.
Apr 03 21:16:16.604693 osdx OSDxCLI[26389]: User 'admin' added a new cfg line: 'set service firewall FW stream bypass mask 129834765'.
Apr 03 21:16:16.703641 osdx OSDxCLI[26389]: User 'admin' added a new cfg line: 'set traffic label BYPASS'.
Apr 03 21:16:16.827326 osdx OSDxCLI[26389]: User 'admin' added a new cfg line: 'set traffic policy FW-SKIP rule 1 log prefix SKIP'.
Apr 03 21:16:16.915294 osdx OSDxCLI[26389]: User 'admin' added a new cfg line: 'set traffic policy FW-SKIP rule 1 selector MARKED-PACKETS'.
Apr 03 21:16:17.074644 osdx OSDxCLI[26389]: User 'admin' added a new cfg line: 'set traffic policy FW-SKIP rule 1 set label BYPASS'.
Apr 03 21:16:17.180644 osdx OSDxCLI[26389]: User 'admin' added a new cfg line: 'set traffic selector MARKED-PACKETS rule 1 mark 129834765'.
Apr 03 21:16:17.303554 osdx OSDxCLI[26389]: User 'admin' added a new cfg line: 'set traffic selector FW_SEL rule 1 not label BYPASS'.
Apr 03 21:16:17.402178 osdx OSDxCLI[26389]: User 'admin' added a new cfg line: 'set traffic policy FW_PLAN rule 1 selector FW_SEL'.
Apr 03 21:16:17.519658 osdx OSDxCLI[26389]: User 'admin' added a new cfg line: 'set traffic policy FW_PWAN rule 1 selector FW_SEL'.
Apr 03 21:16:17.652437 osdx OSDxCLI[26389]: User 'admin' added a new cfg line: 'set interfaces ethernet eth1 vif 101 traffic policy out FW-SKIP'.
Apr 03 21:16:17.740462 osdx OSDxCLI[26389]: User 'admin' added a new cfg line: 'set interfaces ethernet eth1 vif 201 traffic policy out FW-SKIP'.
Apr 03 21:16:17.832558 osdx OSDxCLI[26389]: User 'admin' added a new cfg line: 'set traffic policy FW_PLAN rule 1 action enqueue FW_Q'.
Apr 03 21:16:17.924674 osdx OSDxCLI[26389]: User 'admin' added a new cfg line: 'set traffic policy FW_PWAN rule 1 action enqueue FW_Q'.
Apr 03 21:16:18.219776 osdx systemd[1]: Reloading.
Apr 03 21:16:18.419201 osdx systemd[1]: Starting Rotate log files...
Apr 03 21:16:18.428607 osdx systemd[1]: Starting Suricata client "FW" service...
Apr 03 21:16:18.447649 osdx systemd[1]: suricata@FW.service: Can't open PID file /run/suricata-FW.pid (yet?) after start: No such file or directory
Apr 03 21:16:18.455016 osdx systemd[1]: Started Suricata client "FW" service.
Apr 03 21:16:18.775401 osdx zebra[1033]: [RZ3YY-GPH41][EC 100663310] snmp[warning]: Warning: Failed to connect to the agentx master agent ([NIL]):
Apr 03 21:16:18.916868 osdx systemd[1]: logrotate.service: Succeeded.
Apr 03 21:16:18.917159 osdx systemd[1]: Started Rotate log files.
Apr 03 21:16:19.421270 osdx zebra[1033]: [RZ3YY-GPH41][EC 100663310] snmp[warning]: Warning: Failed to connect to the agentx master agent ([NIL]):
Apr 03 21:16:19.815674 osdx INFO[27178]: Rules successfully loaded
Apr 03 21:16:19.819231 osdx cfgd[1091]: [26389]Completed change to active configuration
Apr 03 21:16:19.824676 osdx OSDxCLI[26389]: User 'admin' committed the configuration.
Apr 03 21:16:19.869020 osdx OSDxCLI[26389]: User 'admin' left the configuration menu.
Apr 03 21:16:20.511000 osdx kernel: [SKIP-1]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=64146 DF PROTO=TCP SPT=33840 DPT=5001 WINDOW=502 RES=0x00 ACK PSH URGP=0 MARK=0x7bd1f0d
Apr 03 21:16:20.511096 osdx kernel: [SKIP-1]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=22063 DF PROTO=TCP SPT=33850 DPT=5001 WINDOW=502 RES=0x00 ACK PSH URGP=0 MARK=0x7bd1f0d
Apr 03 21:16:21.930286 osdx zebra[1033]: [RZ3YY-GPH41][EC 100663310] snmp[warning]: Warning: Failed to connect to the agentx master agent ([NIL]):
Apr 03 21:16:23.326079 osdx zebra[1033]: [RZ3YY-GPH41][EC 100663310] snmp[warning]: Warning: Failed to connect to the agentx master agent ([NIL]):
Apr 03 21:16:25.786016 osdx zebra[1033]: [WPPMZ-G9797] if_zebra_speed_update: eth1.201 old speed: 0 new speed: 4294967295
Apr 03 21:16:25.831622 osdx zebra[1033]: [WPPMZ-G9797] if_zebra_speed_update: eth1.101 old speed: 0 new speed: 4294967295
Apr 03 21:16:30.213521 osdx zebra[1033]: [RZ3YY-GPH41][EC 100663310] snmp[warning]: Warning: Failed to connect to the agentx master agent ([NIL]):
Apr 03 21:16:30.671492 osdx zebra[1033]: [RZ3YY-GPH41][EC 100663310] snmp[warning]: Warning: Failed to connect to the agentx master agent ([NIL]):
Apr 03 21:16:30.860993 osdx OSDxCLI[26389]: 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   9923      0 --:--:-- --:--:-- --:--:--  9923

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=22.7 ms

--- 20.0.0.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 22.673/22.673/22.673/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.686 ms

--- 40.0.0.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.686/0.686/0.686/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 34926 connected to 40.0.0.2 port 5001
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  96.7 MBytes   811 Mbits/sec  356   1.37 MBytes
[  5]   1.00-2.00   sec   111 MBytes   933 Mbits/sec    5   1.03 MBytes
[  5]   2.00-3.00   sec   116 MBytes   975 Mbits/sec    0   1.10 MBytes
[  5]   3.00-4.00   sec   108 MBytes   902 Mbits/sec    0   1.17 MBytes
[  5]   4.00-5.00   sec  66.2 MBytes   556 Mbits/sec    0   1.21 MBytes
[  5]   5.00-6.00   sec   175 MBytes  1.47 Gbits/sec    0   1.30 MBytes
[  5]   6.00-7.00   sec   131 MBytes  1.10 Gbits/sec    0   1.37 MBytes
[  5]   7.00-8.00   sec   150 MBytes  1.26 Gbits/sec    0   1.45 MBytes
[  5]   8.00-9.00   sec   188 MBytes  1.57 Gbits/sec    0   1.53 MBytes
[  5]   9.00-10.00  sec   212 MBytes  1.78 Gbits/sec  133   1.20 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.32 GBytes  1.14 Gbits/sec  494             sender
[  5]   0.00-10.00  sec  1.32 GBytes  1.13 Gbits/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
04/03/2024-21:17:02.347643  [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:34924 -> 40.0.0.2:5001
04/03/2024-21:17:02.351069  [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:34926 -> 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
udp      17 24 src=127.0.0.1 dst=127.0.0.1 sport=56716 dport=53 packets=1 bytes=55 [UNREPLIED] src=127.0.0.1 dst=127.0.0.1 sport=53 dport=56716 packets=0 bytes=0 mark=0 use=1
udp      17 21 src=127.0.0.1 dst=127.0.0.1 sport=33937 dport=53 packets=1 bytes=55 [UNREPLIED] src=127.0.0.1 dst=127.0.0.1 sport=53 dport=33937 packets=0 bytes=0 mark=0 use=1
tcp      6 9 CLOSE src=20.0.0.2 dst=40.0.0.2 sport=34926 dport=5001 packets=980496 bytes=1470735181 src=40.0.0.2 dst=20.0.0.2 sport=5001 dport=34926 packets=25406 bytes=1319680 [ASSURED] (Sc: not-bypass) mark=129834765 use=1
udp      17 22 src=127.0.0.1 dst=127.0.0.1 sport=37187 dport=53 packets=1 bytes=55 [UNREPLIED] src=127.0.0.1 dst=127.0.0.1 sport=53 dport=37187 packets=0 bytes=0 mark=0 use=1
udp      17 21 src=127.0.0.1 dst=127.0.0.1 sport=52145 dport=53 packets=1 bytes=55 [UNREPLIED] src=127.0.0.1 dst=127.0.0.1 sport=53 dport=52145 packets=0 bytes=0 mark=0 use=1
udp      17 26 src=127.0.0.1 dst=127.0.0.1 sport=40719 dport=53 packets=1 bytes=55 [UNREPLIED] src=127.0.0.1 dst=127.0.0.1 sport=53 dport=40719 packets=0 bytes=0 mark=0 use=1
udp      17 24 src=127.0.0.1 dst=127.0.0.1 sport=54757 dport=53 packets=1 bytes=55 [UNREPLIED] src=127.0.0.1 dst=127.0.0.1 sport=53 dport=54757 packets=0 bytes=0 mark=0 use=1
tcp      6 19 TIME_WAIT src=20.0.0.2 dst=40.0.0.2 sport=34924 dport=5001 packets=18 bytes=1391 src=40.0.0.2 dst=20.0.0.2 sport=5001 dport=34924 packets=16 bytes=1150 [ASSURED] (Sc: not-bypass) mark=129834765 use=1
udp      17 26 src=127.0.0.1 dst=127.0.0.1 sport=37818 dport=53 packets=1 bytes=55 [UNREPLIED] src=127.0.0.1 dst=127.0.0.1 sport=53 dport=37818 packets=0 bytes=0 mark=0 use=1
icmp     1 19 src=20.0.0.2 dst=40.0.0.2 type=8 code=0 id=30 packets=1 bytes=84 src=40.0.0.2 dst=20.0.0.2 type=0 code=0 id=30 packets=1 bytes=84 (Sc: not-bypass) mark=0 use=1
udp      17 22 src=127.0.0.1 dst=127.0.0.1 sport=34436 dport=53 packets=1 bytes=55 [UNREPLIED] src=127.0.0.1 dst=127.0.0.1 sport=53 dport=34436 packets=0 bytes=0 mark=0 use=1
icmp     1 19 src=40.0.0.2 dst=20.0.0.2 type=8 code=0 id=163 packets=1 bytes=84 src=20.0.0.2 dst=40.0.0.2 type=0 code=0 id=163 packets=1 bytes=84 (Sc: not-bypass) mark=0 use=1
conntrack v1.4.5 (conntrack-tools): 12 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   336  100   336    0     0  24000      0 --:--:-- --:--:-- --:--:-- 24000

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  44000      0 --:--:-- --:--:-- --:--:-- 44000

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=0.803 ms

--- 20.0.0.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.803/0.803/0.803/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.556 ms

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

Step 6: Init an SSH connection from DUT1 to IP address 20.0.0.2:

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.8.1.8-beta1

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

Last login: Wed Apr  3 21:15:15 2024 from 40.0.0.2
admin@osdx$

Step 7: Init an SSH connection from DUT2 to IP address 40.0.0.2:

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.8.1.8-beta1

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

Last login: Wed Apr  3 21:15:15 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
04/03/2024-21:17:43.314281  [**] [1:1:0] Local SSH traffic - bypassing... [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:40482 -> 20.0.0.2:22
04/03/2024-21:17:43.761162  [**] [1:1:0] Local SSH traffic - bypassing... [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:34868 -> 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:

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:

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
04/03/2024-21:17:43.314281  [**] [1:1:0] Local SSH traffic - bypassing... [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:40482 -> 20.0.0.2:22
04/03/2024-21:17:43.761162  [**] [1:1:0] Local SSH traffic - bypassing... [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:34868 -> 40.0.0.2:22
04/03/2024-21:17:44.271897  [Drop] [**] [1:5:0] Outgoing TCP traffic to port 22 from LAN to WAN [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:44660 -> 10.215.168.1:22
04/03/2024-21:17:45.272632  [Drop] [**] [1:5:0] Outgoing TCP traffic to port 22 from LAN to WAN [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:44660 -> 10.215.168.1:22
04/03/2024-21:17:46.490150  [Drop] [**] [1:5:0] Outgoing TCP traffic to port 22 from LAN to WAN [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:58582 -> 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 57524 connected to 40.0.0.2 port 5001
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  32.0 MBytes   268 Mbits/sec    0   1.44 MBytes
[  5]   1.00-2.00   sec  33.8 MBytes   283 Mbits/sec  519   2.06 MBytes
[  5]   2.00-3.00   sec  33.8 MBytes   283 Mbits/sec  304   1.08 MBytes
[  5]   3.00-4.00   sec  33.8 MBytes   283 Mbits/sec    0   1.14 MBytes
[  5]   4.00-5.00   sec  33.8 MBytes   283 Mbits/sec    0   1.19 MBytes
[  5]   5.00-6.00   sec  32.5 MBytes   273 Mbits/sec    0   1.22 MBytes
[  5]   6.00-7.00   sec  33.8 MBytes   283 Mbits/sec    0   1.24 MBytes
[  5]   7.00-8.00   sec  32.5 MBytes   272 Mbits/sec    0   1.25 MBytes
[  5]   8.00-9.00   sec  35.0 MBytes   294 Mbits/sec    0   1.25 MBytes
[  5]   9.00-10.00  sec  36.2 MBytes   304 Mbits/sec    0   1.25 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec   337 MBytes   283 Mbits/sec  823             sender
[  5]   0.00-10.01  sec   334 MBytes   280 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
04/03/2024-21:17:48.930905  [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:57524 -> 40.0.0.2:5001
04/03/2024-21:17:59.405042  [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:53722 -> 40.0.0.2:5000
04/03/2024-21:17:59.609639  [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:53722 -> 40.0.0.2:5000
04/03/2024-21:17:59.817720  [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:53722 -> 40.0.0.2:5000
04/03/2024-21:18:00.249693  [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:53722 -> 40.0.0.2:5000
04/03/2024-21:18:01.081705  [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:53722 -> 40.0.0.2:5000
04/03/2024-21:18:02.449930  [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:53722 -> 40.0.0.2:5000
04/03/2024-21:18:02.498592  [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:53722 -> 40.0.0.2:5000
04/03/2024-21:18:02.499141  [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:53722 -> 40.0.0.2:5000
04/03/2024-21:18:02.512688  [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:53722 -> 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  15384      0 --:--:-- --:--:-- --:--:-- 16666

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=0.597 ms

--- 20.0.0.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.597/0.597/0.597/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.645 ms

--- 40.0.0.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.645/0.645/0.645/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
04/03/2024-21:18:28.664514  [Drop] [**] [1:1:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:51936 -> 40.0.0.2:5000

Step 7: 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.250154s ending at 1712179112.423398
XDP_DROP              10 pkts (         4 pps)           0 KiB (     0 Mbits/s)
XDP_PASS              17 pkts (         4 pps)           1 KiB (     0 Mbits/s)

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 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 9: 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
04/03/2024-21:18:28.664514  [Drop] [**] [1:1:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:51936 -> 40.0.0.2:5000
04/03/2024-21:18:32.664961  [Drop] [**] [1:2:0] Dropping UDP performance test traffic [**] [Classification: (null)] [Priority: 3] {UDP} 20.0.0.2:48259 -> 40.0.0.2:5001

Step 10: 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.250151s ending at 1712179116.324665
XDP_DROP              12 pkts (         0 pps)           0 KiB (     0 Mbits/s)
XDP_PASS              38 pkts (         0 pps)           2 KiB (     0 Mbits/s)