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=1.07 ms --- 20.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 1.065/1.065/1.065/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.926 ms --- 40.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: 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/10/2024-07:48:40.973901 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:37152 -> 40.0.0.2:22 10/10/2024-07:48:41.179922 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:37152 -> 40.0.0.2:22 10/10/2024-07:48:41.181762 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:37152 -> 40.0.0.2:22 10/10/2024-07:48:41.601858 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:37152 -> 40.0.0.2:22 10/10/2024-07:48:41.607794 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:37152 -> 40.0.0.2:22 10/10/2024-07:48:41.768578 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:37152 -> 40.0.0.2:22 10/10/2024-07:48:41.985466 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:56614 -> 20.0.0.2:22 10/10/2024-07:48:41.992091 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:56614 -> 20.0.0.2:22 10/10/2024-07:48:42.433713 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:37152 -> 40.0.0.2:22 10/10/2024-07:48:42.439721 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:37152 -> 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.823 ms --- 20.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.823/0.823/0.823/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.708 ms --- 40.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.708/0.708/0.708/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/10/2024-07:49:03.095072 [Drop] [**] [1:30:0] ICMP traffic dropped [**] [Classification: (null)] [Priority: 3] {ICMP} 40.0.0.2:8 -> 20.0.0.2:0 10/10/2024-07:49:04.169039 [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.716 ms --- 20.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.716/0.716/0.716/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.604 ms --- 40.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.604/0.604/0.604/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.7 This system includes free software. Contact Teldat for licenses information and source code. Last login: Thu Oct 10 06:35:43 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.7 This system includes free software. Contact Teldat for licenses information and source code. Last login: Thu Oct 10 06:30:48 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/10/2024-07:49:22.039462 [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:55592 -> 40.0.0.2:22 10/10/2024-07:49:22.039463 [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:55592 -> 40.0.0.2:22 10/10/2024-07:49:22.039528 [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:55592 -> 40.0.0.2:22 10/10/2024-07:49:22.039531 [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:55592 -> 40.0.0.2:22 10/10/2024-07:49:22.039532 [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:55592 -> 40.0.0.2:22 10/10/2024-07:49:22.039776 [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:55592 -> 40.0.0.2:22 10/10/2024-07:49:22.039799 [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:55592 -> 40.0.0.2:22 10/10/2024-07:49:22.040884 [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:55592 -> 40.0.0.2:22 10/10/2024-07:49:22.040886 [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:55592 -> 40.0.0.2:22 10/10/2024-07:49:22.039529 [wDrop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:55592 -> 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 132k 0 --:--:-- --:--:-- --:--:-- 132k
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=1.18 ms --- 20.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 1.175/1.175/1.175/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=1.05 ms --- 40.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 1.051/1.051/1.051/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/10/2024-07:49:42.582016 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:49392 -> 40.0.0.2:22 10/10/2024-07:49:42.784210 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:49392 -> 40.0.0.2:22 10/10/2024-07:49:42.785897 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:49392 -> 40.0.0.2:22 10/10/2024-07:49:43.197863 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:49392 -> 40.0.0.2:22 10/10/2024-07:49:43.203964 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:49392 -> 40.0.0.2:22 10/10/2024-07:49:43.381686 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:49392 -> 40.0.0.2:22 10/10/2024-07:49:43.549617 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:58376 -> 20.0.0.2:22 10/10/2024-07:49:43.556492 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:58376 -> 20.0.0.2:22 10/10/2024-07:49:44.030178 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:49392 -> 40.0.0.2:22 10/10/2024-07:49:44.035941 [Drop] [**] [1:2:0] SSH not allowed in this network [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:49392 -> 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 27200 0 --:--:-- --:--:-- --:--:-- 27200
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 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.25 ms --- 20.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 1.253/1.253/1.253/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.15 ms --- 40.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 1.153/1.153/1.153/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.7 This system includes free software. Contact Teldat for licenses information and source code. Last login: Thu Oct 10 07:49:21 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.7 This system includes free software. Contact Teldat for licenses information and source code. Last login: Thu Oct 10 07:49:21 2024 from 20.0.0.2 admin@osdx$
Step 8: Run command service firewall FW show logging fast | tail
at DUT0
and check if output matches the following regular expressions:
(?m)^.+(SSH traffic detected - bypassing).+$Show output
10/10/2024-07:50:03.178347 [**] [1:2:0] SSH traffic detected - bypassing [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:55364 -> 20.0.0.2:22 10/10/2024-07:50:03.466727 [**] [1:2:0] SSH traffic detected - bypassing [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:39128 -> 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 59500 0 --:--:-- --:--:-- --:--:-- 79333
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.844 ms --- 20.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.844/0.844/0.844/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.428 ms --- 40.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.428/0.428/0.428/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.7 This system includes free software. Contact Teldat for licenses information and source code. Last login: Thu Oct 10 07:50:03 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.7 This system includes free software. Contact Teldat for licenses information and source code. Last login: Thu Oct 10 07:50:03 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/10/2024-07:50:21.941725 [**] [1:2:0] SSH traffic detected - bypassing [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:43378 -> 20.0.0.2:22 10/10/2024-07:50:22.230106 [**] [1:2:0] SSH traffic detected - bypassing [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:57988 -> 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 56950 connected to 40.0.0.2 port 5001 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 89.4 MBytes 749 Mbits/sec 23 1.65 MBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-1.00 sec 89.4 MBytes 749 Mbits/sec 23 sender [ 5] 0.00-1.01 sec 88.4 MBytes 733 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/10/2024-07:50:21.941725 [**] [1:2:0] SSH traffic detected - bypassing [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:43378 -> 20.0.0.2:22 10/10/2024-07:50:22.230106 [**] [1:2:0] SSH traffic detected - bypassing [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:57988 -> 40.0.0.2:22 10/10/2024-07:50:22.664877 [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:56948 -> 40.0.0.2:5001 10/10/2024-07:50:22.666080 [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:56950 -> 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 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.828 ms --- 20.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.828/0.828/0.828/0.000 ms
Step 4: 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.11 ms --- 40.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 1.110/1.110/1.110/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.7 This system includes free software. Contact Teldat for licenses information and source code. Last login: Thu Oct 10 07:50:21 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.7 This system includes free software. Contact Teldat for licenses information and source code. Last login: Thu Oct 10 07:50:22 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 55500 connected to 40.0.0.2 port 5001 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 83.6 MBytes 701 Mbits/sec 100 1.88 MBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-1.00 sec 83.6 MBytes 701 Mbits/sec 100 sender [ 5] 0.00-1.01 sec 81.6 MBytes 676 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/10/2024-07:50:42.785706 [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:55496 -> 40.0.0.2:5001 10/10/2024-07:50:42.787007 [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:55500 -> 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 32250 0 --:--:-- --:--:-- --:--:-- 32250
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=1.09 ms --- 20.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 1.088/1.088/1.088/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.904 ms --- 40.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.904/0.904/0.904/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 36124 connected to 40.0.0.2 port 5001 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 85.5 MBytes 717 Mbits/sec 125 2.12 MBytes [ 5] 1.00-2.00 sec 104 MBytes 870 Mbits/sec 539 1.59 MBytes [ 5] 2.00-3.00 sec 112 MBytes 944 Mbits/sec 0 1.68 MBytes [ 5] 3.00-4.00 sec 80.0 MBytes 671 Mbits/sec 38 1.59 MBytes [ 5] 4.00-5.00 sec 73.8 MBytes 619 Mbits/sec 1 1.96 MBytes [ 5] 5.00-6.00 sec 115 MBytes 965 Mbits/sec 57 1.73 MBytes [ 5] 6.00-7.00 sec 101 MBytes 849 Mbits/sec 0 1.87 MBytes [ 5] 7.00-8.00 sec 53.8 MBytes 451 Mbits/sec 0 1.98 MBytes [ 5] 8.00-9.00 sec 90.0 MBytes 755 Mbits/sec 0 2.07 MBytes [ 5] 9.00-10.00 sec 112 MBytes 944 Mbits/sec 113 1.33 MBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 928 MBytes 778 Mbits/sec 873 sender [ 5] 0.00-10.01 sec 925 MBytes 776 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
10/10/2024-07:51:03.380019 [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:36118 -> 40.0.0.2:5001 10/10/2024-07:51:03.381773 [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:36124 -> 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 2263 0 --:--:-- --:--:-- --:--:-- 2303
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=0.713 ms --- 20.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.713/0.713/0.713/0.000 ms
Step 4: Ping IP address 40.0.0.2
from DUT2
:
admin@DUT2$ ping 40.0.0.2 count 1 size 56 timeout 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.578 ms --- 40.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.578/0.578/0.578/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 36966 connected to 40.0.0.2 port 5001 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 133 MBytes 1.12 Gbits/sec 41 1.68 MBytes [ 5] 1.00-2.00 sec 275 MBytes 2.31 Gbits/sec 0 1.84 MBytes [ 5] 2.00-3.00 sec 272 MBytes 2.29 Gbits/sec 0 1.98 MBytes [ 5] 3.00-4.00 sec 294 MBytes 2.46 Gbits/sec 0 2.09 MBytes [ 5] 4.00-5.00 sec 282 MBytes 2.37 Gbits/sec 0 2.17 MBytes [ 5] 5.00-6.00 sec 279 MBytes 2.34 Gbits/sec 0 2.23 MBytes [ 5] 6.00-7.00 sec 280 MBytes 2.35 Gbits/sec 0 2.27 MBytes [ 5] 7.00-8.00 sec 288 MBytes 2.41 Gbits/sec 0 2.31 MBytes [ 5] 8.00-9.00 sec 276 MBytes 2.32 Gbits/sec 0 2.39 MBytes [ 5] 9.00-10.00 sec 261 MBytes 2.19 Gbits/sec 0 2.47 MBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 2.58 GBytes 2.21 Gbits/sec 41 sender [ 5] 0.00-10.01 sec 2.58 GBytes 2.21 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
10/10/2024-07:51:37.981122 [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:36952 -> 40.0.0.2:5001 10/10/2024-07:51:37.982429 [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:36966 -> 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-10-10 07:51:30 UTC, end at Thu 2024-10-10 07:51:48 UTC. -- Oct 10 07:51:30.000356 osdx systemd-timedated[3773]: Changed local time to Thu Oct 10 07:51:30 2024 Oct 10 07:51:30.001591 osdx OSDxCLI[3346]: User 'admin' executed a new command: 'set date 2024-10-10 07:51:30'. Oct 10 07:51:30.255617 osdx systemd-journald[1707]: Runtime journal (/run/log/journal/0478719b9ca24dfc881db6c3460ca916) is 4.0M, max 16.0M, 11.9M free. Oct 10 07:51:30.287470 osdx OSDxCLI[3346]: User 'admin' executed a new command: 'system journal clear'. Oct 10 07:51:30.659957 osdx osdx-coredump[3806]: Deleting all coredumps in /opt/vyatta/etc/config/coredump... Oct 10 07:51:30.666310 osdx OSDxCLI[3346]: User 'admin' executed a new command: 'system coredump delete all'. Oct 10 07:51:31.227923 osdx OSDxCLI[3346]: User 'admin' entered the configuration menu. Oct 10 07:51:31.302096 osdx OSDxCLI[3346]: User 'admin' added a new cfg line: 'set interfaces ethernet eth0 address 10.215.168.64/24'. Oct 10 07:51:31.384110 osdx OSDxCLI[3346]: User 'admin' added a new cfg line: 'set interfaces ethernet eth0 traffic nat source rule 1 address masquerade'. Oct 10 07:51:31.448321 osdx OSDxCLI[3346]: User 'admin' added a new cfg line: 'set interfaces ethernet eth1 vif 101 address 40.0.0.1/8'. Oct 10 07:51:31.541228 osdx OSDxCLI[3346]: User 'admin' added a new cfg line: 'set interfaces ethernet eth1 vif 201 address 20.0.0.1/8'. Oct 10 07:51:31.604424 osdx OSDxCLI[3346]: User 'admin' added a new cfg line: 'set protocols static route 0.0.0.0/0 next-hop 10.215.168.1'. Oct 10 07:51:31.698780 osdx OSDxCLI[3346]: User 'admin' added a new cfg line: 'set service dns static host-name WAN inet 10.215.168.1'. Oct 10 07:51:31.790049 osdx kernel: 8021q: adding VLAN 0 to HW filter on device eth0 Oct 10 07:51:31.814048 osdx kernel: 8021q: adding VLAN 0 to HW filter on device eth1 Oct 10 07:51:31.822266 osdx systemd-udevd[3727]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable. Oct 10 07:51:31.822297 osdx systemd-udevd[3727]: Using default interface naming scheme 'v240'. Oct 10 07:51:31.840227 osdx systemd-udevd[3727]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable. Oct 10 07:51:31.956481 osdx cfgd[1323]: [3346]Completed change to active configuration Oct 10 07:51:31.983011 osdx OSDxCLI[3346]: User 'admin' committed the configuration. Oct 10 07:51:31.999031 osdx OSDxCLI[3346]: User 'admin' left the configuration menu. Oct 10 07:51:33.629827 osdx OSDxCLI[3346]: User 'admin' executed a new command: 'ping 10.215.168.1 count 1 size 56 timeout 1'. Oct 10 07:51:33.703650 osdx OSDxCLI[3346]: User 'admin' executed a new command: 'ping 40.0.0.2 count 1 size 56 timeout 1'. Oct 10 07:51:33.815603 osdx OSDxCLI[3346]: User 'admin' executed a new command: 'ping 20.0.0.2 count 1 size 56 timeout 1'. Oct 10 07:51:34.357186 osdx file_operation[3960]: using src url: http://10.215.168.1/~robot/test-performance.rules dst url: running:// Oct 10 07:51:34.439861 osdx OSDxCLI[3346]: User 'admin' executed a new command: 'file copy http://10.215.168.1/~robot/test-performance.rules running:// force'. Oct 10 07:51:34.579261 osdx OSDxCLI[3346]: User 'admin' entered the configuration menu. Oct 10 07:51:34.640651 osdx OSDxCLI[3346]: User 'admin' added a new cfg line: 'set service firewall FW ruleset file running://test-performance.rules'. Oct 10 07:51:34.746685 osdx OSDxCLI[3346]: User 'admin' added a new cfg line: 'set service firewall FW mode inline queue FW_Q'. Oct 10 07:51:34.814517 osdx OSDxCLI[3346]: User 'admin' added a new cfg line: 'set service firewall FW logging outputs fast'. Oct 10 07:51:34.917028 osdx OSDxCLI[3346]: User 'admin' added a new cfg line: 'set service firewall FW logging level config'. Oct 10 07:51:34.991734 osdx OSDxCLI[3346]: User 'admin' added a new cfg line: 'set service firewall FW validator-timeout 20'. Oct 10 07:51:35.116310 osdx OSDxCLI[3346]: User 'admin' added a new cfg line: 'set interfaces ethernet eth0 traffic policy in FW_PWAN'. Oct 10 07:51:35.176371 osdx OSDxCLI[3346]: User 'admin' added a new cfg line: 'set interfaces ethernet eth0 traffic policy out FW_PWAN'. Oct 10 07:51:35.280260 osdx OSDxCLI[3346]: User 'admin' added a new cfg line: 'set interfaces ethernet eth1 vif 101 traffic policy in FW_PLAN'. Oct 10 07:51:35.347545 osdx OSDxCLI[3346]: User 'admin' added a new cfg line: 'set interfaces ethernet eth1 vif 201 traffic policy in FW_PLAN'. Oct 10 07:51:35.446498 osdx OSDxCLI[3346]: User 'admin' added a new cfg line: 'set traffic queue FW_Q elements 1'. Oct 10 07:51:35.514176 osdx OSDxCLI[3346]: User 'admin' added a new cfg line: 'set traffic policy FW_PWAN'. Oct 10 07:51:35.640607 osdx OSDxCLI[3346]: User 'admin' added a new cfg line: 'set traffic policy FW_PLAN'. Oct 10 07:51:35.704846 osdx OSDxCLI[3346]: User 'admin' added a new cfg line: 'set traffic selector FW_SEL'. Oct 10 07:51:35.806918 osdx OSDxCLI[3346]: User 'admin' added a new cfg line: 'set service firewall FW stream bypass mark 129834765'. Oct 10 07:51:35.894118 osdx OSDxCLI[3346]: User 'admin' added a new cfg line: 'set service firewall FW stream bypass mask 129834765'. Oct 10 07:51:35.947053 osdx OSDxCLI[3346]: User 'admin' added a new cfg line: 'set traffic label BYPASS'. Oct 10 07:51:36.040348 osdx OSDxCLI[3346]: User 'admin' added a new cfg line: 'set traffic policy FW-SKIP rule 1 log prefix SKIP'. Oct 10 07:51:36.090081 osdx OSDxCLI[3346]: User 'admin' added a new cfg line: 'set traffic policy FW-SKIP rule 1 selector MARKED-PACKETS'. Oct 10 07:51:36.183349 osdx OSDxCLI[3346]: User 'admin' added a new cfg line: 'set traffic policy FW-SKIP rule 1 set label BYPASS'. Oct 10 07:51:36.235508 osdx OSDxCLI[3346]: User 'admin' added a new cfg line: 'set traffic selector MARKED-PACKETS rule 1 mark 129834765'. Oct 10 07:51:36.342739 osdx OSDxCLI[3346]: User 'admin' added a new cfg line: 'set traffic selector FW_SEL rule 1 not label BYPASS'. Oct 10 07:51:36.395625 osdx OSDxCLI[3346]: User 'admin' added a new cfg line: 'set traffic policy FW_PLAN rule 1 selector FW_SEL'. Oct 10 07:51:36.478469 osdx OSDxCLI[3346]: User 'admin' added a new cfg line: 'set traffic policy FW_PWAN rule 1 selector FW_SEL'. Oct 10 07:51:36.541732 osdx OSDxCLI[3346]: User 'admin' added a new cfg line: 'set interfaces ethernet eth1 vif 101 traffic policy out FW-SKIP'. Oct 10 07:51:36.623830 osdx OSDxCLI[3346]: User 'admin' added a new cfg line: 'set interfaces ethernet eth1 vif 201 traffic policy out FW-SKIP'. Oct 10 07:51:36.675361 osdx OSDxCLI[3346]: User 'admin' added a new cfg line: 'set traffic policy FW_PLAN rule 1 action enqueue FW_Q'. Oct 10 07:51:36.773863 osdx OSDxCLI[3346]: User 'admin' added a new cfg line: 'set traffic policy FW_PWAN rule 1 action enqueue FW_Q'. Oct 10 07:51:37.266797 osdx systemd[1]: Reloading. Oct 10 07:51:37.379933 osdx systemd[1]: Starting Suricata client "FW" service... Oct 10 07:51:37.392184 osdx systemd[1]: Started Suricata client "FW" service. Oct 10 07:51:37.565009 osdx INFO[4083]: Rules successfully loaded Oct 10 07:51:37.568239 osdx cfgd[1323]: [3346]Completed change to active configuration Oct 10 07:51:37.571026 osdx OSDxCLI[3346]: User 'admin' committed the configuration. Oct 10 07:51:37.593086 osdx OSDxCLI[3346]: User 'admin' left the configuration menu. Oct 10 07:51:37.982120 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=46470 DF PROTO=TCP SPT=36952 DPT=5001 WINDOW=502 RES=0x00 ACK PSH URGP=0 MARK=0x7bd1f0d Oct 10 07:51:37.986721 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=8795 DF PROTO=TCP SPT=36966 DPT=5001 WINDOW=502 RES=0x00 ACK PSH URGP=0 MARK=0x7bd1f0d Oct 10 07:51:46.825129 osdx zebra[1280]: [WPPMZ-G9797] if_zebra_speed_update: eth1.201 old speed: 0 new speed: 4294967295 Oct 10 07:51:46.840533 osdx zebra[1280]: [WPPMZ-G9797] if_zebra_speed_update: eth1.101 old speed: 0 new speed: 4294967295 Oct 10 07:51:48.171239 osdx OSDxCLI[3346]: 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.952 ms --- 20.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.952/0.952/0.952/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=1.12 ms --- 40.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 1.119/1.119/1.119/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 58486 connected to 40.0.0.2 port 5001 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 83.7 MBytes 702 Mbits/sec 154 1.54 MBytes [ 5] 1.00-2.00 sec 282 MBytes 2.37 Gbits/sec 0 1.70 MBytes [ 5] 2.00-3.00 sec 285 MBytes 2.38 Gbits/sec 0 1.83 MBytes [ 5] 3.00-4.00 sec 298 MBytes 2.50 Gbits/sec 0 1.93 MBytes [ 5] 4.00-5.00 sec 296 MBytes 2.48 Gbits/sec 0 2.01 MBytes [ 5] 5.00-6.00 sec 300 MBytes 2.52 Gbits/sec 0 2.06 MBytes [ 5] 6.00-7.00 sec 306 MBytes 2.57 Gbits/sec 0 2.15 MBytes [ 5] 7.00-8.00 sec 291 MBytes 2.44 Gbits/sec 0 2.25 MBytes [ 5] 8.00-9.00 sec 285 MBytes 2.39 Gbits/sec 0 2.33 MBytes [ 5] 9.00-10.00 sec 285 MBytes 2.39 Gbits/sec 0 2.42 MBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 2.65 GBytes 2.28 Gbits/sec 154 sender [ 5] 0.00-10.01 sec 2.65 GBytes 2.27 Gbits/sec receiver iperf Done.
Step 6: Run command service firewall FW show logging fast | tail
at DUT0
and check if output matches the following regular expressions:
(?m)^.+(Skipping test network performance traffic).+$Show output
10/10/2024-07:52:07.843971 [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:58474 -> 40.0.0.2:5001 10/10/2024-07:52:07.845292 [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:58486 -> 40.0.0.2:5001
Step 7: Run command system conntrack show
at DUT0
and check if output matches the following regular expressions:
(?m)^tcp\s+.*src=20.0.0.2 dst=40.0.0.2.+dport=5001.*mark=129834765.*$Show output
icmp 1 19 src=20.0.0.2 dst=40.0.0.2 type=8 code=0 id=42 packets=1 bytes=84 src=40.0.0.2 dst=20.0.0.2 type=0 code=0 id=42 packets=1 bytes=84 (Sc: not-bypass) mark=0 use=1 tcp 6 19 TIME_WAIT src=20.0.0.2 dst=40.0.0.2 sport=58474 dport=5001 packets=18 bytes=1392 src=40.0.0.2 dst=20.0.0.2 sport=5001 dport=58474 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=154 packets=1 bytes=84 src=20.0.0.2 dst=40.0.0.2 type=0 code=0 id=154 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=58486 dport=5001 packets=1964368 bytes=2946324525 src=40.0.0.2 dst=20.0.0.2 sport=5001 dport=58486 packets=86100 bytes=4479992 [ASSURED] (Sc: not-bypass) mark=129834765 use=1 conntrack v1.4.5 (conntrack-tools): 4 flow entries have been shown.
Test Selectors
Description
Builds a scenario with three DUTs in which some selectors are applied to traffic depending on the network detected. This allows specific selector-based rules to be applied to traffic and with only one firewall instance.
To demonstrate this behavior, two labels will be set:
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 171k 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 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=1.26 ms --- 20.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 1.264/1.264/1.264/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.10 ms --- 40.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 1.099/1.099/1.099/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.7 This system includes free software. Contact Teldat for licenses information and source code. Last login: Thu Oct 10 07:50:41 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.7 This system includes free software. Contact Teldat for licenses information and source code. Last login: Thu Oct 10 07:50:42 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/10/2024-07:52:40.890271 [**] [1:1:0] Local SSH traffic - bypassing... [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:45006 -> 20.0.0.2:22 10/10/2024-07:52:41.173645 [**] [1:1:0] Local SSH traffic - bypassing... [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:35916 -> 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/10/2024-07:52:40.890271 [**] [1:1:0] Local SSH traffic - bypassing... [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:45006 -> 20.0.0.2:22 10/10/2024-07:52:41.173645 [**] [1:1:0] Local SSH traffic - bypassing... [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:35916 -> 40.0.0.2:22 10/10/2024-07:52:41.572112 [Drop] [**] [1:5:0] Outgoing TCP traffic to port 22 from LAN to WAN [**] [Classification: (null)] [Priority: 3] {TCP} 40.0.0.2:39194 -> 10.215.168.1:22 10/10/2024-07:52:43.647719 [Drop] [**] [1:5:0] Outgoing TCP traffic to port 22 from LAN to WAN [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:52632 -> 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 52976 connected to 40.0.0.2 port 5001 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 82.0 MBytes 688 Mbits/sec 285 1.75 MBytes [ 5] 1.00-2.00 sec 109 MBytes 912 Mbits/sec 0 1.51 MBytes [ 5] 2.00-3.00 sec 105 MBytes 881 Mbits/sec 0 1.59 MBytes [ 5] 3.00-4.00 sec 110 MBytes 922 Mbits/sec 0 1.64 MBytes [ 5] 4.00-5.00 sec 108 MBytes 902 Mbits/sec 0 1.68 MBytes [ 5] 5.00-6.00 sec 106 MBytes 891 Mbits/sec 47 1.20 MBytes [ 5] 6.00-7.00 sec 111 MBytes 933 Mbits/sec 0 1.29 MBytes [ 5] 7.00-8.00 sec 110 MBytes 923 Mbits/sec 0 1.35 MBytes [ 5] 8.00-9.00 sec 114 MBytes 954 Mbits/sec 0 1.39 MBytes [ 5] 9.00-10.00 sec 110 MBytes 923 Mbits/sec 0 1.44 MBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 1.04 GBytes 893 Mbits/sec 332 sender [ 5] 0.00-10.01 sec 1.04 GBytes 891 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/10/2024-07:52:45.885645 [**] [1:40:0] Skipping test network performance traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:52976 -> 40.0.0.2:5001 10/10/2024-07:52:56.152900 [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:55814 -> 40.0.0.2:5000 10/10/2024-07:52:56.355928 [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:55814 -> 40.0.0.2:5000 10/10/2024-07:52:56.559787 [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:55814 -> 40.0.0.2:5000 10/10/2024-07:52:56.992082 [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:55814 -> 40.0.0.2:5000 10/10/2024-07:52:57.823731 [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:55814 -> 40.0.0.2:5000 10/10/2024-07:52:59.175541 [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:55814 -> 40.0.0.2:5000 10/10/2024-07:52:59.199093 [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:55814 -> 40.0.0.2:5000 10/10/2024-07:52:59.199420 [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:55814 -> 40.0.0.2:5000 10/10/2024-07:52:59.213401 [Drop] [**] [1:4:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:55814 -> 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 5882 0 --:--:-- --:--:-- --:--:-- 5882
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.615 ms --- 20.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.615/0.615/0.615/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.779 ms --- 40.0.0.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.779/0.779/0.779/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
10/10/2024-07:53:17.823602 [Drop] [**] [1:1:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:33222 -> 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 ------------------------------------------------------------------------ 40.0.0.2 20.0.0.2 5000 33222 yes 201 0 0 0 20.0.0.2 40.0.0.2 33222 5000 yes 201 0 8 673
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.250222s ending at 1728546801.419012 XDP_DROP 9 pkts ( 0 pps) 0 KiB ( 0 Mbits/s) XDP_PASS 5951776 pkts ( 0 pps) 8104987 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
10/10/2024-07:53:17.823602 [Drop] [**] [1:1:0] Dropping TCP performance test traffic [**] [Classification: (null)] [Priority: 3] {TCP} 20.0.0.2:33222 -> 40.0.0.2:5000 10/10/2024-07:53:21.550395 [Drop] [**] [1:2:0] Dropping UDP performance test traffic [**] [Classification: (null)] [Priority: 3] {UDP} 20.0.0.2:49917 -> 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 ------------------------------------------------------------------------ 40.0.0.2 20.0.0.2 5000 33222 yes 201 0 0 0 20.0.0.2 40.0.0.2 49917 5001 no 201 0 0 0 20.0.0.2 40.0.0.2 33222 5000 yes 201 0 12 905 40.0.0.2 20.0.0.2 5001 49917 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.250158s ending at 1728546805.170139 XDP_DROP 12 pkts ( 0 pps) 0 KiB ( 0 Mbits/s) XDP_PASS 5951820 pkts ( 0 pps) 8104990 KiB ( 0 Mbits/s)