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 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.865 ms --- 20.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.865/0.865/0.865/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.831 ms --- 40.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.831/0.831/0.831/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/20/2024-17:25:53.192112 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:53830 -> 40.0.0.2:22 06/20/2024-17:25:53.397995 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:53830 -> 40.0.0.2:22 06/20/2024-17:25:53.400130 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:53830 -> 40.0.0.2:22 06/20/2024-17:25:53.818138 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:53830 -> 40.0.0.2:22 06/20/2024-17:25:53.828196 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:53830 -> 40.0.0.2:22 06/20/2024-17:25:53.987519 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:53830 -> 40.0.0.2:22 06/20/2024-17:25:54.041763 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:34176 -> 20.0.0.2:22 06/20/2024-17:25:54.052639 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:34176 -> 20.0.0.2:22 06/20/2024-17:25:54.649973 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:53830 -> 40.0.0.2:22 06/20/2024-17:25:54.660132 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:53830 -> 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 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.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 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.714 ms --- 40.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.714/0.714/0.714/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
06/20/2024-17:26:22.329764 [Drop] [**] [1:30:0] ICMP traffic dropped [**] [Classification: (null)] [Priority: 3] {ICMP} 40.0.0.2:8 -> 20.0.0.2:0 06/20/2024-17:26:23.471116 [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.567 ms --- 20.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.567/0.567/0.567/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.718 ms --- 40.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.718/0.718/0.718/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.5 This system includes free software. Contact Teldat for licenses information and source code. Last login: Thu Jun 20 16:28:38 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.5 This system includes free software. Contact Teldat for licenses information and source code. Last login: Thu Jun 20 16:21:18 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/20/2024-17:26:48.296043 [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:42688 -> 40.0.0.2:22 06/20/2024-17:26:48.333316 [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:42688 -> 40.0.0.2:22 06/20/2024-17:26:48.333867 [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:42688 -> 40.0.0.2:22 06/20/2024-17:26:48.334025 [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:42688 -> 40.0.0.2:22 06/20/2024-17:26:48.334183 [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:42688 -> 40.0.0.2:22 06/20/2024-17:26:48.340258 [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:42688 -> 40.0.0.2:22 06/20/2024-17:26:48.340365 [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:42688 -> 40.0.0.2:22 06/20/2024-17:26:48.340371 [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:42688 -> 40.0.0.2:22 06/20/2024-17:26:48.340725 [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:42688 -> 40.0.0.2:22 06/20/2024-17:26:48.343233 [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:42688 -> 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 54400 0 --:--:-- --:--:-- --:--:-- 68000
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 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.944 ms --- 20.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.944/0.944/0.944/0.000 ms
Step 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.491 ms --- 40.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.491/0.491/0.491/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/20/2024-17:27:16.931090 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:34840 -> 40.0.0.2:22 06/20/2024-17:27:17.132995 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:34840 -> 40.0.0.2:22 06/20/2024-17:27:17.135064 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:34840 -> 40.0.0.2:22 06/20/2024-17:27:17.552957 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:34840 -> 40.0.0.2:22 06/20/2024-17:27:17.563168 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:34840 -> 40.0.0.2:22 06/20/2024-17:27:17.730305 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:34840 -> 40.0.0.2:22 06/20/2024-17:27:17.840675 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:45782 -> 20.0.0.2:22 06/20/2024-17:27:17.851674 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:45782 -> 20.0.0.2:22 06/20/2024-17:27:18.384973 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:34840 -> 40.0.0.2:22 06/20/2024-17:27:18.395178 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:34840 -> 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 68000 0 --:--:-- --:--:-- --:--:-- 68000
Step 2: Run command file copy http://10.215.168.1/~robot/base-enc.diff1 running:// force
at DUT0
and expect this output:
Show output
% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 256 100 256 0 0 21333 0 --:--:-- --:--:-- --:--:-- 21333
Step 3: Set the following configuration in DUT0
:
set service firewall FW ruleset file running://base-enc.rules set service firewall FW ruleset file running://base-enc.rules digest sha512 set service firewall FW ruleset file running://base-enc.rules iterations 100000 set service firewall FW ruleset file running://base-enc.rules key-length 256 set service firewall FW ruleset file running://base-enc.rules password 'dV^F$@i!zLWLG#ZLU55ditGi' set service firewall FW ruleset patch running://base-enc.diff1 set service firewall FW ruleset patch running://base-enc.diff1 digest sha512 set service firewall FW ruleset patch running://base-enc.diff1 iterations 100000 set service firewall FW ruleset patch running://base-enc.diff1 key-length 256 set service firewall FW ruleset patch running://base-enc.diff1 password '5YG9F@H4V!#s&LVKqQ6uehy7' set service firewall FW mode inline queue FW_Q set service firewall FW logging outputs fast set service firewall FW logging level config set service firewall FW validator-timeout 20 set interfaces ethernet eth0 traffic policy in FW_PWAN set interfaces ethernet eth0 traffic policy out FW_PWAN set interfaces ethernet eth1 vif 101 traffic policy in FW_PLAN set interfaces ethernet eth1 vif 201 traffic policy in FW_PLAN set traffic queue FW_Q elements 1 set traffic policy FW_PWAN set traffic policy FW_PLAN set traffic selector FW_SEL set traffic policy FW_PLAN rule 1 action enqueue FW_Q set traffic policy FW_PWAN rule 1 action enqueue FW_Q
Step 4: Ping IP address 20.0.0.2
from DUT1
:
admin@DUT1$ ping 20.0.0.2 count 1 size 56 timeout 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.767 ms --- 20.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.767/0.767/0.767/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.671 ms --- 40.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.671/0.671/0.671/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.5 This system includes free software. Contact Teldat for licenses information and source code. Last login: Thu Jun 20 17:26:47 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.5 This system includes free software. Contact Teldat for licenses information and source code. Last login: Thu Jun 20 17:26:48 2024 from 20.0.0.2 admin@osdx$
Step 8: Run command service firewall FW show logging fast | tail
at DUT0
and check if output matches the following regular expressions:
(?m)^.+(SSH traffic detected - bypassing).+$Show output
06/20/2024-17:27:44.140495 [**] [1:2:0] SSH traffic detected - bypassing [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:54464 -> 20.0.0.2:22 06/20/2024-17:27:44.567193 [**] [1:2:0] SSH traffic detected - bypassing [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:46282 -> 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 108k 0 --:--:-- --:--:-- --:--:-- 108k
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 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=0.788 ms --- 20.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.788/0.788/0.788/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.606 ms --- 40.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.606/0.606/0.606/0.000 ms
Step 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.5 This system includes free software. Contact Teldat for licenses information and source code. Last login: Thu Jun 20 17:27:44 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.5 This system includes free software. Contact Teldat for licenses information and source code. Last login: Thu Jun 20 17:27:44 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/20/2024-17:28:09.947531 [**] [1:2:0] SSH traffic detected - bypassing [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:40102 -> 20.0.0.2:22 06/20/2024-17:28:10.378301 [**] [1:2:0] SSH traffic detected - bypassing [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:43154 -> 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 43144 connected to 40.0.0.2 port 5001 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 74.0 MBytes 621 Mbits/sec 158 1.42 MBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-1.00 sec 74.0 MBytes 621 Mbits/sec 158 sender [ 5] 0.00-1.01 sec 71.8 MBytes 594 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/20/2024-17:28:09.947531 [**] [1:2:0] SSH traffic detected - bypassing [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:40102 -> 20.0.0.2:22 06/20/2024-17:28:10.378301 [**] [1:2:0] SSH traffic detected - bypassing [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:43154 -> 40.0.0.2:22 06/20/2024-17:28:11.041583 [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:43136 -> 40.0.0.2:5001 06/20/2024-17:28:11.043284 [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:43144 -> 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 162k 0 --:--:-- --:--:-- --:--:-- 162k
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 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.998 ms --- 20.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.998/0.998/0.998/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.616 ms --- 40.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.616/0.616/0.616/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.5 This system includes free software. Contact Teldat for licenses information and source code. Last login: Thu Jun 20 17:28:10 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.5 This system includes free software. Contact Teldat for licenses information and source code. Last login: Thu Jun 20 17:28:11 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 48644 connected to 40.0.0.2 port 5001 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 62.6 MBytes 525 Mbits/sec 36 1.32 MBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-1.00 sec 62.6 MBytes 525 Mbits/sec 36 sender [ 5] 0.00-1.01 sec 60.2 MBytes 501 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/20/2024-17:28:37.131146 [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:48640 -> 40.0.0.2:5001 06/20/2024-17:28:37.133391 [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:48644 -> 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 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.922 ms --- 20.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.922/0.922/0.922/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.812 ms --- 40.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: 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 50416 connected to 40.0.0.2 port 5001 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 93.2 MBytes 782 Mbits/sec 137 1.58 MBytes [ 5] 1.00-2.00 sec 87.5 MBytes 734 Mbits/sec 53 1.21 MBytes [ 5] 2.00-3.00 sec 88.8 MBytes 744 Mbits/sec 0 1.28 MBytes [ 5] 3.00-4.00 sec 85.0 MBytes 713 Mbits/sec 0 1.34 MBytes [ 5] 4.00-5.00 sec 78.8 MBytes 661 Mbits/sec 0 1.38 MBytes [ 5] 5.00-6.00 sec 85.0 MBytes 713 Mbits/sec 0 1.40 MBytes [ 5] 6.00-7.00 sec 86.2 MBytes 724 Mbits/sec 0 1.42 MBytes [ 5] 7.00-8.00 sec 77.5 MBytes 650 Mbits/sec 18 1.12 MBytes [ 5] 8.00-9.00 sec 80.0 MBytes 671 Mbits/sec 0 1.21 MBytes [ 5] 9.00-10.00 sec 85.0 MBytes 713 Mbits/sec 0 1.29 MBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 847 MBytes 710 Mbits/sec 208 sender [ 5] 0.00-10.01 sec 844 MBytes 708 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/20/2024-17:29:03.422342 [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:50400 -> 40.0.0.2:5001 06/20/2024-17:29:03.424141 [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:50416 -> 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 64500 0 --:--:-- --:--:-- --:--:-- 64500
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 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.03 ms --- 20.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 1.026/1.026/1.026/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.635 ms --- 40.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.635/0.635/0.635/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 5001Expect this output in
DUT2
:Connecting to host 40.0.0.2, port 5001 [ 5] local 20.0.0.2 port 39948 connected to 40.0.0.2 port 5001 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 135 MBytes 1.13 Gbits/sec 13 1.45 MBytes [ 5] 1.00-2.00 sec 164 MBytes 1.37 Gbits/sec 49 1.12 MBytes [ 5] 2.00-3.00 sec 138 MBytes 1.16 Gbits/sec 0 1.21 MBytes [ 5] 3.00-4.00 sec 152 MBytes 1.28 Gbits/sec 0 1.29 MBytes [ 5] 4.00-5.00 sec 148 MBytes 1.24 Gbits/sec 0 1.37 MBytes [ 5] 5.00-6.00 sec 170 MBytes 1.43 Gbits/sec 0 1.46 MBytes [ 5] 6.00-7.00 sec 118 MBytes 985 Mbits/sec 20 1.12 MBytes [ 5] 7.00-8.00 sec 138 MBytes 1.15 Gbits/sec 0 1.23 MBytes [ 5] 8.00-9.00 sec 140 MBytes 1.17 Gbits/sec 0 1.31 MBytes [ 5] 9.00-10.00 sec 190 MBytes 1.59 Gbits/sec 0 1.38 MBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 1.46 GBytes 1.25 Gbits/sec 82 sender [ 5] 0.00-10.00 sec 1.45 GBytes 1.25 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/20/2024-17:29:49.220881 [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:39942 -> 40.0.0.2:5001 06/20/2024-17:29:49.222909 [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:39948 -> 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 Thu 2024-06-20 17:29:37 UTC, end at Thu 2024-06-20 17:29:59 UTC. -- Jun 20 17:29:37.376340 osdx systemd-journald[1713]: Runtime journal (/run/log/journal/4bdaa9d5a32b43918ba3b0d5647305f4) is 2.0M, max 16.0M, 14.0M free. Jun 20 17:29:37.404451 osdx OSDxCLI[16016]: User 'admin' executed a new command: 'system journal clear'. Jun 20 17:29:38.031636 osdx osdx-coredump[16477]: Deleting all coredumps in /opt/vyatta/etc/config/coredump... Jun 20 17:29:38.042504 osdx OSDxCLI[16016]: User 'admin' executed a new command: 'system coredump delete all'. Jun 20 17:29:38.908592 osdx OSDxCLI[16016]: User 'admin' entered the configuration menu. Jun 20 17:29:39.042975 osdx OSDxCLI[16016]: User 'admin' added a new cfg line: 'set interfaces ethernet eth0 address 10.215.168.64/24'. Jun 20 17:29:39.140282 osdx OSDxCLI[16016]: User 'admin' added a new cfg line: 'set interfaces ethernet eth0 traffic nat source rule 1 address masquerade'. Jun 20 17:29:39.243735 osdx OSDxCLI[16016]: User 'admin' added a new cfg line: 'set interfaces ethernet eth1 vif 101 address 40.0.0.1/8'. Jun 20 17:29:39.340630 osdx OSDxCLI[16016]: User 'admin' added a new cfg line: 'set interfaces ethernet eth1 vif 201 address 20.0.0.1/8'. Jun 20 17:29:39.442472 osdx OSDxCLI[16016]: User 'admin' added a new cfg line: 'set protocols static route 0.0.0.0/0 next-hop 10.215.168.1'. Jun 20 17:29:39.595323 osdx OSDxCLI[16016]: User 'admin' added a new cfg line: 'set service dns static host-name WAN inet 10.215.168.1'. Jun 20 17:29:39.752127 osdx kernel: 8021q: adding VLAN 0 to HW filter on device eth0 Jun 20 17:29:39.796105 osdx kernel: 8021q: adding VLAN 0 to HW filter on device eth1 Jun 20 17:29:39.813462 osdx systemd-udevd[16550]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable. Jun 20 17:29:39.813527 osdx systemd-udevd[16550]: Using default interface naming scheme 'v240'. Jun 20 17:29:39.843299 osdx systemd-udevd[16556]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable. Jun 20 17:29:39.843358 osdx systemd-udevd[16556]: Using default interface naming scheme 'v240'. Jun 20 17:29:40.018630 osdx cfgd[1341]: [16016]Completed change to active configuration Jun 20 17:29:40.067594 osdx OSDxCLI[16016]: User 'admin' committed the configuration. Jun 20 17:29:40.111024 osdx OSDxCLI[16016]: User 'admin' left the configuration menu. Jun 20 17:29:42.604957 osdx OSDxCLI[16016]: User 'admin' executed a new command: 'ping 10.215.168.1 count 1 size 56 timeout 1'. Jun 20 17:29:42.726023 osdx OSDxCLI[16016]: User 'admin' executed a new command: 'ping 40.0.0.2 count 1 size 56 timeout 1'. Jun 20 17:29:42.878939 osdx OSDxCLI[16016]: User 'admin' executed a new command: 'ping 20.0.0.2 count 1 size 56 timeout 1'. Jun 20 17:29:43.393441 osdx zebra[1282]: [RZ3YY-GPH41][EC 100663310] snmp[warning]: Warning: Failed to connect to the agentx master agent ([NIL]): Jun 20 17:29:43.649669 osdx file_operation[16633]: using src url: http://10.215.168.1/~robot/test-performance.rules dst url: running:// Jun 20 17:29:43.676402 osdx OSDxCLI[16016]: User 'admin' executed a new command: 'file copy http://10.215.168.1/~robot/test-performance.rules running:// force'. Jun 20 17:29:43.899399 osdx OSDxCLI[16016]: User 'admin' entered the configuration menu. Jun 20 17:29:44.033247 osdx OSDxCLI[16016]: User 'admin' added a new cfg line: 'set service firewall FW ruleset file running://test-performance.rules'. Jun 20 17:29:44.159738 osdx OSDxCLI[16016]: User 'admin' added a new cfg line: 'set service firewall FW mode inline queue FW_Q'. Jun 20 17:29:44.231608 osdx zebra[1282]: [RZ3YY-GPH41][EC 100663310] snmp[warning]: Warning: Failed to connect to the agentx master agent ([NIL]): Jun 20 17:29:44.283172 osdx OSDxCLI[16016]: User 'admin' added a new cfg line: 'set service firewall FW logging outputs fast'. Jun 20 17:29:44.401763 osdx OSDxCLI[16016]: User 'admin' added a new cfg line: 'set service firewall FW logging level config'. Jun 20 17:29:44.522312 osdx OSDxCLI[16016]: User 'admin' added a new cfg line: 'set service firewall FW validator-timeout 20'. Jun 20 17:29:44.694214 osdx OSDxCLI[16016]: User 'admin' added a new cfg line: 'set interfaces ethernet eth0 traffic policy in FW_PWAN'. Jun 20 17:29:44.781087 osdx OSDxCLI[16016]: User 'admin' added a new cfg line: 'set interfaces ethernet eth0 traffic policy out FW_PWAN'. Jun 20 17:29:44.865092 osdx zebra[1282]: [RZ3YY-GPH41][EC 100663310] snmp[warning]: Warning: Failed to connect to the agentx master agent ([NIL]): Jun 20 17:29:44.933330 osdx OSDxCLI[16016]: User 'admin' added a new cfg line: 'set interfaces ethernet eth1 vif 101 traffic policy in FW_PLAN'. Jun 20 17:29:45.059200 osdx OSDxCLI[16016]: User 'admin' added a new cfg line: 'set interfaces ethernet eth1 vif 201 traffic policy in FW_PLAN'. Jun 20 17:29:45.209781 osdx OSDxCLI[16016]: User 'admin' added a new cfg line: 'set traffic queue FW_Q elements 1'. Jun 20 17:29:45.362740 osdx OSDxCLI[16016]: User 'admin' added a new cfg line: 'set traffic policy FW_PWAN'. Jun 20 17:29:45.509426 osdx OSDxCLI[16016]: User 'admin' added a new cfg line: 'set traffic policy FW_PLAN'. Jun 20 17:29:45.605793 osdx OSDxCLI[16016]: User 'admin' added a new cfg line: 'set traffic selector FW_SEL'. Jun 20 17:29:45.705693 osdx OSDxCLI[16016]: User 'admin' added a new cfg line: 'set service firewall FW stream bypass mark 129834765'. Jun 20 17:29:45.778302 osdx zebra[1282]: [RZ3YY-GPH41][EC 100663310] snmp[warning]: Warning: Failed to connect to the agentx master agent ([NIL]): Jun 20 17:29:45.799660 osdx OSDxCLI[16016]: User 'admin' added a new cfg line: 'set service firewall FW stream bypass mask 129834765'. Jun 20 17:29:45.892836 osdx OSDxCLI[16016]: User 'admin' added a new cfg line: 'set traffic label BYPASS'. Jun 20 17:29:46.029122 osdx OSDxCLI[16016]: User 'admin' added a new cfg line: 'set traffic policy FW-SKIP rule 1 log prefix SKIP'. Jun 20 17:29:46.152027 osdx OSDxCLI[16016]: User 'admin' added a new cfg line: 'set traffic policy FW-SKIP rule 1 selector MARKED-PACKETS'. Jun 20 17:29:46.328270 osdx OSDxCLI[16016]: User 'admin' added a new cfg line: 'set traffic policy FW-SKIP rule 1 set label BYPASS'. Jun 20 17:29:46.493226 osdx OSDxCLI[16016]: User 'admin' added a new cfg line: 'set traffic selector MARKED-PACKETS rule 1 mark 129834765'. Jun 20 17:29:46.635900 osdx OSDxCLI[16016]: User 'admin' added a new cfg line: 'set traffic selector FW_SEL rule 1 not label BYPASS'. Jun 20 17:29:46.737811 osdx OSDxCLI[16016]: User 'admin' added a new cfg line: 'set traffic policy FW_PLAN rule 1 selector FW_SEL'. Jun 20 17:29:46.869059 osdx OSDxCLI[16016]: User 'admin' added a new cfg line: 'set traffic policy FW_PWAN rule 1 selector FW_SEL'. Jun 20 17:29:47.037174 osdx OSDxCLI[16016]: User 'admin' added a new cfg line: 'set interfaces ethernet eth1 vif 101 traffic policy out FW-SKIP'. Jun 20 17:29:47.183811 osdx OSDxCLI[16016]: User 'admin' added a new cfg line: 'set interfaces ethernet eth1 vif 201 traffic policy out FW-SKIP'. Jun 20 17:29:47.273895 osdx OSDxCLI[16016]: User 'admin' added a new cfg line: 'set traffic policy FW_PLAN rule 1 action enqueue FW_Q'. Jun 20 17:29:47.369421 osdx OSDxCLI[16016]: User 'admin' added a new cfg line: 'set traffic policy FW_PWAN rule 1 action enqueue FW_Q'. Jun 20 17:29:48.161700 osdx systemd[1]: Reloading. Jun 20 17:29:48.302115 osdx systemd[1]: Starting Suricata client "FW" service... Jun 20 17:29:48.321891 osdx systemd[1]: Started Suricata client "FW" service. Jun 20 17:29:48.639911 osdx INFO[16762]: Rules successfully loaded Jun 20 17:29:48.644270 osdx cfgd[1341]: [16016]Completed change to active configuration Jun 20 17:29:48.648155 osdx OSDxCLI[16016]: User 'admin' committed the configuration. Jun 20 17:29:48.675401 osdx OSDxCLI[16016]: User 'admin' left the configuration menu. Jun 20 17:29:49.224116 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=42787 DF PROTO=TCP SPT=39942 DPT=5001 WINDOW=502 RES=0x00 ACK PSH URGP=0 MARK=0x7bd1f0d Jun 20 17:29:49.224217 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=1767 DF PROTO=TCP SPT=39948 DPT=5001 WINDOW=502 RES=0x00 ACK PSH URGP=0 MARK=0x7bd1f0d Jun 20 17:29:54.817983 osdx zebra[1282]: [WPPMZ-G9797] if_zebra_speed_update: eth1.201 old speed: 0 new speed: 4294967295 Jun 20 17:29:54.843284 osdx zebra[1282]: [WPPMZ-G9797] if_zebra_speed_update: eth1.101 old speed: 0 new speed: 4294967295 Jun 20 17:29:58.396202 osdx zebra[1282]: [RZ3YY-GPH41][EC 100663310] snmp[warning]: Warning: Failed to connect to the agentx master agent ([NIL]): Jun 20 17:29:59.232357 osdx zebra[1282]: [RZ3YY-GPH41][EC 100663310] snmp[warning]: Warning: Failed to connect to the agentx master agent ([NIL]): Jun 20 17:29:59.549980 osdx OSDxCLI[16016]: 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 64500 0 --:--:-- --:--:-- --:--:-- 64500
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 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.835 ms --- 20.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.835/0.835/0.835/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.710 ms --- 40.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.710/0.710/0.710/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 5001Expect this output in
DUT2
:Connecting to host 40.0.0.2, port 5001 [ 5] local 20.0.0.2 port 33296 connected to 40.0.0.2 port 5001 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 179 MBytes 1.50 Gbits/sec 225 1.39 MBytes [ 5] 1.00-2.00 sec 190 MBytes 1.59 Gbits/sec 0 1.48 MBytes [ 5] 2.00-3.00 sec 155 MBytes 1.30 Gbits/sec 53 1.10 MBytes [ 5] 3.00-4.00 sec 136 MBytes 1.14 Gbits/sec 0 1.18 MBytes [ 5] 4.00-5.00 sec 139 MBytes 1.16 Gbits/sec 0 1.27 MBytes [ 5] 5.00-6.00 sec 150 MBytes 1.26 Gbits/sec 0 1.35 MBytes [ 5] 6.00-7.00 sec 175 MBytes 1.47 Gbits/sec 10 1.01 MBytes [ 5] 7.00-8.00 sec 166 MBytes 1.39 Gbits/sec 0 1.13 MBytes [ 5] 8.00-9.00 sec 191 MBytes 1.60 Gbits/sec 0 1.23 MBytes [ 5] 9.00-10.00 sec 189 MBytes 1.58 Gbits/sec 0 1.34 MBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 1.63 GBytes 1.40 Gbits/sec 288 sender [ 5] 0.00-10.00 sec 1.63 GBytes 1.40 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/20/2024-17:30:26.080534 [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:33294 -> 40.0.0.2:5001 06/20/2024-17:30:26.083216 [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:33296 -> 40.0.0.2:5001
Step 7: Run command system conntrack show
at DUT0
and check if output matches the following regular expressions:
(?m)^tcp\s+.*src=20.0.0.2 dst=40.0.0.2.+dport=5001.*mark=129834765.*$Show output
udp 17 23 src=127.0.0.1 dst=127.0.0.1 sport=58384 dport=53 packets=1 bytes=55 [UNREPLIED] src=127.0.0.1 dst=127.0.0.1 sport=53 dport=58384 packets=0 bytes=0 mark=0 use=1 udp 17 21 src=127.0.0.1 dst=127.0.0.1 sport=38355 dport=53 packets=1 bytes=55 [UNREPLIED] src=127.0.0.1 dst=127.0.0.1 sport=53 dport=38355 packets=0 bytes=0 mark=0 use=1 tcp 6 19 TIME_WAIT src=20.0.0.2 dst=40.0.0.2 sport=33294 dport=5001 packets=18 bytes=1391 src=40.0.0.2 dst=20.0.0.2 sport=5001 dport=33294 packets=16 bytes=1150 [ASSURED] (Sc: not-bypass) mark=129834765 use=1 udp 17 20 src=127.0.0.1 dst=127.0.0.1 sport=34176 dport=53 packets=1 bytes=55 [UNREPLIED] src=127.0.0.1 dst=127.0.0.1 sport=53 dport=34176 packets=0 bytes=0 mark=0 use=1 udp 17 22 src=127.0.0.1 dst=127.0.0.1 sport=54131 dport=53 packets=1 bytes=55 [UNREPLIED] src=127.0.0.1 dst=127.0.0.1 sport=53 dport=54131 packets=0 bytes=0 mark=0 use=1 udp 17 21 src=127.0.0.1 dst=127.0.0.1 sport=55782 dport=53 packets=1 bytes=55 [UNREPLIED] src=127.0.0.1 dst=127.0.0.1 sport=53 dport=55782 packets=0 bytes=0 mark=0 use=1 tcp 6 9 CLOSE src=20.0.0.2 dst=40.0.0.2 sport=33296 dport=5001 packets=1208809 bytes=1813201721 src=40.0.0.2 dst=20.0.0.2 sport=5001 dport=33296 packets=25826 bytes=1339956 [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=32 packets=1 bytes=84 src=40.0.0.2 dst=20.0.0.2 type=0 code=0 id=32 packets=1 bytes=84 (Sc: not-bypass) mark=0 use=1 icmp 1 18 src=40.0.0.2 dst=20.0.0.2 type=8 code=0 id=100 packets=1 bytes=84 src=20.0.0.2 dst=40.0.0.2 type=0 code=0 id=100 packets=1 bytes=84 (Sc: not-bypass) mark=0 use=1 udp 17 23 src=127.0.0.1 dst=127.0.0.1 sport=48323 dport=53 packets=1 bytes=55 [UNREPLIED] src=127.0.0.1 dst=127.0.0.1 sport=53 dport=48323 packets=0 bytes=0 mark=0 use=1 udp 17 22 src=127.0.0.1 dst=127.0.0.1 sport=45680 dport=53 packets=1 bytes=55 [UNREPLIED] src=127.0.0.1 dst=127.0.0.1 sport=53 dport=45680 packets=0 bytes=0 mark=0 use=1 udp 17 20 src=127.0.0.1 dst=127.0.0.1 sport=59240 dport=53 packets=1 bytes=55 [UNREPLIED] src=127.0.0.1 dst=127.0.0.1 sport=53 dport=59240 packets=0 bytes=0 mark=0 use=1 conntrack v1.4.5 (conntrack-tools): 12 flow entries have been shown.
Test Selectors
Description
Builds a scenario with three DUTs in which some selectors are applied to traffic depending on the network detected. This allows specific selector-based rules to be applied to traffic and with only one firewall instance.
To demonstrate this behavior, two labels will be set:
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 --:--:-- --:--:-- --:--:-- 114k
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 171k 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 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.796 ms --- 20.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.796/0.796/0.796/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.623 ms --- 40.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.623/0.623/0.623/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.5 This system includes free software. Contact Teldat for licenses information and source code. Last login: Thu Jun 20 17:28:37 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.5 This system includes free software. Contact Teldat for licenses information and source code. Last login: Thu Jun 20 17:28:37 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/20/2024-17:31:09.388092 [**] [1:1:0] Local SSH traffic - bypassing... [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:44342 -> 20.0.0.2:22 06/20/2024-17:31:09.796712 [**] [1:1:0] Local SSH traffic - bypassing... [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:36030 -> 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/20/2024-17:31:09.388092 [**] [1:1:0] Local SSH traffic - bypassing... [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:44342 -> 20.0.0.2:22 06/20/2024-17:31:09.796712 [**] [1:1:0] Local SSH traffic - bypassing... [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:36030 -> 40.0.0.2:22 06/20/2024-17:31:10.284805 [Drop] [**] [1:5:0] Outgoing TCP traffic to port 22 from LAN to WAN [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:44988 -> 10.215.168.1:22 06/20/2024-17:31:12.411955 [Drop] [**] [1:5:0] Outgoing TCP traffic to port 22 from LAN to WAN [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:36272 -> 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 53568 connected to 40.0.0.2 port 5001 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 82.7 MBytes 694 Mbits/sec 18 1.52 MBytes [ 5] 1.00-2.00 sec 78.8 MBytes 661 Mbits/sec 0 1.67 MBytes [ 5] 2.00-3.00 sec 77.5 MBytes 650 Mbits/sec 38 1.25 MBytes [ 5] 3.00-4.00 sec 68.8 MBytes 577 Mbits/sec 0 1.32 MBytes [ 5] 4.00-5.00 sec 66.2 MBytes 556 Mbits/sec 0 1.37 MBytes [ 5] 5.00-6.00 sec 75.0 MBytes 629 Mbits/sec 0 1.40 MBytes [ 5] 6.00-7.00 sec 76.2 MBytes 640 Mbits/sec 0 1.42 MBytes [ 5] 7.00-8.00 sec 83.8 MBytes 703 Mbits/sec 0 1.42 MBytes [ 5] 8.00-9.01 sec 75.0 MBytes 625 Mbits/sec 30 1.06 MBytes [ 5] 9.01-10.00 sec 72.5 MBytes 610 Mbits/sec 0 1.17 MBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 756 MBytes 634 Mbits/sec 86 sender [ 5] 0.00-10.01 sec 754 MBytes 632 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
06/20/2024-17:31:14.831321 [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:53568 -> 40.0.0.2:5001 06/20/2024-17:31:25.269832 [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:47874 -> 40.0.0.2:5000 06/20/2024-17:31:25.473339 [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:47874 -> 40.0.0.2:5000 06/20/2024-17:31:25.677420 [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:47874 -> 40.0.0.2:5000 06/20/2024-17:31:26.101364 [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:47874 -> 40.0.0.2:5000 06/20/2024-17:31:26.933315 [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:47874 -> 40.0.0.2:5000 06/20/2024-17:31:28.283114 [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:47874 -> 40.0.0.2:5000 06/20/2024-17:31:28.326769 [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:47874 -> 40.0.0.2:5000 06/20/2024-17:31:28.327492 [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:47874 -> 40.0.0.2:5000 06/20/2024-17:31:28.343125 [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:47874 -> 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 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.797 ms --- 20.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.797/0.797/0.797/0.000 ms
Step 4: 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.800 ms --- 40.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.800/0.800/0.800/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 5000Expect 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/20/2024-17:32:00.475363 [Drop] [**] [1:1:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:58638 -> 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+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 ------------------------------------------------------------------------ 20.0.0.2 40.0.0.2 58638 5000 yes 201 0 9 731 40.0.0.2 20.0.0.2 5000 58638 yes 201 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.250177s ending at 1718904724.307051 XDP_DROP 10 pkts ( 4 pps) 0 KiB ( 0 Mbits/s) XDP_PASS 14 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 5001Expect 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/20/2024-17:32:00.475363 [Drop] [**] [1:1:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:58638 -> 40.0.0.2:5000 06/20/2024-17:32:04.524155 [Drop] [**] [1:2:0] Dropping UDP performance test traffic [**] [Classification: (null)] [Priority: 3] {UDP} 20.0.0.2:41163 -> 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+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 ------------------------------------------------------------------------ 20.0.0.2 40.0.0.2 58638 5000 yes 201 0 12 905 40.0.0.2 20.0.0.2 5000 58638 yes 201 0 0 0 40.0.0.2 20.0.0.2 5001 41163 no 201 0 0 0 20.0.0.2 40.0.0.2 41163 5001 no 201 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.250173s ending at 1718904728.432806 XDP_DROP 12 pkts ( 0 pps) 0 KiB ( 0 Mbits/s) XDP_PASS 36 pkts ( 0 pps) 2 KiB ( 0 Mbits/s)