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.
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_ENQUEUE 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 1Show 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.658 ms --- 20.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.658/0.658/0.658/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 1Show 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.784 ms --- 40.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.784/0.784/0.784/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
10/09/2024-07:54:55.916715 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:34842 -> 40.0.0.2:22 10/09/2024-07:54:56.124869 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:34842 -> 40.0.0.2:22 10/09/2024-07:54:56.125411 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:34842 -> 40.0.0.2:22 10/09/2024-07:54:56.537304 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:34842 -> 40.0.0.2:22 10/09/2024-07:54:56.564991 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:34842 -> 40.0.0.2:22 10/09/2024-07:54:56.713917 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:34842 -> 40.0.0.2:22 10/09/2024-07:54:56.949666 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:54788 -> 20.0.0.2:22 10/09/2024-07:54:56.952214 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:54788 -> 20.0.0.2:22 10/09/2024-07:54:57.368138 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:34842 -> 40.0.0.2:22 10/09/2024-07:54:57.396495 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:34842 -> 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_ENQUEUE 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 1Show output
PING 20.0.0.2 (20.0.0.2) 56(84) bytes of data. 64 bytes from 20.0.0.2: icmp_seq=1 ttl=63 time=1.05 ms --- 20.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 1.045/1.045/1.045/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 1Show 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.909 ms --- 40.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.909/0.909/0.909/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 1Show 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 1Show 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
10/09/2024-07:55:16.640349 [Drop] [**] [1:30:0] ICMP traffic dropped [**] [Classification: (null)] [Priority: 3] {ICMP} 40.0.0.2:8 -> 20.0.0.2:0 10/09/2024-07:55:17.726685 [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 1Show 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.686 ms --- 20.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 3: Ping IP address 40.0.0.2
from DUT2
:
admin@DUT2$ ping 40.0.0.2 count 1 size 56 timeout 1Show 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.852 ms --- 40.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.852/0.852/0.852/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=1Show 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.9 This system includes free software. Contact Teldat for licenses information and source code. Last login: Wed Oct 9 07:24:33 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=1Show 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.9 This system includes free software. Contact Teldat for licenses information and source code. Last login: Wed Oct 9 07:24:30 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
10/09/2024-07:55:34.871478 [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:43792 -> 40.0.0.2:22 10/09/2024-07:55:34.871765 [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:43792 -> 40.0.0.2:22 10/09/2024-07:55:34.872770 [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:43792 -> 40.0.0.2:22 10/09/2024-07:55:34.871477 [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:43792 -> 40.0.0.2:22 10/09/2024-07:55:34.871527 [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:43792 -> 40.0.0.2:22 10/09/2024-07:55:34.871527 [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:43792 -> 40.0.0.2:22 10/09/2024-07:55:34.871529 [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:43792 -> 40.0.0.2:22 10/09/2024-07:55:34.871530 [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:43792 -> 40.0.0.2:22 10/09/2024-07:55:34.871749 [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:43792 -> 40.0.0.2:22 10/09/2024-07:55:34.872769 [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:43792 -> 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 265k 0 --:--:-- --:--:-- --:--:-- 265k
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_ENQUEUE 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 1Show 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.926 ms --- 20.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.926/0.926/0.926/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 1Show 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.704 ms --- 40.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.704/0.704/0.704/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
10/09/2024-07:55:54.293659 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:52754 -> 40.0.0.2:22 10/09/2024-07:55:54.497538 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:52754 -> 40.0.0.2:22 10/09/2024-07:55:54.497609 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:52754 -> 40.0.0.2:22 10/09/2024-07:55:54.905648 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:52754 -> 40.0.0.2:22 10/09/2024-07:55:54.909603 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:52754 -> 40.0.0.2:22 10/09/2024-07:55:55.092877 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:52754 -> 40.0.0.2:22 10/09/2024-07:55:55.257993 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:42244 -> 20.0.0.2:22 10/09/2024-07:55:55.260984 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:42244 -> 20.0.0.2:22 10/09/2024-07:55:55.737721 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:52754 -> 40.0.0.2:22 10/09/2024-07:55:55.741451 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:52754 -> 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 265k 0 --:--:-- --:--:-- --:--:-- 265k
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 125k 0 --:--:-- --:--:-- --:--:-- 125k
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_ENQUEUE 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 1Show output
PING 20.0.0.2 (20.0.0.2) 56(84) bytes of data. 64 bytes from 20.0.0.2: icmp_seq=1 ttl=63 time=1.14 ms --- 20.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 1.140/1.140/1.140/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 1Show 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.872 ms --- 40.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.872/0.872/0.872/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=1Show 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.9 This system includes free software. Contact Teldat for licenses information and source code. Last login: Wed Oct 9 07:55:34 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=1Show 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.9 This system includes free software. Contact Teldat for licenses information and source code. Last login: Wed Oct 9 07:55:34 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
10/09/2024-07:56:15.163511 [**] [1:2:0] SSH traffic detected - bypassing [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:36834 -> 20.0.0.2:22 10/09/2024-07:56:15.441508 [**] [1:2:0] SSH traffic detected - bypassing [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:56268 -> 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 331 100 331 0 0 161k 0 --:--:-- --:--:-- --:--:-- 161k
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 116k 0 --:--:-- --:--:-- --:--:-- 116k
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_ENQUEUE 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 1Show output
PING 20.0.0.2 (20.0.0.2) 56(84) bytes of data. 64 bytes from 20.0.0.2: icmp_seq=1 ttl=63 time=1.04 ms --- 20.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 1.044/1.044/1.044/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 1Show 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.854 ms --- 40.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.854/0.854/0.854/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=1Show 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.9 This system includes free software. Contact Teldat for licenses information and source code. Last login: Wed Oct 9 07:56:15 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=1Show 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.9 This system includes free software. Contact Teldat for licenses information and source code. Last login: Wed Oct 9 07:56: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)^.+(SSH traffic detected - bypassing).+$Show output
10/09/2024-07:56:33.978856 [**] [1:2:0] SSH traffic detected - bypassing [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:47270 -> 20.0.0.2:22 10/09/2024-07:56:34.284421 [**] [1:2:0] SSH traffic detected - bypassing [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:40728 -> 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 5001Expect this output in
DUT2
:Connecting to host 40.0.0.2, port 5001 [ 5] local 20.0.0.2 port 34354 connected to 40.0.0.2 port 5001 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 113 MBytes 945 Mbits/sec 57 1.84 MBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-1.00 sec 113 MBytes 945 Mbits/sec 57 sender [ 5] 0.00-1.01 sec 111 MBytes 924 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
10/09/2024-07:56:33.978856 [**] [1:2:0] SSH traffic detected - bypassing [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:47270 -> 20.0.0.2:22 10/09/2024-07:56:34.284421 [**] [1:2:0] SSH traffic detected - bypassing [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:40728 -> 40.0.0.2:22 10/09/2024-07:56:34.697208 [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:34344 -> 40.0.0.2:5001 10/09/2024-07:56:34.698589 [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:34354 -> 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 331 100 331 0 0 161k 0 --:--:-- --:--:-- --:--:-- 161k
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_ENQUEUE 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 1Show output
PING 20.0.0.2 (20.0.0.2) 56(84) bytes of data. 64 bytes from 20.0.0.2: icmp_seq=1 ttl=63 time=1.12 ms --- 20.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 1.121/1.121/1.121/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 1Show 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.963 ms --- 40.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.963/0.963/0.963/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=1Show 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.9 This system includes free software. Contact Teldat for licenses information and source code. Last login: Wed Oct 9 07:56:33 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=1Show 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.9 This system includes free software. Contact Teldat for licenses information and source code. Last login: Wed Oct 9 07:56:34 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 5001Expect this output in
DUT2
:Connecting to host 40.0.0.2, port 5001 [ 5] local 20.0.0.2 port 52934 connected to 40.0.0.2 port 5001 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 57.5 MBytes 482 Mbits/sec 0 2.78 MBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-1.00 sec 57.5 MBytes 482 Mbits/sec 0 sender [ 5] 0.00-1.02 sec 57.3 MBytes 469 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
10/09/2024-07:56:53.174163 [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:52920 -> 40.0.0.2:5001 10/09/2024-07:56:53.175293 [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:52934 -> 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 64500 0 --:--:-- --:--:-- --:--:-- 64500
Step 2: Run command file show running://test-performance.rules
at DUT0
and expect this output:
Show output
alert tcp any any -> any 5001 (msg: "Skipping test network performance traffic"; bypass; flow: established, to_server; sid: 40;)
Step 3: 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_ENQUEUE 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 4: Ping IP address 20.0.0.2
from DUT1
:
admin@DUT1$ ping 20.0.0.2 count 1 size 56 timeout 1Show 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.962 ms --- 20.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.962/0.962/0.962/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 1Show 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.730 ms --- 40.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.730/0.730/0.730/0.000 ms
Step 6: 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 5001Expect this output in
DUT2
:Connecting to host 40.0.0.2, port 5001 [ 5] local 20.0.0.2 port 36872 connected to 40.0.0.2 port 5001 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 114 MBytes 952 Mbits/sec 25 1.93 MBytes [ 5] 1.00-2.00 sec 110 MBytes 923 Mbits/sec 0 2.11 MBytes [ 5] 2.00-3.00 sec 111 MBytes 933 Mbits/sec 0 2.25 MBytes [ 5] 3.00-4.00 sec 109 MBytes 912 Mbits/sec 1 1.68 MBytes [ 5] 4.00-5.00 sec 105 MBytes 881 Mbits/sec 0 1.76 MBytes [ 5] 5.00-6.00 sec 109 MBytes 912 Mbits/sec 0 1.83 MBytes [ 5] 6.00-7.00 sec 108 MBytes 902 Mbits/sec 0 1.88 MBytes [ 5] 7.00-8.00 sec 106 MBytes 891 Mbits/sec 0 1.91 MBytes [ 5] 8.00-9.00 sec 68.8 MBytes 577 Mbits/sec 0 1.93 MBytes [ 5] 9.00-10.00 sec 58.8 MBytes 493 Mbits/sec 400 1.37 MBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 999 MBytes 838 Mbits/sec 426 sender [ 5] 0.00-10.01 sec 997 MBytes 836 Mbits/sec receiver iperf Done.
Step 7: 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
10/09/2024-07:57:11.752603 [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:36862 -> 40.0.0.2:5001 10/09/2024-07:57:11.753843 [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:36872 -> 40.0.0.2:5001
Test Capture Bypass Using Packet Mark
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 Local Bypass 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 14333 0 --:--:-- --:--:-- --:--:-- 14333
Step 2: Run command file show running://test-performance.rules
at DUT0
and expect this output:
Show output
alert tcp any any -> any 5001 (msg: "Skipping test network performance traffic"; bypass; flow: established, to_server; sid: 40;)
Step 3: 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_ENQUEUE 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_ENQUEUE rule 1 not label BYPASS set traffic policy FW_PLAN rule 1 selector FW_SEL_ENQUEUE 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 4: Ping IP address 20.0.0.2
from DUT1
:
admin@DUT1$ ping 20.0.0.2 count 1 size 56 timeout 1Show output
PING 20.0.0.2 (20.0.0.2) 56(84) bytes of data. 64 bytes from 20.0.0.2: icmp_seq=1 ttl=63 time=1.28 ms --- 20.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 1.283/1.283/1.283/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 1Show 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.29 ms --- 40.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 1.293/1.293/1.293/0.000 ms
Step 6: 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 5001Expect this output in
DUT2
:Connecting to host 40.0.0.2, port 5001 [ 5] local 20.0.0.2 port 59332 connected to 40.0.0.2 port 5001 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 267 MBytes 2.24 Gbits/sec 21 2.25 MBytes [ 5] 1.00-2.00 sec 294 MBytes 2.46 Gbits/sec 0 2.44 MBytes [ 5] 2.00-3.00 sec 292 MBytes 2.45 Gbits/sec 0 2.58 MBytes [ 5] 3.00-4.00 sec 341 MBytes 2.86 Gbits/sec 236 1.90 MBytes [ 5] 4.00-5.00 sec 186 MBytes 1.56 Gbits/sec 0 2.02 MBytes [ 5] 5.00-6.00 sec 315 MBytes 2.64 Gbits/sec 0 2.10 MBytes [ 5] 6.00-7.00 sec 370 MBytes 3.10 Gbits/sec 0 2.20 MBytes [ 5] 7.00-8.00 sec 338 MBytes 2.83 Gbits/sec 0 2.31 MBytes [ 5] 8.00-9.00 sec 338 MBytes 2.83 Gbits/sec 0 2.42 MBytes [ 5] 9.00-10.00 sec 264 MBytes 2.21 Gbits/sec 0 2.49 MBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 2.93 GBytes 2.52 Gbits/sec 257 sender [ 5] 0.00-10.00 sec 2.93 GBytes 2.52 Gbits/sec receiver iperf Done.
Step 7: 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
10/09/2024-07:57:47.529221 [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:59316 -> 40.0.0.2:5001 10/09/2024-07:57:47.530532 [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:59332 -> 40.0.0.2:5001
Step 8: 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-10-09 07:57:40 UTC, end at Wed 2024-10-09 07:57:57 UTC. -- Oct 09 07:57:40.017910 osdx systemd-timedated[12347]: Changed local time to Wed Oct 9 07:57:40 2024 Oct 09 07:57:40.019127 osdx OSDxCLI[11926]: User 'admin' executed a new command: 'set date 2024-10-09 07:57:40'. Oct 09 07:57:40.291663 osdx systemd-journald[5179]: Runtime journal (/run/log/journal/7b13f98cf6974d34b6af66a5ac8a2ed7) is 4.0M, max 16.0M, 11.9M free. Oct 09 07:57:40.303877 osdx OSDxCLI[11926]: User 'admin' executed a new command: 'system journal clear'. Oct 09 07:57:40.641622 osdx osdx-coredump[12380]: Deleting all coredumps in /opt/vyatta/etc/config/coredump... Oct 09 07:57:40.647538 osdx OSDxCLI[11926]: User 'admin' executed a new command: 'system coredump delete all'. Oct 09 07:57:41.163828 osdx OSDxCLI[11926]: User 'admin' entered the configuration menu. Oct 09 07:57:41.228111 osdx OSDxCLI[11926]: User 'admin' added a new cfg line: 'set interfaces ethernet eth0 address 10.215.168.64/24'. Oct 09 07:57:41.314644 osdx OSDxCLI[11926]: User 'admin' added a new cfg line: 'set interfaces ethernet eth0 traffic nat source rule 1 address masquerade'. Oct 09 07:57:41.367109 osdx OSDxCLI[11926]: User 'admin' added a new cfg line: 'set interfaces ethernet eth1 vif 101 address 40.0.0.1/8'. Oct 09 07:57:41.456340 osdx OSDxCLI[11926]: User 'admin' added a new cfg line: 'set interfaces ethernet eth1 vif 201 address 20.0.0.1/8'. Oct 09 07:57:41.508501 osdx OSDxCLI[11926]: User 'admin' added a new cfg line: 'set protocols static route 0.0.0.0/0 next-hop 10.215.168.1'. Oct 09 07:57:41.600768 osdx OSDxCLI[11926]: User 'admin' added a new cfg line: 'set service dns static host-name WAN inet 10.215.168.1'. Oct 09 07:57:41.676277 osdx kernel: 8021q: adding VLAN 0 to HW filter on device eth0 Oct 09 07:57:41.716301 osdx kernel: 8021q: adding VLAN 0 to HW filter on device eth1 Oct 09 07:57:41.737840 osdx systemd-udevd[12503]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable. Oct 09 07:57:41.738216 osdx systemd-udevd[12503]: Using default interface naming scheme 'v240'. Oct 09 07:57:41.754385 osdx systemd-udevd[12503]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable. Oct 09 07:57:41.880716 osdx cfgd[1327]: [11926]Completed change to active configuration Oct 09 07:57:41.908102 osdx OSDxCLI[11926]: User 'admin' committed the configuration. Oct 09 07:57:41.929025 osdx OSDxCLI[11926]: User 'admin' left the configuration menu. Oct 09 07:57:43.524153 osdx OSDxCLI[11926]: User 'admin' executed a new command: 'ping 10.215.168.1 count 1 size 56 timeout 1'. Oct 09 07:57:43.590991 osdx OSDxCLI[11926]: User 'admin' executed a new command: 'ping 40.0.0.2 count 1 size 56 timeout 1'. Oct 09 07:57:43.717644 osdx OSDxCLI[11926]: User 'admin' executed a new command: 'ping 20.0.0.2 count 1 size 56 timeout 1'. Oct 09 07:57:44.207913 osdx file_operation[12586]: using src url: http://10.215.168.1/~robot/test-performance.rules dst url: running:// Oct 09 07:57:44.236419 osdx OSDxCLI[11926]: User 'admin' executed a new command: 'file copy http://10.215.168.1/~robot/test-performance.rules running:// force'. Oct 09 07:57:44.423585 osdx OSDxCLI[11926]: User 'admin' executed a new command: 'file show running://test-performance.rules'. Oct 09 07:57:44.555813 osdx OSDxCLI[11926]: User 'admin' entered the configuration menu. Oct 09 07:57:44.612306 osdx OSDxCLI[11926]: User 'admin' added a new cfg line: 'set service firewall FW ruleset file running://test-performance.rules'. Oct 09 07:57:44.700320 osdx OSDxCLI[11926]: User 'admin' added a new cfg line: 'set service firewall FW mode inline queue FW_Q'. Oct 09 07:57:44.751740 osdx OSDxCLI[11926]: User 'admin' added a new cfg line: 'set service firewall FW logging outputs fast'. Oct 09 07:57:44.844575 osdx OSDxCLI[11926]: User 'admin' added a new cfg line: 'set service firewall FW logging level config'. Oct 09 07:57:44.891907 osdx OSDxCLI[11926]: User 'admin' added a new cfg line: 'set service firewall FW validator-timeout 20'. Oct 09 07:57:44.997249 osdx OSDxCLI[11926]: User 'admin' added a new cfg line: 'set interfaces ethernet eth0 traffic policy in FW_PWAN'. Oct 09 07:57:45.047915 osdx OSDxCLI[11926]: User 'admin' added a new cfg line: 'set interfaces ethernet eth0 traffic policy out FW_PWAN'. Oct 09 07:57:45.144107 osdx OSDxCLI[11926]: User 'admin' added a new cfg line: 'set interfaces ethernet eth1 vif 101 traffic policy in FW_PLAN'. Oct 09 07:57:45.195109 osdx OSDxCLI[11926]: User 'admin' added a new cfg line: 'set interfaces ethernet eth1 vif 201 traffic policy in FW_PLAN'. Oct 09 07:57:45.284311 osdx OSDxCLI[11926]: User 'admin' added a new cfg line: 'set traffic queue FW_Q elements 1'. Oct 09 07:57:45.333658 osdx OSDxCLI[11926]: User 'admin' added a new cfg line: 'set traffic policy FW_PWAN'. Oct 09 07:57:45.423980 osdx OSDxCLI[11926]: User 'admin' added a new cfg line: 'set traffic policy FW_PLAN'. Oct 09 07:57:45.478368 osdx OSDxCLI[11926]: User 'admin' added a new cfg line: 'set traffic selector FW_SEL_ENQUEUE'. Oct 09 07:57:45.576078 osdx OSDxCLI[11926]: User 'admin' added a new cfg line: 'set service firewall FW stream bypass mark 129834765'. Oct 09 07:57:45.625786 osdx OSDxCLI[11926]: User 'admin' added a new cfg line: 'set service firewall FW stream bypass mask 129834765'. Oct 09 07:57:45.718082 osdx OSDxCLI[11926]: User 'admin' added a new cfg line: 'set traffic label BYPASS'. Oct 09 07:57:45.774423 osdx OSDxCLI[11926]: User 'admin' added a new cfg line: 'set traffic policy FW-SKIP rule 1 log prefix SKIP'. Oct 09 07:57:45.865409 osdx OSDxCLI[11926]: User 'admin' added a new cfg line: 'set traffic policy FW-SKIP rule 1 selector MARKED-PACKETS'. Oct 09 07:57:45.919435 osdx OSDxCLI[11926]: User 'admin' added a new cfg line: 'set traffic policy FW-SKIP rule 1 set label BYPASS'. Oct 09 07:57:46.015010 osdx OSDxCLI[11926]: User 'admin' added a new cfg line: 'set traffic selector MARKED-PACKETS rule 1 mark 129834765'. Oct 09 07:57:46.069936 osdx OSDxCLI[11926]: User 'admin' added a new cfg line: 'set traffic selector FW_SEL_ENQUEUE rule 1 not label BYPASS'. Oct 09 07:57:46.158597 osdx OSDxCLI[11926]: User 'admin' added a new cfg line: 'set traffic policy FW_PLAN rule 1 selector FW_SEL_ENQUEUE'. Oct 09 07:57:46.220719 osdx OSDxCLI[11926]: User 'admin' added a new cfg line: 'set interfaces ethernet eth1 vif 101 traffic policy out FW-SKIP'. Oct 09 07:57:46.300497 osdx OSDxCLI[11926]: User 'admin' added a new cfg line: 'set interfaces ethernet eth1 vif 201 traffic policy out FW-SKIP'. Oct 09 07:57:46.353878 osdx OSDxCLI[11926]: User 'admin' added a new cfg line: 'set traffic policy FW_PLAN rule 1 action enqueue FW_Q'. Oct 09 07:57:46.451368 osdx OSDxCLI[11926]: User 'admin' added a new cfg line: 'set traffic policy FW_PWAN rule 1 action enqueue FW_Q'. Oct 09 07:57:46.890359 osdx systemd[1]: Reloading. Oct 09 07:57:46.984745 osdx systemd[1]: Starting Suricata client "FW" service... Oct 09 07:57:46.996235 osdx systemd[1]: Started Suricata client "FW" service. Oct 09 07:57:47.172358 osdx INFO[12730]: Rules successfully loaded Oct 09 07:57:47.175791 osdx cfgd[1327]: [11926]Completed change to active configuration Oct 09 07:57:47.178488 osdx OSDxCLI[11926]: User 'admin' committed the configuration. Oct 09 07:57:47.199757 osdx OSDxCLI[11926]: User 'admin' left the configuration menu. Oct 09 07:57:47.532334 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=31328 DF PROTO=TCP SPT=59316 DPT=5001 WINDOW=502 RES=0x00 ACK PSH URGP=0 MARK=0x7bd1f0d Oct 09 07:57:47.532421 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=42274 DF PROTO=TCP SPT=59332 DPT=5001 WINDOW=502 RES=0x00 ACK PSH URGP=0 MARK=0x7bd1f0d Oct 09 07:57:56.737555 osdx zebra[1280]: [WPPMZ-G9797] if_zebra_speed_update: eth1.201 old speed: 0 new speed: 4294967295 Oct 09 07:57:56.754345 osdx zebra[1280]: [WPPMZ-G9797] if_zebra_speed_update: eth1.101 old speed: 0 new speed: 4294967295 Oct 09 07:57:57.850924 osdx OSDxCLI[11926]: User 'admin' executed a new command: 'service firewall FW show logging fast | tail'.
Test Capture Bypass Using Conntrack Mark
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 Local Bypass test.
Then, the test is broaden by configuring “Capture bypass drop” to also avoid dropped packets from entering the firewall.
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 7166 0 --:--:-- --:--:-- --:--:-- 7166
Step 2: Run command file show running://test-performance.rules
at DUT0
and expect this output:
Show output
alert tcp any any -> any 5001 (msg: "Skipping test network performance traffic"; bypass; flow: established, to_server; sid: 40;)
Step 3: 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_ENQUEUE 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_ENQUEUE rule 1 not connmark 129834765 set traffic policy FW_PLAN rule 2 action enqueue FW_Q set traffic policy FW_PLAN rule 2 selector FW_SEL_ENQUEUE
Step 4: Ping IP address 20.0.0.2
from DUT1
:
admin@DUT1$ ping 20.0.0.2 count 1 size 56 timeout 1Show output
PING 20.0.0.2 (20.0.0.2) 56(84) bytes of data. 64 bytes from 20.0.0.2: icmp_seq=1 ttl=63 time=1.08 ms --- 20.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 1.078/1.078/1.078/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 1Show 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.584 ms --- 40.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.584/0.584/0.584/0.000 ms
Step 6: 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 5001Expect this output in
DUT2
:Connecting to host 40.0.0.2, port 5001 [ 5] local 20.0.0.2 port 45078 connected to 40.0.0.2 port 5001 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 330 MBytes 2.77 Gbits/sec 2 2.25 MBytes [ 5] 1.00-2.00 sec 321 MBytes 2.69 Gbits/sec 392 1.72 MBytes [ 5] 2.00-3.00 sec 321 MBytes 2.69 Gbits/sec 0 1.85 MBytes [ 5] 3.00-4.00 sec 332 MBytes 2.79 Gbits/sec 0 1.98 MBytes [ 5] 4.00-5.00 sec 341 MBytes 2.86 Gbits/sec 236 1.50 MBytes [ 5] 5.00-6.00 sec 354 MBytes 2.97 Gbits/sec 0 1.66 MBytes [ 5] 6.00-7.00 sec 352 MBytes 2.96 Gbits/sec 0 1.81 MBytes [ 5] 7.00-8.00 sec 360 MBytes 3.02 Gbits/sec 0 1.95 MBytes [ 5] 8.00-9.00 sec 352 MBytes 2.96 Gbits/sec 392 1.54 MBytes [ 5] 9.00-10.00 sec 328 MBytes 2.75 Gbits/sec 0 1.69 MBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 3.31 GBytes 2.85 Gbits/sec 1022 sender [ 5] 0.00-10.00 sec 3.31 GBytes 2.84 Gbits/sec receiver iperf Done.
Step 7: 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
10/09/2024-07:58:24.096782 [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:45074 -> 40.0.0.2:5001 10/09/2024-07:58:24.098378 [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:45078 -> 40.0.0.2:5001
Step 8: Run command system conntrack show
at DUT0
and check if output matches the following regular expressions:
(?m)^tcp\s+.*src=20.0.0.2 dst=40.0.0.2.+dport=5001.*mark=129834765.*$Show output
icmp 1 19 src=20.0.0.2 dst=40.0.0.2 type=8 code=0 id=71 packets=1 bytes=84 src=40.0.0.2 dst=20.0.0.2 type=0 code=0 id=71 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=45078 dport=5001 packets=2457703 bytes=3686448377 src=40.0.0.2 dst=20.0.0.2 sport=5001 dport=45078 packets=93139 bytes=4844256 [ASSURED] (Sc: not-bypass) mark=129834765 use=1 tcp 6 19 TIME_WAIT src=20.0.0.2 dst=40.0.0.2 sport=45074 dport=5001 packets=18 bytes=1389 src=40.0.0.2 dst=20.0.0.2 sport=5001 dport=45074 packets=16 bytes=1149 [ASSURED] (Sc: not-bypass) mark=129834765 use=1 icmp 1 19 src=40.0.0.2 dst=20.0.0.2 type=8 code=0 id=182 packets=1 bytes=84 src=20.0.0.2 dst=40.0.0.2 type=0 code=0 id=182 packets=1 bytes=84 (Sc: not-bypass) mark=0 use=1 conntrack v1.4.5 (conntrack-tools): 4 flow entries have been shown.
Step 9: Run command file copy http://10.215.168.1/~robot/drop-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 200 100 200 0 0 97k 0 --:--:-- --:--:-- --:--:-- 97k
Step 10: Run command file show running://drop-performance.rules
at DUT0
and expect this output:
Show output
drop tcp any any -> any 5000 (msg: "Dropping TCP performance test traffic"; sid: 1; flow: established, to_server;) drop udp any any -> any 5001 (msg: "Dropping UDP performance test traffic"; sid: 2;)
Step 11: Set the following configuration in DUT0
:
set service firewall FW ruleset file running://drop-performance.rules set service firewall FW bypass action drop set connmark mark 147652983 set traffic policy FW_PLAN rule 1 action drop set traffic policy FW_PLAN rule 1 selector FW_SEL_DROP set traffic selector FW_SEL_DROP rule 1 connmark 147652983
Step 12: 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 5000Expect this output in
DUT2
:^C- - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr iperf3: interrupt - the client has terminated admin@osdx$
Step 13: 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
10/09/2024-07:58:24.096782 [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:45074 -> 40.0.0.2:5001 10/09/2024-07:58:24.098378 [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:45078 -> 40.0.0.2:5001 10/09/2024-07:58:37.915539 [Drop] [**] [1:1:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:39194 -> 40.0.0.2:5000
Step 14: 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=5000.*mark=147652983.*$Show output
tcp 6 29 LAST_ACK src=20.0.0.2 dst=40.0.0.2 sport=39194 dport=5000 packets=8 bytes=610 src=40.0.0.2 dst=20.0.0.2 sport=5000 dport=39194 packets=4 bytes=217 [ASSURED] (Sc: not-bypass) mark=147652983 use=1 conntrack v1.4.5 (conntrack-tools): 1 flow entries have been shown.
Step 15: Run command traffic policy FW_PLAN show
at DUT0
and check if output matches the following regular expressions:
(?m)^1\s+FW_SEL_DROP\s+[1-9].*$Show output
Policy FW_PLAN -- ifc eth1.101 -- hook in prio very-high --------------------------------------------------------------------- rule selector pkts match pkts eval bytes match bytes eval --------------------------------------------------------------------- 1 FW_SEL_DROP 4 5 210 270 2 FW_SEL_ENQUEUE 1 1 60 60 --------------------------------------------------------------------- Total 5 5 270 270 Policy FW_PLAN -- ifc eth1.201 -- hook in prio very-high --------------------------------------------------------------------- rule selector pkts match pkts eval bytes match bytes eval --------------------------------------------------------------------- 1 FW_SEL_DROP 6 9 499 700 2 FW_SEL_ENQUEUE 3 3 201 201 --------------------------------------------------------------------- Total 9 9 700 700
Test Capture And Offload
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. In addition, OSDx is instructed to accelerate the flow using internal accelerators.
Performance must improve considerably compared to the previous test, to reach its top value.
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 64500 0 --:--:-- --:--:-- --:--:-- 64500
Step 2: Run command file show running://test-performance.rules
at DUT0
and expect this output:
Show output
alert tcp any any -> any 5001 (msg: "Skipping test network performance traffic"; bypass; flow: established, to_server; sid: 40;)
Step 3: 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_ENQUEUE 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_ENQUEUE rule 1 not connmark 129834765 set traffic policy FW_PLAN rule 2 action enqueue FW_Q set traffic policy FW_PLAN rule 2 selector FW_SEL_ENQUEUE set service firewall FW stream bypass action accept set conntrack offload-flag set system offload timeout 60 set system conntrack timeout tcp established 60 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 1Show output
PING 20.0.0.2 (20.0.0.2) 56(84) bytes of data. 64 bytes from 20.0.0.2: icmp_seq=1 ttl=63 time=1.44 ms --- 20.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 1.436/1.436/1.436/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 1Show 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.13 ms --- 40.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 1.133/1.133/1.133/0.000 ms
Step 6: Run command monitor test performance server port 5001
at DUT1
.
Step 7: Run command monitor test performance client 40.0.0.2 duration 10 port 5001
at DUT2
.
Step 8: 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
10/09/2024-07:59:02.582610 [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:34882 -> 40.0.0.2:5001 10/09/2024-07:59:02.583853 [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:34886 -> 40.0.0.2:5001
Step 9: 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.+OFFLOAD.+mark=129834765.*$Show output
icmp 1 29 src=20.0.0.2 dst=40.0.0.2 type=8 code=0 id=74 packets=1 bytes=84 src=40.0.0.2 dst=20.0.0.2 type=0 code=0 id=74 packets=1 bytes=84 (Sc: not-bypass) mark=0 use=1 tcp 6 src=20.0.0.2 dst=40.0.0.2 sport=34882 dport=5001 packets=9 bytes=617 src=40.0.0.2 dst=20.0.0.2 sport=5001 dport=34882 packets=8 bytes=428 [ASSURED] [OFFLOAD, packets=6 bytes=416 packets=5 bytes=263] mark=129834765 use=2 icmp 1 29 src=40.0.0.2 dst=20.0.0.2 type=8 code=0 id=185 packets=1 bytes=84 src=20.0.0.2 dst=40.0.0.2 type=0 code=0 id=185 packets=1 bytes=84 (Sc: not-bypass) mark=0 use=1 tcp 6 src=20.0.0.2 dst=40.0.0.2 sport=34886 dport=5001 packets=47099 bytes=70629953 src=40.0.0.2 dst=20.0.0.2 sport=5001 dport=34886 packets=2223 bytes=116600 [ASSURED] [OFFLOAD, packets=47088 bytes=70617752 packets=2221 bytes=116488] mark=129834765 use=2 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:
WAN
label that is applied to every packet going outside the local network.
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 astest-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:
SSH connection is working between the LAN nodes - DUT1 and DUT2
It is impossible to get the
nids.html
file (i.e., a malicious file) from the WAN.ICMP messages are allowed from any node within the network.
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 114k 0 --:--:-- --:--:-- --:--:-- 171k
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 58666 0 --:--:-- --:--:-- --:--:-- 58666
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_ENQUEUE 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 1Show output
PING 20.0.0.2 (20.0.0.2) 56(84) bytes of data. 64 bytes from 20.0.0.2: icmp_seq=1 ttl=63 time=1.01 ms --- 20.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 1.007/1.007/1.007/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 1Show 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.737 ms --- 40.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.737/0.737/0.737/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=1Show 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.9 This system includes free software. Contact Teldat for licenses information and source code. Last login: Wed Oct 9 07:56:52 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=1Show 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.9 This system includes free software. Contact Teldat for licenses information and source code. Last login: Wed Oct 9 07:56:52 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
10/09/2024-07:59:21.958485 [**] [1:1:0] Local SSH traffic - bypassing... [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:38198 -> 20.0.0.2:22 10/09/2024-07:59:22.252969 [**] [1:1:0] Local SSH traffic - bypassing... [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:41970 -> 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
10/09/2024-07:59:21.958485 [**] [1:1:0] Local SSH traffic - bypassing... [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:38198 -> 20.0.0.2:22 10/09/2024-07:59:22.252969 [**] [1:1:0] Local SSH traffic - bypassing... [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:41970 -> 40.0.0.2:22 10/09/2024-07:59:22.639326 [Drop] [**] [1:5:0] Outgoing TCP traffic to port 22 from LAN to WAN [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:37810 -> 10.215.168.1:22 10/09/2024-07:59:24.724517 [Drop] [**] [1:5:0] Outgoing TCP traffic to port 22 from LAN to WAN [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:56292 -> 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 5001Expect this output in
DUT2
:Connecting to host 40.0.0.2, port 5001 [ 5] local 20.0.0.2 port 42706 connected to 40.0.0.2 port 5001 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 110 MBytes 923 Mbits/sec 5 1.78 MBytes [ 5] 1.00-2.00 sec 106 MBytes 891 Mbits/sec 0 1.94 MBytes [ 5] 2.00-3.00 sec 105 MBytes 881 Mbits/sec 0 2.07 MBytes [ 5] 3.00-4.00 sec 98.8 MBytes 829 Mbits/sec 0 2.17 MBytes [ 5] 4.00-5.00 sec 111 MBytes 933 Mbits/sec 0 2.25 MBytes [ 5] 5.00-6.00 sec 111 MBytes 933 Mbits/sec 14 2.20 MBytes [ 5] 6.00-7.00 sec 106 MBytes 891 Mbits/sec 0 1.72 MBytes [ 5] 7.00-8.00 sec 109 MBytes 912 Mbits/sec 0 1.81 MBytes [ 5] 8.00-9.00 sec 106 MBytes 891 Mbits/sec 0 1.87 MBytes [ 5] 9.00-10.00 sec 110 MBytes 923 Mbits/sec 0 1.91 MBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 1.05 GBytes 901 Mbits/sec 19 sender [ 5] 0.00-10.01 sec 1.05 GBytes 899 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 5000Expect 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
10/09/2024-07:59:26.999216 [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:42706 -> 40.0.0.2:5001 10/09/2024-07:59:37.247126 [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:37516 -> 40.0.0.2:5000 10/09/2024-07:59:37.450085 [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:37516 -> 40.0.0.2:5000 10/09/2024-07:59:37.654071 [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:37516 -> 40.0.0.2:5000 10/09/2024-07:59:38.085684 [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:37516 -> 40.0.0.2:5000 10/09/2024-07:59:38.917705 [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:37516 -> 40.0.0.2:5000 10/09/2024-07:59:40.264071 [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:37516 -> 40.0.0.2:5000 10/09/2024-07:59:40.286087 [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:37516 -> 40.0.0.2:5000 10/09/2024-07:59:40.286248 [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:37516 -> 40.0.0.2:5000 10/09/2024-07:59:40.301233 [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:37516 -> 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 18181 0 --:--:-- --:--:-- --:--:-- 18181
Step 2: Run command file show running://drop-performance.rules
at DUT0
and expect this output:
Show output
drop tcp any any -> any 5000 (msg: "Dropping TCP performance test traffic"; sid: 1; flow: established, to_server;) drop udp any any -> any 5001 (msg: "Dropping UDP performance test traffic"; sid: 2;)
Step 3: 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_ENQUEUE 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 4: Ping IP address 20.0.0.2
from DUT1
:
admin@DUT1$ ping 20.0.0.2 count 1 size 56 timeout 1Show 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.985 ms --- 20.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.985/0.985/0.985/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 1Show 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.962 ms --- 40.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.962/0.962/0.962/0.000 ms
Step 6: 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 5000Expect this output in
DUT2
:^C- - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr iperf3: interrupt - the client has terminated admin@osdx$
Step 7: 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
10/09/2024-07:59:59.033533 [Drop] [**] [1:1:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:41252 -> 40.0.0.2:5000
Step 8: Run command service firewall FW show early-drop-stats eth1
at DUT0
and check if output matches the following regular expressions:
yes\s+201\s+\d+\s+[1-9]\d*\s+[1-9]\d*Show output
------------------------------------------------------------------------ src dst src port dst port tcp vlan_0 vlan_1 pkts bytes ------------------------------------------------------------------------ 40.0.0.2 20.0.0.2 5000 41252 yes 201 0 0 0 20.0.0.2 40.0.0.2 41252 5000 yes 201 0 9 731
Step 9: 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.250146s ending at 1728460802.743639 XDP_DROP 9 pkts ( 0 pps) 0 KiB ( 0 Mbits/s) XDP_PASS 13 pkts ( 0 pps) 1 KiB ( 0 Mbits/s)
Step 10: 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 5001Expect this output in
DUT2
:^C- - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams iperf3: interrupt - the client has terminated admin@osdx$
Step 11: 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
10/09/2024-07:59:59.033533 [Drop] [**] [1:1:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:41252 -> 40.0.0.2:5000 10/09/2024-08:00:02.873044 [Drop] [**] [1:2:0] Dropping UDP performance test traffic [**] [Classification: (null)] [Priority: 3] {UDP} 20.0.0.2:41731 -> 40.0.0.2:5001
Step 12: Run command service firewall FW show early-drop-stats eth1
at DUT0
and check if output matches the following regular expressions:
yes\s+201\s+\d+\s+[1-9]\d*\s+[1-9]\d*Show output
------------------------------------------------------------------------ src dst src port dst port tcp vlan_0 vlan_1 pkts bytes ------------------------------------------------------------------------ 40.0.0.2 20.0.0.2 5000 41252 yes 201 0 0 0 20.0.0.2 40.0.0.2 41731 5001 no 201 0 0 0 20.0.0.2 40.0.0.2 41252 5000 yes 201 0 12 905 40.0.0.2 20.0.0.2 5001 41731 no 201 0 0 0
Step 13: 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.250289s ending at 1728460806.463563 XDP_DROP 12 pkts ( 0 pps) 0 KiB ( 0 Mbits/s) XDP_PASS 37 pkts ( 0 pps) 2 KiB ( 0 Mbits/s)