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/topology16.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=0.801 ms

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

--- 40.0.0.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.571/0.571/0.571/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
06/12/2024-21:41:29.007705  [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:47456 -> 40.0.0.2:22
06/12/2024-21:41:29.213842  [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:47456 -> 40.0.0.2:22
06/12/2024-21:41:29.215719  [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:47456 -> 40.0.0.2:22
06/12/2024-21:41:29.631616  [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:47456 -> 40.0.0.2:22
06/12/2024-21:41:29.637671  [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:47456 -> 40.0.0.2:22
06/12/2024-21:41:29.702322  [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:47234 -> 20.0.0.2:22
06/12/2024-21:41:29.729359  [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:47234 -> 20.0.0.2:22
06/12/2024-21:41:29.803302  [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:47456 -> 40.0.0.2:22
06/12/2024-21:41:30.463695  [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:47456 -> 40.0.0.2:22
06/12/2024-21:41:30.469721  [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:47456 -> 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.931 ms

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

--- 40.0.0.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.570/0.570/0.570/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
06/12/2024-21:41:58.947191  [Drop] [**] [1:30:0] ICMP traffic dropped [**] [Classification: (null)] [Priority: 3] {ICMP} 40.0.0.2:8 -> 20.0.0.2:0
06/12/2024-21:42:00.073656  [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.709 ms

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

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

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

Last login: Wed Jun 12 21:14:06 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.4

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

Last login: Wed Jun 12 21:07:12 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
06/12/2024-21:42:25.145593  [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:53530 -> 40.0.0.2:22
06/12/2024-21:42:25.146058  [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:53530 -> 40.0.0.2:22
06/12/2024-21:42:25.148533  [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:53530 -> 40.0.0.2:22
06/12/2024-21:42:25.145591  [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:53530 -> 40.0.0.2:22
06/12/2024-21:42:25.145700  [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:53530 -> 40.0.0.2:22
06/12/2024-21:42:25.145702  [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:53530 -> 40.0.0.2:22
06/12/2024-21:42:25.145705  [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:53530 -> 40.0.0.2:22
06/12/2024-21:42:25.145706  [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:53530 -> 40.0.0.2:22
06/12/2024-21:42:25.146040  [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:53530 -> 40.0.0.2:22
06/12/2024-21:42:25.148523  [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:53530 -> 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   5787      0 --:--:-- --:--:-- --:--:--  5787

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.851 ms

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

--- 40.0.0.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.619/0.619/0.619/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
06/12/2024-21:42:53.739762  [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:58140 -> 40.0.0.2:22
06/12/2024-21:42:53.941683  [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:58140 -> 40.0.0.2:22
06/12/2024-21:42:53.943651  [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:58140 -> 40.0.0.2:22
06/12/2024-21:42:54.345811  [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:58140 -> 40.0.0.2:22
06/12/2024-21:42:54.351782  [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:58140 -> 40.0.0.2:22
06/12/2024-21:42:54.538307  [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:58140 -> 40.0.0.2:22
06/12/2024-21:42:54.633392  [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:34746 -> 20.0.0.2:22
06/12/2024-21:42:54.640021  [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:34746 -> 20.0.0.2:22
06/12/2024-21:42:55.177870  [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:58140 -> 40.0.0.2:22
06/12/2024-21:42:55.183729  [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:58140 -> 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  90666      0 --:--:-- --:--:-- --:--:-- 90666

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  19692      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.688 ms

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

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

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

Last login: Wed Jun 12 21:42:24 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.4

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

Last login: Wed Jun 12 21:42:24 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
06/12/2024-21:43:23.070934  [**] [1:2:0] SSH traffic detected - bypassing [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:40732 -> 20.0.0.2:22
06/12/2024-21:43:23.505021  [**] [1:2:0] SSH traffic detected - bypassing [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:54912 -> 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   162k      0 --:--:-- --:--:-- --:--:--  162k

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

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.856 ms

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

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

Last login: Wed Jun 12 21:43:22 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.4

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

Last login: Wed Jun 12 21:43:23 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
06/12/2024-21:43:48.849244  [**] [1:2:0] SSH traffic detected - bypassing [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:41534 -> 20.0.0.2:22
06/12/2024-21:43:49.230138  [**] [1:2:0] SSH traffic detected - bypassing [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:56386 -> 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 57720 connected to 40.0.0.2 port 5001
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  76.9 MBytes   645 Mbits/sec   32   1.33 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-1.00   sec  76.9 MBytes   645 Mbits/sec   32             sender
[  5]   0.00-1.01   sec  75.6 MBytes   630 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
06/12/2024-21:43:48.849244  [**] [1:2:0] SSH traffic detected - bypassing [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:41534 -> 20.0.0.2:22
06/12/2024-21:43:49.230138  [**] [1:2:0] SSH traffic detected - bypassing [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:56386 -> 40.0.0.2:22
06/12/2024-21:43:49.957698  [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:57706 -> 40.0.0.2:5001
06/12/2024-21:43:49.960007  [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:57720 -> 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  30181      0 --:--:-- --:--:-- --:--:-- 30181

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.816 ms

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

--- 40.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 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.4

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

Last login: Wed Jun 12 21:43:49 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.4

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

Last login: Wed Jun 12 21:43: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 48404 connected to 40.0.0.2 port 5001
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  79.5 MBytes   666 Mbits/sec  126   1.35 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-1.00   sec  79.5 MBytes   666 Mbits/sec  126             sender
[  5]   0.00-1.01   sec  76.8 MBytes   640 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
06/12/2024-21:44:18.931121  [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:48394 -> 40.0.0.2:5001
06/12/2024-21:44:18.932952  [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:48404 -> 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  43000      0 --:--:-- --:--:-- --:--:-- 43000

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.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 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=2.84 ms

--- 40.0.0.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 2.842/2.842/2.842/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 45318 connected to 40.0.0.2 port 5001
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  70.5 MBytes   589 Mbits/sec  133   1.34 MBytes
[  5]   1.00-2.00   sec  72.5 MBytes   611 Mbits/sec    0   1.47 MBytes
[  5]   2.00-3.00   sec  77.5 MBytes   650 Mbits/sec    0   1.58 MBytes
[  5]   3.00-4.00   sec  77.5 MBytes   650 Mbits/sec   62   1.17 MBytes
[  5]   4.00-5.00   sec  88.8 MBytes   744 Mbits/sec    0   1.25 MBytes
[  5]   5.00-6.00   sec  78.8 MBytes   661 Mbits/sec    0   1.31 MBytes
[  5]   6.00-7.00   sec  76.2 MBytes   640 Mbits/sec    0   1.35 MBytes
[  5]   7.00-8.00   sec  65.0 MBytes   545 Mbits/sec    0   1.38 MBytes
[  5]   8.00-9.00   sec  78.8 MBytes   661 Mbits/sec    0   1.39 MBytes
[  5]   9.00-10.00  sec  85.0 MBytes   713 Mbits/sec    0   1.43 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec   771 MBytes   646 Mbits/sec  195             sender
[  5]   0.00-10.01  sec   769 MBytes   644 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
06/12/2024-21:44:48.809445  [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:45316 -> 40.0.0.2:5001
06/12/2024-21:44:48.812804  [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:45318 -> 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=0.924 ms

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

--- 40.0.0.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.761/0.761/0.761/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 59908 connected to 40.0.0.2 port 5001
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec   161 MBytes  1.35 Gbits/sec  171   1.07 MBytes
[  5]   1.00-2.01   sec   118 MBytes   981 Mbits/sec    0   1.15 MBytes
[  5]   2.01-3.00   sec   136 MBytes  1.15 Gbits/sec    0   1.23 MBytes
[  5]   3.00-4.00   sec   135 MBytes  1.13 Gbits/sec    0   1.30 MBytes
[  5]   4.00-5.00   sec   142 MBytes  1.19 Gbits/sec    0   1.38 MBytes
[  5]   5.00-6.00   sec   126 MBytes  1.06 Gbits/sec   24   1.08 MBytes
[  5]   6.00-7.00   sec  95.0 MBytes   796 Mbits/sec    0   1.18 MBytes
[  5]   7.00-8.00   sec   102 MBytes   860 Mbits/sec    0   1.26 MBytes
[  5]   8.00-9.00   sec   156 MBytes  1.31 Gbits/sec    0   1.31 MBytes
[  5]   9.00-10.00  sec   232 MBytes  1.95 Gbits/sec    0   1.38 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.37 GBytes  1.18 Gbits/sec  195             sender
[  5]   0.00-10.00  sec  1.37 GBytes  1.18 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
06/12/2024-21:45:31.530620  [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:59906 -> 40.0.0.2:5001
06/12/2024-21:45:31.532435  [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:59908 -> 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-06-12 21:45:19 UTC, end at Wed 2024-06-12 21:45:41 UTC. --
Jun 12 21:45:19.000462 osdx systemd-timedated[13457]: Changed local time to Wed Jun 12 21:45:19 2024
Jun 12 21:45:19.002416 osdx OSDxCLI[13025]: User 'admin' executed a new command: 'set date 2024-06-12 21:45:19'.
Jun 12 21:45:19.465279 osdx systemd-journald[1508]: Runtime journal (/run/log/journal/f8d19df27e8d4f24a0b0e24ed9aec425) is 6.0M, max 16.0M, 9.9M free.
Jun 12 21:45:19.501113 osdx OSDxCLI[13025]: User 'admin' executed a new command: 'system journal clear'.
Jun 12 21:45:20.101852 osdx osdx-coredump[13490]: Deleting all coredumps in /opt/vyatta/etc/config/coredump...
Jun 12 21:45:20.109804 osdx OSDxCLI[13025]: User 'admin' executed a new command: 'system coredump delete all'.
Jun 12 21:45:20.937819 osdx OSDxCLI[13025]: User 'admin' entered the configuration menu.
Jun 12 21:45:21.072599 osdx OSDxCLI[13025]: User 'admin' added a new cfg line: 'set interfaces ethernet eth0 address 10.215.168.64/24'.
Jun 12 21:45:21.161564 osdx OSDxCLI[13025]: User 'admin' added a new cfg line: 'set interfaces ethernet eth0 traffic nat source rule 1 address masquerade'.
Jun 12 21:45:21.285155 osdx OSDxCLI[13025]: User 'admin' added a new cfg line: 'set interfaces ethernet eth1 vif 101 address 40.0.0.1/8'.
Jun 12 21:45:21.368569 osdx OSDxCLI[13025]: User 'admin' added a new cfg line: 'set interfaces ethernet eth1 vif 201 address 20.0.0.1/8'.
Jun 12 21:45:21.484670 osdx OSDxCLI[13025]: User 'admin' added a new cfg line: 'set protocols static route 0.0.0.0/0 next-hop 10.215.168.1'.
Jun 12 21:45:21.578351 osdx OSDxCLI[13025]: User 'admin' added a new cfg line: 'set service dns static host-name WAN inet 10.215.168.1'.
Jun 12 21:45:21.742699 osdx kernel: 8021q: adding VLAN 0 to HW filter on device eth0
Jun 12 21:45:21.778706 osdx kernel: 8021q: adding VLAN 0 to HW filter on device eth1
Jun 12 21:45:21.792490 osdx systemd-udevd[13565]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
Jun 12 21:45:21.792566 osdx systemd-udevd[13565]: Using default interface naming scheme 'v240'.
Jun 12 21:45:21.819371 osdx systemd-udevd[13573]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
Jun 12 21:45:21.819434 osdx systemd-udevd[13573]: Using default interface naming scheme 'v240'.
Jun 12 21:45:21.983951 osdx cfgd[1122]: [13025]Completed change to active configuration
Jun 12 21:45:22.033177 osdx OSDxCLI[13025]: User 'admin' committed the configuration.
Jun 12 21:45:22.057848 osdx OSDxCLI[13025]: User 'admin' left the configuration menu.
Jun 12 21:45:24.603164 osdx OSDxCLI[13025]: User 'admin' executed a new command: 'ping 10.215.168.1      count 1 size 56 timeout 1'.
Jun 12 21:45:24.748892 osdx OSDxCLI[13025]: User 'admin' executed a new command: 'ping 40.0.0.2      count 1 size 56 timeout 1'.
Jun 12 21:45:24.884030 osdx OSDxCLI[13025]: User 'admin' executed a new command: 'ping 20.0.0.2      count 1 size 56 timeout 1'.
Jun 12 21:45:25.829516 osdx file_operation[13646]: using src url: http://10.215.168.1/~robot/test-performance.rules dst url: running://
Jun 12 21:45:25.884708 osdx OSDxCLI[13025]: User 'admin' executed a new command: 'file copy http://10.215.168.1/~robot/test-performance.rules running:// force'.
Jun 12 21:45:26.082715 osdx OSDxCLI[13025]: User 'admin' entered the configuration menu.
Jun 12 21:45:26.189086 osdx OSDxCLI[13025]: User 'admin' added a new cfg line: 'set service firewall FW ruleset file running://test-performance.rules'.
Jun 12 21:45:26.285416 osdx OSDxCLI[13025]: User 'admin' added a new cfg line: 'set service firewall FW mode inline queue FW_Q'.
Jun 12 21:45:26.382644 osdx OSDxCLI[13025]: User 'admin' added a new cfg line: 'set service firewall FW logging outputs fast'.
Jun 12 21:45:26.478059 osdx OSDxCLI[13025]: User 'admin' added a new cfg line: 'set service firewall FW logging level config'.
Jun 12 21:45:26.573425 osdx OSDxCLI[13025]: User 'admin' added a new cfg line: 'set service firewall FW validator-timeout 20'.
Jun 12 21:45:26.695007 osdx OSDxCLI[13025]: User 'admin' added a new cfg line: 'set interfaces ethernet eth0 traffic policy in FW_PWAN'.
Jun 12 21:45:26.779940 osdx OSDxCLI[13025]: User 'admin' added a new cfg line: 'set interfaces ethernet eth0 traffic policy out FW_PWAN'.
Jun 12 21:45:26.883703 osdx OSDxCLI[13025]: User 'admin' added a new cfg line: 'set interfaces ethernet eth1 vif 101 traffic policy in FW_PLAN'.
Jun 12 21:45:27.028549 osdx OSDxCLI[13025]: User 'admin' added a new cfg line: 'set interfaces ethernet eth1 vif 201 traffic policy in FW_PLAN'.
Jun 12 21:45:27.169608 osdx OSDxCLI[13025]: User 'admin' added a new cfg line: 'set traffic queue FW_Q elements 1'.
Jun 12 21:45:27.288128 osdx OSDxCLI[13025]: User 'admin' added a new cfg line: 'set traffic policy FW_PWAN'.
Jun 12 21:45:27.544100 osdx OSDxCLI[13025]: User 'admin' added a new cfg line: 'set traffic policy FW_PLAN'.
Jun 12 21:45:27.640591 osdx OSDxCLI[13025]: User 'admin' added a new cfg line: 'set traffic selector FW_SEL'.
Jun 12 21:45:27.742702 osdx OSDxCLI[13025]: User 'admin' added a new cfg line: 'set service firewall FW stream bypass mark 129834765'.
Jun 12 21:45:27.859325 osdx OSDxCLI[13025]: User 'admin' added a new cfg line: 'set service firewall FW stream bypass mask 129834765'.
Jun 12 21:45:27.950239 osdx OSDxCLI[13025]: User 'admin' added a new cfg line: 'set traffic label BYPASS'.
Jun 12 21:45:28.057915 osdx OSDxCLI[13025]: User 'admin' added a new cfg line: 'set traffic policy FW-SKIP rule 1 log prefix SKIP'.
Jun 12 21:45:28.225790 osdx OSDxCLI[13025]: User 'admin' added a new cfg line: 'set traffic policy FW-SKIP rule 1 selector MARKED-PACKETS'.
Jun 12 21:45:28.337658 osdx OSDxCLI[13025]: User 'admin' added a new cfg line: 'set traffic policy FW-SKIP rule 1 set label BYPASS'.
Jun 12 21:45:28.435380 osdx OSDxCLI[13025]: User 'admin' added a new cfg line: 'set traffic selector MARKED-PACKETS rule 1 mark 129834765'.
Jun 12 21:45:28.555210 osdx OSDxCLI[13025]: User 'admin' added a new cfg line: 'set traffic selector FW_SEL rule 1 not label BYPASS'.
Jun 12 21:45:28.639386 osdx OSDxCLI[13025]: User 'admin' added a new cfg line: 'set traffic policy FW_PLAN rule 1 selector FW_SEL'.
Jun 12 21:45:28.777852 osdx OSDxCLI[13025]: User 'admin' added a new cfg line: 'set traffic policy FW_PWAN rule 1 selector FW_SEL'.
Jun 12 21:45:28.896679 osdx OSDxCLI[13025]: User 'admin' added a new cfg line: 'set interfaces ethernet eth1 vif 101 traffic policy out FW-SKIP'.
Jun 12 21:45:28.998268 osdx OSDxCLI[13025]: User 'admin' added a new cfg line: 'set interfaces ethernet eth1 vif 201 traffic policy out FW-SKIP'.
Jun 12 21:45:29.095946 osdx OSDxCLI[13025]: User 'admin' added a new cfg line: 'set traffic policy FW_PLAN rule 1 action enqueue FW_Q'.
Jun 12 21:45:29.272099 osdx OSDxCLI[13025]: User 'admin' added a new cfg line: 'set traffic policy FW_PWAN rule 1 action enqueue FW_Q'.
Jun 12 21:45:30.273285 osdx systemd[1]: Reloading.
Jun 12 21:45:30.462003 osdx systemd[1]: Starting Suricata client "FW" service...
Jun 12 21:45:30.483311 osdx systemd[1]: Started Suricata client "FW" service.
Jun 12 21:45:30.827757 osdx INFO[13782]: Rules successfully loaded
Jun 12 21:45:30.832182 osdx cfgd[1122]: [13025]Completed change to active configuration
Jun 12 21:45:30.836395 osdx OSDxCLI[13025]: User 'admin' committed the configuration.
Jun 12 21:45:30.884151 osdx OSDxCLI[13025]: User 'admin' left the configuration menu.
Jun 12 21:45:31.534711 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=2336 DF PROTO=TCP SPT=59906 DPT=5001 WINDOW=502 RES=0x00 ACK PSH URGP=0 MARK=0x7bd1f0d
Jun 12 21:45:31.534817 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=24492 DF PROTO=TCP SPT=59908 DPT=5001 WINDOW=502 RES=0x00 ACK PSH URGP=0 MARK=0x7bd1f0d
Jun 12 21:45:36.794324 osdx zebra[1075]: [WPPMZ-G9797] if_zebra_speed_update: eth1.201 old speed: 0 new speed: 4294967295
Jun 12 21:45:36.818992 osdx zebra[1075]: [WPPMZ-G9797] if_zebra_speed_update: eth1.101 old speed: 0 new speed: 4294967295
Jun 12 21:45:41.775140 osdx OSDxCLI[13025]: 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  43000      0 --:--:-- --:--:-- --:--:-- 43000

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

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

--- 40.0.0.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.679/0.679/0.679/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 51694 connected to 40.0.0.2 port 5001
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec   173 MBytes  1.45 Gbits/sec  424   1.16 MBytes
[  5]   1.00-2.00   sec   130 MBytes  1.09 Gbits/sec    0   1.24 MBytes
[  5]   2.00-3.00   sec   115 MBytes   964 Mbits/sec    0   1.30 MBytes
[  5]   3.00-4.00   sec   145 MBytes  1.22 Gbits/sec    0   1.37 MBytes
[  5]   4.00-5.00   sec   142 MBytes  1.20 Gbits/sec   26   1.01 MBytes
[  5]   5.00-6.00   sec   118 MBytes   986 Mbits/sec    0   1.14 MBytes
[  5]   6.00-7.00   sec   135 MBytes  1.13 Gbits/sec    0   1.23 MBytes
[  5]   7.00-8.00   sec   181 MBytes  1.52 Gbits/sec    0   1.31 MBytes
[  5]   8.00-9.00   sec   189 MBytes  1.58 Gbits/sec    0   1.37 MBytes
[  5]   9.00-10.00  sec   188 MBytes  1.57 Gbits/sec   50   1.03 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.48 GBytes  1.27 Gbits/sec  500             sender
[  5]   0.00-10.00  sec  1.48 GBytes  1.27 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
06/12/2024-21:46:08.052646  [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:51692 -> 40.0.0.2:5001
06/12/2024-21:46:08.054273  [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:51694 -> 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
tcp      6 19 TIME_WAIT src=20.0.0.2 dst=40.0.0.2 sport=51692 dport=5001 packets=18 bytes=1391 src=40.0.0.2 dst=20.0.0.2 sport=5001 dport=51692 packets=16 bytes=1148 [ASSURED] (Sc: not-bypass) mark=129834765 use=1
icmp     1 19 src=20.0.0.2 dst=40.0.0.2 type=8 code=0 id=31 packets=1 bytes=84 src=40.0.0.2 dst=20.0.0.2 type=0 code=0 id=31 packets=1 bytes=84 (Sc: not-bypass) mark=0 use=1
icmp     1 19 src=40.0.0.2 dst=20.0.0.2 type=8 code=0 id=69 packets=1 bytes=84 src=20.0.0.2 dst=40.0.0.2 type=0 code=0 id=69 packets=1 bytes=84 (Sc: not-bypass) mark=0 use=1
tcp      6 9 CLOSE src=20.0.0.2 dst=40.0.0.2 sport=51694 dport=5001 packets=1097058 bytes=1645574549 src=40.0.0.2 dst=20.0.0.2 sport=5001 dport=51694 packets=23624 bytes=1231564 [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  20705      0 --:--:-- --:--:-- --:--:-- 20705

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   257k      0 --:--:-- --:--:-- --:--:--  257k

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.812 ms

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

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

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

Last login: Wed Jun 12 21:44:17 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.4

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

Last login: Wed Jun 12 21:44:18 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
06/12/2024-21:46:49.005392  [**] [1:1:0] Local SSH traffic - bypassing... [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:54194 -> 20.0.0.2:22
06/12/2024-21:46:49.474423  [**] [1:1:0] Local SSH traffic - bypassing... [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:40144 -> 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
06/12/2024-21:46:49.005392  [**] [1:1:0] Local SSH traffic - bypassing... [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:54194 -> 20.0.0.2:22
06/12/2024-21:46:49.474423  [**] [1:1:0] Local SSH traffic - bypassing... [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:40144 -> 40.0.0.2:22
06/12/2024-21:46:50.044053  [Drop] [**] [1:5:0] Outgoing TCP traffic to port 22 from LAN to WAN [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:52338 -> 10.215.168.1:22
06/12/2024-21:46:52.257315  [Drop] [**] [1:5:0] Outgoing TCP traffic to port 22 from LAN to WAN [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:51122 -> 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 58000 connected to 40.0.0.2 port 5001
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  70.6 MBytes   592 Mbits/sec  213   1.26 MBytes
[  5]   1.00-2.00   sec  80.0 MBytes   672 Mbits/sec    0   1.35 MBytes
[  5]   2.00-3.00   sec  63.8 MBytes   535 Mbits/sec    0   1.41 MBytes
[  5]   3.00-4.00   sec  80.0 MBytes   671 Mbits/sec    0   1.46 MBytes
[  5]   4.00-5.00   sec  76.2 MBytes   640 Mbits/sec    0   1.49 MBytes
[  5]   5.00-6.00   sec  70.0 MBytes   587 Mbits/sec    0   1.51 MBytes
[  5]   6.00-7.00   sec  60.0 MBytes   503 Mbits/sec   25   1.11 MBytes
[  5]   7.00-8.00   sec  58.8 MBytes   493 Mbits/sec    0   1.17 MBytes
[  5]   8.00-9.00   sec  77.5 MBytes   650 Mbits/sec    0   1.22 MBytes
[  5]   9.00-10.00  sec  82.5 MBytes   692 Mbits/sec    0   1.25 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec   719 MBytes   603 Mbits/sec  238             sender
[  5]   0.00-10.00  sec   717 MBytes   601 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
06/12/2024-21:46:54.633890  [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:58000 -> 40.0.0.2:5001
06/12/2024-21:47:04.995442  [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:58794 -> 40.0.0.2:5000
06/12/2024-21:47:05.198863  [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:58794 -> 40.0.0.2:5000
06/12/2024-21:47:05.402816  [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:58794 -> 40.0.0.2:5000
06/12/2024-21:47:05.806910  [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:58794 -> 40.0.0.2:5000
06/12/2024-21:47:06.638862  [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:58794 -> 40.0.0.2:5000
06/12/2024-21:47:08.051191  [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:58794 -> 40.0.0.2:5000
06/12/2024-21:47:08.091863  [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:58794 -> 40.0.0.2:5000
06/12/2024-21:47:08.092461  [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:58794 -> 40.0.0.2:5000
06/12/2024-21:47:08.104798  [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:58794 -> 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  66666      0 --:--:-- --:--:-- --:--:-- 66666

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.798 ms

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

--- 40.0.0.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.820/0.820/0.820/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
06/12/2024-21:47:34.429173  [Drop] [**] [1:1:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:41588 -> 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
------------------------------------------------------------------------
20.0.0.2  40.0.0.2     41588      5000  yes    2304       0     9    731
40.0.0.2  20.0.0.2      5000     41588  yes    2304       0     0      0

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.250175s ending at 1718228858.289304
XDP_DROP              10 pkts (         4 pps)           0 KiB (     0 Mbits/s)
XDP_PASS              16 pkts (         4 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
06/12/2024-21:47:34.429173  [Drop] [**] [1:1:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:41588 -> 40.0.0.2:5000
06/12/2024-21:47:38.502983  [Drop] [**] [1:2:0] Dropping UDP performance test traffic [**] [Classification: (null)] [Priority: 3] {UDP} 20.0.0.2:45678 -> 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
------------------------------------------------------------------------
20.0.0.2  40.0.0.2     45678      5001  no     2304       0     0      0
20.0.0.2  40.0.0.2     41588      5000  yes    2304       0    12    905
40.0.0.2  20.0.0.2      5000     41588  yes    2304       0     0      0
40.0.0.2  20.0.0.2      5001     45678  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.250166s ending at 1718228862.371815
XDP_DROP              12 pkts (         0 pps)           0 KiB (     0 Mbits/s)
XDP_PASS              37 pkts (         0 pps)           2 KiB (     0 Mbits/s)