Acl Id
This scenario shows how to install traffic policies from received RADIUS messages (using Filter-Id attribute and according to RFC2865).
Test 802.1x Filter-ID ACL
Description
DUT0 is configured with an 802.1x authenticated interface and DUT1 is configured as a supplicant. A traffic policy is automatically configured in DUT0 after supplicant is authenticated.
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 aaa authorization acl-alias RADIUS_ACL direction both set interfaces ethernet eth1 802.1x authenticator aaa authorization acl-alias RADIUS_ACL priority very-high set interfaces ethernet eth1 802.1x authenticator aaa authorization acl-alias RADIUS_ACL traffic-policy POL1 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+iXz7nJpHxIzDiH4brtDhLQqeKeB73t9OmpQ20UzkgfBma1XlugKTj/STy7waifVIc2rTbXFUVew== set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0' set traffic policy POL1 rule 1 selector SEL_ICMP set traffic policy POL1 rule 2 selector SEL_SSH set traffic policy POL1 rule 3 action drop set traffic selector SEL_ICMP rule 1 protocol icmp set traffic selector SEL_SSH rule 1 destination port 22 set traffic selector SEL_SSH rule 1 protocol tcp set traffic selector SEL_SSH rule 2 protocol tcp set traffic selector SEL_SSH rule 2 source port 22
Step 2: Ping IP address 10.215.168.1
from DUT0
:
admin@DUT0$ ping 10.215.168.1 count 1 size 56 timeout 1Show 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.174 ms --- 10.215.168.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.174/0.174/0.174/0.000 ms
Step 3: Set the following configuration in DUT1
:
set interfaces ethernet eth1 802.1x supplicant encrypted-password U2FsdGVkX1+p4SsE5nHA8aJZLLN3KzsyYsnfdCa/PXA= set interfaces ethernet eth1 802.1x supplicant username user_acl_id 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+AuthorizedShow 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+1Show 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_id
Step 7: Ping IP address 192.168.100.1
from DUT1
:
admin@DUT1$ ping 192.168.100.1 count 1 size 56 timeout 1Show 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.382 ms --- 192.168.100.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.382/0.382/0.382/0.000 ms
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-ID. ACL with alias 'RADIUS_ACL' is installed using 'traffic policy POL1'.
Step 9: Ping IP address 192.168.100.1
from DUT1
:
admin@DUT1$ ping 192.168.100.1 count 1 size 56 timeout 1Show 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.321 ms --- 192.168.100.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.321/0.321/0.321/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/nullShow 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.1.1 This system includes free software. Contact Teldat for licenses information and source code. Last login: Wed Oct 30 10:54:36 2024 admin@osdx$
Step 11: 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 12: Run command interfaces ethernet eth1 802.1x authenticator show acl stats
at DUT0
and expect this output:
Show output
Policy POL1 -- ifc eth1 -- hook in prio very-high --------------------------------------------------------------- rule selector pkts match pkts eval bytes match bytes eval --------------------------------------------------------------- 1 SEL_ICMP 2 27 168 5228 2 SEL_SSH 25 25 5060 5060 3 - 0 0 0 0 --------------------------------------------------------------- Total 27 27 5228 5228 Policy POL1 -- ifc eth1 -- hook out prio very-high --------------------------------------------------------------- rule selector pkts match pkts eval bytes match bytes eval --------------------------------------------------------------- 1 SEL_ICMP 2 23 168 5016 2 SEL_SSH 20 21 4800 4848 3 - 1 1 48 48 --------------------------------------------------------------- Total 23 23 5016 5016
Test 802.1x Filter-ID ACL And CoA
Description
In this scenario, DUT1 is successfully authenticated and a traffic policy is configured from a Filter-ID attribute. Then, a CoA message is received from the authentication server that changes the configured traffic policy 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 aaa authorization acl-alias RADIUS_ACL direction both set interfaces ethernet eth1 802.1x authenticator aaa authorization acl-alias RADIUS_ACL priority very-high set interfaces ethernet eth1 802.1x authenticator aaa authorization acl-alias RADIUS_ACL traffic-policy POL1 set interfaces ethernet eth1 802.1x authenticator aaa authorization acl-alias RADIUS_ACL_COA direction in set interfaces ethernet eth1 802.1x authenticator aaa authorization acl-alias RADIUS_ACL_COA traffic-policy POL2 set interfaces ethernet eth1 802.1x authenticator coa client 10.215.168.1 set interfaces ethernet eth1 802.1x authenticator coa encrypted-secret U2FsdGVkX193qsGwl9byzssFWtEl3gY3HjucueRa40Q= 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 U2FsdGVkX18BsDFQbCbk9mFJz4V7uxO2ZTXq/V6f4N+WsWzi/r3ynTarnQ/1ygMJif/C/KPWhkcvC+yrgOI1Gw== set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0' set traffic policy POL1 rule 1 selector SEL_ICMP set traffic policy POL1 rule 2 selector SEL_SSH set traffic policy POL1 rule 3 action drop set traffic policy POL2 rule 1 selector SEL_ICMP set traffic policy POL2 rule 2 action drop set traffic selector SEL_ICMP rule 1 protocol icmp set traffic selector SEL_SSH rule 1 destination port 22 set traffic selector SEL_SSH rule 1 protocol tcp set traffic selector SEL_SSH rule 2 protocol tcp set traffic selector SEL_SSH rule 2 source port 22
Step 2: Ping IP address 10.215.168.1
from DUT0
:
admin@DUT0$ ping 10.215.168.1 count 1 size 56 timeout 1Show 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.172 ms --- 10.215.168.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.172/0.172/0.172/0.000 ms
Step 3: Set the following configuration in DUT1
:
set interfaces ethernet eth1 802.1x supplicant encrypted-password U2FsdGVkX1/Mai2vbSY5LnTrlitWSkru2znxlE1ys70= set interfaces ethernet eth1 802.1x supplicant username user_acl_id 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+AuthorizedShow 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+1Show 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_id
Step 7: Ping IP address 192.168.100.1
from DUT1
:
admin@DUT1$ ping 192.168.100.1 count 1 size 56 timeout 1Show 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.315 ms --- 192.168.100.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.315/0.315/0.315/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_id.req User-Name = "user_acl_id" Filter-ID = "RADIUS_ACL_COA" $ radclient -s -t 1 -r 1 10.215.168.64:3799 coa coa_secret -f /osdx-tests/utils/dot1x/acl_id.req Sent CoA-Request Id 30 from 0.0.0.0:47747 to 10.215.168.64:3799 length 49 Received CoA-ACK Id 30 from 10.215.168.64:3799 to 10.215.168.1:47747 length 44 Packet summary: Accepted : 1 Rejected : 0 Lost : 0 Passed filter : 1 Failed filter : 0
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-ID. ACL with alias 'RADIUS_ACL_COA' is installed using 'traffic policy POL2'.
Step 9: Ping IP address 192.168.100.1
from DUT1
:
admin@DUT1$ ping 192.168.100.1 count 1 size 56 timeout 1Show 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.219 ms --- 192.168.100.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.219/0.219/0.219/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: Run command interfaces ethernet eth1 802.1x authenticator show acl stats
at DUT0
and expect this output:
Show output
Policy POL2 -- ifc eth1 -- hook in prio very-high --------------------------------------------------------------- rule selector pkts match pkts eval bytes match bytes eval --------------------------------------------------------------- 1 SEL_ICMP 1 7 84 440 2 - 6 6 356 356 --------------------------------------------------------------- Total 7 7 440 440