Acl Ip

This scenario shows how to install custom ACLs from received RADIUS messages (using NAS-Filter-Rule attributes and according to RFC3588).

../../../../../../../_images/acl.svg

Test 802.1x NAS-Filter-Rule ACLs

Description

DUT0 is configured with an 802.1x authenticated interface and DUT1 is configured as a supplicant. Some ACLs are configured in the authentication server to filter incoming/outgoing traffic.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address 10.215.168.64/24
set interfaces ethernet eth1 802.1x authenticator aaa authentication list1
set interfaces ethernet eth1 802.1x authenticator reauth-period 0
set interfaces ethernet eth1 address 192.168.100.1/24
set service ssh
set system aaa group radius radgroup1 server serv1
set system aaa list list1 method 1 group radius radgroup1
set system aaa server radius serv1 address 10.215.168.1
set system aaa server radius serv1 encrypted-key U2FsdGVkX1+9eJLvSblNoZHsRKKJTGCn2Sk4W61mV4ypwGKB23hYQxERKolW1vMfQQTuL04WyTbOVelYP5/r1g==
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Ping IP address 10.215.168.1 from DUT0:

admin@DUT0$ ping 10.215.168.1 count 1 size 56 timeout 1
Show output
PING 10.215.168.1 (10.215.168.1) 56(84) bytes of data.
64 bytes from 10.215.168.1: icmp_seq=1 ttl=64 time=0.244 ms

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

Step 3: Set the following configuration in DUT1 :

set interfaces ethernet eth1 802.1x supplicant encrypted-password U2FsdGVkX1/OUeuRcxt92haUkpFrdeapy/FCy1pzxww=
set interfaces ethernet eth1 802.1x supplicant username user_acl_ip
set interfaces ethernet eth1 address 192.168.100.2/24
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 4: Run command interfaces ethernet eth1 802.1x supplicant show status at DUT1 and check if output contains the following tokens:

Authorized
Show output
---------------------------------------------------
        Field                      Value
---------------------------------------------------
EAP State                                   SUCCESS
EAP TLS Cipher          ECDHE-RSA-AES256-GCM-SHA384
EAP TLS Version                             TLSv1.2
PAE State                             AUTHENTICATED
Supplicant Port Status                   Authorized
WPA State                                 COMPLETED

Step 5: Run command interfaces ethernet eth1 802.1x supplicant show stats at DUT1 and check if output matches the following regular expressions:

Port Status\s+Authorized
Show output
-------------------------------
       Field           Value
-------------------------------
EAPoL Frames (Rx)            11
EAPoL Frames (Tx)            11
Invalid Frames (Rx)           0
Logoff Frames (Tx)            0
Port Status          Authorized
Req Frames (Rx)               9
Req ID Frames (Rx)            1
Resp Frames (Tx)             10
Start Frames (Tx)             1

Step 6: Run command interfaces ethernet eth1 802.1x authenticator show stats at DUT0 and check if output matches the following regular expressions:

Authentication Successes\s+1
Show output
-------------------------------------
         Field               Value
-------------------------------------
Access Challenges                   9
Authentication Backend         RADIUS
Authentication Failures             0
Authentication Successes            1
EAPoL frames (Rx)                  11
EAPoL frames (Tx)                  11
Reauthenticate                  FALSE
Reauthenticate Period               0
Session Time                        0
Session User Name         user_acl_ip

Step 7: Ping IP address 192.168.100.1 from DUT1:

admin@DUT1$ ping 192.168.100.1 count 1 size 56 timeout 1
Show output
PING 192.168.100.1 (192.168.100.1) 56(84) bytes of data.
64 bytes from 192.168.100.1: icmp_seq=1 ttl=64 time=0.385 ms

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

Note

IP Filter Rule ACLs:

  • Allow incoming/outgoing ICMP traffic to/from 192.168.100.0/24.

  • Allow management SSH traffic (tcp 22).

  • Allow incoming UDP flows from 192.168.100.2:1234 towards 192.168.100.1:1234.

  • Drop remaining traffic.

Step 8: Run command interfaces ethernet eth1 802.1x authenticator show acl rules at DUT0 and expect this output:

Show output
Received ACL type: Filter-Rule.

Rules for incoming traffic:
 1: permit in 1 from any to 192.168.100.0/24
 2: permit in 6 from any to 192.168.100.1 22
 3: permit in 17 from 192.168.100.2 1234 to 192.168.100.1 1234
 4: deny in ip from any to any

Rules for outgoing traffic:
 1: permit out 1 from 192.168.100.1 to any
 2: permit out 6 from 192.168.100.1 22 to any
 3: permit out 17 from 192.168.100.1 1234 to 192.168.100.2 1234
 4: deny out ip from any to any

Step 9: Ping IP address 192.168.100.1 from DUT1:

admin@DUT1$ ping 192.168.100.1 count 1 size 56 timeout 1
Show output
PING 192.168.100.1 (192.168.100.1) 56(84) bytes of data.
64 bytes from 192.168.100.1: icmp_seq=1 ttl=64 time=0.272 ms

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

Step 10: Init an SSH connection from DUT1 to IP address 192.168.100.1 with the user admin:

admin@DUT1$ ssh admin@192.168.100.1 option StrictHostKeyChecking=no option UserKnownHostsFile=/dev/null
Show output
Warning: Permanently added '192.168.100.1' (ECDSA) to the list of known hosts.
admin@192.168.100.1's password:
Welcome to Teldat OSDx v4.2.5.0

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

Last login: Tue May 13 18:38:00 2025
admin@osdx$

Step 11: Initiate a udp connection from DUT1 to DUT0 and try to send some messages between both endpoints

admin@DUT0$ monitor test connection server 1234 udp
admin@DUT1$ monitor test connection client 192.168.100.1 1234 udp source-port 1234

Step 12: Expect a failure in the following command: Initiate a udp connection from DUT0 to DUT1 and try to send some messages between both endpoints

admin@DUT1$ monitor test connection server 4321 udp
admin@DUT0$ monitor test connection client 192.168.100.2 4321 udp

Step 13: Run command interfaces ethernet eth1 802.1x authenticator show acl stats at DUT0 and expect this output:

Show output
ACL for ifc eth1 -- hook in

-----------------------------------------------------
rule   pkts match  pkts eval  bytes match  bytes eval
-----------------------------------------------------
1               2         30          168        5388
2              23         28         4980        5220
3               5          5          240         240
4               0          0            0           0
-----------------------------------------------------
Total          30         30         5388        5388

ACL for ifc eth1 -- hook out

-----------------------------------------------------
rule   pkts match  pkts eval  bytes match  bytes eval
-----------------------------------------------------
1               2         28          168        5252
2              20         26         4796        5084
3               5          6          240         288
4               1          1           48          48
-----------------------------------------------------
Total          28         28         5252        5252

Test 802.1x NAS-Filter-Rule ACLs And CoA

Description

In this scenario, DUT1 is authenticated successfully and some ACLs are configured. A CoA message is later received from the authentication server that changes the configured ACLs to drop non-ICMP traffic.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address 10.215.168.64/24
set interfaces ethernet eth1 802.1x authenticator aaa authentication list1
set interfaces ethernet eth1 802.1x authenticator coa client 10.215.168.1
set interfaces ethernet eth1 802.1x authenticator coa encrypted-secret U2FsdGVkX18WuAo78N15e9M259sMjPZLqEIRq7ZAF+I=
set interfaces ethernet eth1 802.1x authenticator reauth-period 0
set interfaces ethernet eth1 address 192.168.100.1/24
set service ssh
set system aaa group radius radgroup1 server serv1
set system aaa list list1 method 1 group radius radgroup1
set system aaa server radius serv1 address 10.215.168.1
set system aaa server radius serv1 encrypted-key U2FsdGVkX1+CEsBLQkcJKFrw3rVsV7zPe7xM/JMmQjUyKZZ0LLaewswsh11Yrl+UBGPaCjUfnrO8tSox5WWnNg==
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Ping IP address 10.215.168.1 from DUT0:

admin@DUT0$ ping 10.215.168.1 count 1 size 56 timeout 1
Show output
PING 10.215.168.1 (10.215.168.1) 56(84) bytes of data.
64 bytes from 10.215.168.1: icmp_seq=1 ttl=64 time=0.209 ms

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

Step 3: Set the following configuration in DUT1 :

set interfaces ethernet eth1 802.1x supplicant encrypted-password U2FsdGVkX1/JRnLLUSugsX/noDsMeAh/t7PDLP/qp2w=
set interfaces ethernet eth1 802.1x supplicant username user_acl_ip
set interfaces ethernet eth1 address 192.168.100.2/24
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 4: Run command interfaces ethernet eth1 802.1x supplicant show status at DUT1 and check if output contains the following tokens:

Authorized
Show output
---------------------------------------------------
        Field                      Value
---------------------------------------------------
EAP State                                   SUCCESS
EAP TLS Cipher          ECDHE-RSA-AES256-GCM-SHA384
EAP TLS Version                             TLSv1.2
PAE State                             AUTHENTICATED
Supplicant Port Status                   Authorized
WPA State                                 COMPLETED

Step 5: Run command interfaces ethernet eth1 802.1x supplicant show stats at DUT1 and check if output matches the following regular expressions:

Port Status\s+Authorized
Show output
-------------------------------
       Field           Value
-------------------------------
EAPoL Frames (Rx)            11
EAPoL Frames (Tx)            11
Invalid Frames (Rx)           0
Logoff Frames (Tx)            0
Port Status          Authorized
Req Frames (Rx)               9
Req ID Frames (Rx)            1
Resp Frames (Tx)             10
Start Frames (Tx)             1

Step 6: Run command interfaces ethernet eth1 802.1x authenticator show stats at DUT0 and check if output matches the following regular expressions:

Authentication Successes\s+1
Show output
-------------------------------------
         Field               Value
-------------------------------------
Access Challenges                   9
Authentication Backend         RADIUS
Authentication Failures             0
Authentication Successes            1
EAPoL frames (Rx)                  11
EAPoL frames (Tx)                  11
Reauthenticate                  FALSE
Reauthenticate Period               0
Session Time                        0
Session User Name         user_acl_ip

Step 7: Ping IP address 192.168.100.1 from DUT1:

admin@DUT1$ ping 192.168.100.1 count 1 size 56 timeout 1
Show output
PING 192.168.100.1 (192.168.100.1) 56(84) bytes of data.
64 bytes from 192.168.100.1: icmp_seq=1 ttl=64 time=0.369 ms

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

Note

Send a CoA/Disconnect request from the RADIUS server On Linux, the FreeRADIUS package includes the utility radtest that can be used to send these messages:

Show output
$ cat /osdx-tests/utils/dot1x/acl_ip.req
User-Name = "user_acl_ip"
NAS-Filter-Rule = "permit in 1 from any to any"
NAS-Filter-Rule += "deny in ip from any to any"
$ radclient -s -t 1 -r 1 10.215.168.64:3799 coa coa_secret -f /osdx-tests/utils/dot1x/acl_ip.req
Sent CoA-Request Id 249 from 0.0.0.0:35837 to 10.215.168.64:3799 length 89
Received CoA-ACK Id 249 from 10.215.168.64:3799 to 10.215.168.1:35837 length 44
Packet summary:
      Accepted      : 1
      Rejected      : 0
      Lost          : 0
      Passed filter : 1
      Failed filter : 0

Note

IP Filter Rule ACLs:

  • Allow incoming ICMP traffic.

  • Drop remaining incoming traffic.

NOTE: outgoing traffic is allowed.

Step 8: Run command interfaces ethernet eth1 802.1x authenticator show acl rules at DUT0 and expect this output:

Show output
Received ACL type: Filter-Rule.

Rules for incoming traffic:
 1: permit in 1 from any to any
 2: deny in ip from any to any

Step 9: Ping IP address 192.168.100.1 from DUT1:

admin@DUT1$ ping 192.168.100.1 count 1 size 56 timeout 1
Show output
PING 192.168.100.1 (192.168.100.1) 56(84) bytes of data.
64 bytes from 192.168.100.1: icmp_seq=1 ttl=64 time=0.234 ms

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

Step 10: Init an SSH connection from DUT1 to IP address 192.168.100.1 with the user admin:

admin@DUT1$ ssh admin@192.168.100.1 option StrictHostKeyChecking=no option UserKnownHostsFile=/dev/null

Step 11: Expect a failure in the following command: Initiate a udp connection from DUT1 to DUT0 and try to send some messages between both endpoints

admin@DUT0$ monitor test connection server 1234 udp
admin@DUT1$ monitor test connection client 192.168.100.1 1234 udp source-port 1234

Step 12: Expect a failure in the following command: Initiate a udp connection from DUT0 to DUT1 and try to send some messages between both endpoints

admin@DUT1$ monitor test connection server 4321 udp
admin@DUT0$ monitor test connection client 192.168.100.2 4321 udp

Step 13: Run command interfaces ethernet eth1 802.1x authenticator show acl stats at DUT0 and expect this output:

Show output
ACL for ifc eth1 -- hook in

-----------------------------------------------------
rule   pkts match  pkts eval  bytes match  bytes eval
-----------------------------------------------------
1               1          8           84         480
2               7          7          396         396
-----------------------------------------------------
Total           8          8          480         480