The NVOS default firewall rules protect the switch control plane and CPU from denial-of-service (DoS) and other potentially malicious network attacks.
The default set of firewall rules consists of IP-level and transport-level rules. For more information about custom access control list (ACL) rules, refer to Access Control List Configuration.
You cannot bind ACL rules to the loopback interface (lo).
Default ACLs
NVOS provides the default firewall rules in the following ACLs:
|
ACL |
Rules |
Bound to |
|---|---|---|
|
|
DoS rules |
Control plane, inbound |
|
|
Whitelist rules |
Control plane, inbound |
|
|
Outbound rules |
Control plane, outbound |
|
|
Loopback rules |
Loopback interface ( |
To show the ACLs that are bound to the control plane and their rule counters, run nv show system control-plane acl. To show the ACLs that are bound to the loopback interface, run nv show interface lo acl.
DoS Rules
DoS rules protect the switch control plane and CPU from DoS attacks. The acl-default-dos and acl-default-dos-ipv6 ACLs contain the DoS rules, which do the following:
-
Allow only internal traffic to the loopback interfaces.
-
Accept already established connections and outbound traffic.
-
Drop packets if the first TCP segment is not SYN.
-
Drop fragmented IP packets.
-
Drop Christmas tree packets (packets with all TCP flags set).
-
Drop NULL packets.
-
Drop invalid packets.
-
Drop packets with uncommon MSS values.
-
Provide brute-force protection.
-
Drop packets with a Type 0 routing header.
-
Drop packets with a hop limit greater than 1.
-
Limit excessive TCP reset packets.
-
Protect against SYN flood attacks.
-
Rate-limit new TCP connections for each IP address.
-
Log all remaining packets, then drop them.
Whitelist Rules
Whitelist rules specify the services or application ports that are enabled on the switch. The acl-default-whitelist and acl-default-whitelist-ipv6 ACLs contain the whitelist rules. Each of these ACLs ends with a rule that denies all other traffic (rule 270 in acl-default-whitelist and rule 260 in acl-default-whitelist-ipv6).
The following table lists the ports that NVOS enables by default.
|
Protocol |
Port |
Application |
|---|---|---|
|
TCP |
22 |
SSH |
|
TCP |
443 |
HTTPS |
|
TCP |
9339 |
gNMI |
|
TCP |
389 |
LDAP |
|
TCP |
636 |
LDAP TLS |
|
TCP |
49 |
TACACS |
|
TCP |
8251 |
Cable validation |
|
TCP |
23108 |
MST |
|
UDP |
161 |
SNMP |
|
UDP |
123 |
NTP |
|
UDP/TCP |
53 |
DNS |
|
UDP |
5353 |
mDNS |
|
UDP |
514 |
Remote syslog |
|
UDP |
68 |
DHCP client (IPv4) |
|
UDP |
67 |
DHCP server (IPv4) |
|
UDP |
546 |
DHCPv6 client |
|
UDP |
547 |
DHCPv6 server |
|
UDP |
4500 |
IPSec-NAT |
|
UDP |
500 |
IKE |
|
UDP |
1812, 1813, 1645, 1646 |
RADIUS |
|
ICMP |
N/A |
Ping (IPv4) |
Unset the Default Firewall Rules
NVOS binds the default ACLs at first boot from the initial configuration. If you unset a default ACL binding, NVOS does not restore it. To bind the ACL again, run nv set system control-plane acl <acl-id> inbound or nv set system control-plane acl <acl-id> outbound.
Add Firewall Rules
You cannot modify the rules in the default ACLs (acl-default-dos, acl-default-dos-ipv6, acl-default-whitelist, acl-default-whitelist-ipv6, acl-default-outbound, acl-default-outbound-ipv6, acl-default-loopback and acl-default-loopback-ipv6). However, you can append or insert rules.
If you use non-default ports for an application, NVIDIA recommends that you add a whitelist rule for each non-default port. Give the new rules numbers that are lower than the number of the final deny rule, so that NVOS checks them first. For example, if you use ports 3020 and 3022 for RADIUS server accounting and authentication instead of 1812 and 1813, you can add the following rules:
nvos@switch:~$ nv set acl acl-default-whitelist rule 240 match ip udp source-port 3020
nvos@switch:~$ nv set acl acl-default-whitelist rule 240 match ip connection-state new
nvos@switch:~$ nv set acl acl-default-whitelist rule 240 match ip connection-state established
nvos@switch:~$ nv set acl acl-default-whitelist rule 240 action permit
nvos@switch:~$ nv set acl acl-default-whitelist rule 250 match ip udp source-port 3022
nvos@switch:~$ nv set acl acl-default-whitelist rule 250 match ip connection-state new
nvos@switch:~$ nv set acl acl-default-whitelist rule 250 match ip connection-state established
nvos@switch:~$ nv set acl acl-default-whitelist rule 250 action permit
nvos@switch:~$ nv config apply
Show Firewall Rules
To show the rules of a default ACL, run nv show acl <acl-id>, where <acl-id> is one of acl-default-dos, acl-default-dos-ipv6, acl-default-whitelist, acl-default-whitelist-ipv6, acl-default-outbound, acl-default-outbound-ipv6, acl-default-loopback and acl-default-loopback-ipv6. For example:
nvos@switch:~$ nv show acl acl-default-whitelist
operational applied
---- ----------- -------
type ipv4 ipv4
rule
=======
Number Summary
------ ----------------------------------
10 action: permit
match.ip.protocol: udp
match.ip.udp.dest-port: 161
remark: Whitelist-snmp
20 action: permit
match.ip.protocol: tcp
match.ip.tcp.dest-port: 443
remark: Whitelist-https
30 action: permit
match.ip.protocol: tcp
match.ip.tcp.dest-port: 22
remark: Whitelist-ssh
40 action: permit
match.ip.protocol: tcp
match.ip.tcp.dest-port: 9339
remark: Whitelist-gnmi
50 action: permit
match.ip.protocol: tcp
match.ip.tcp.dest-port: 636
remark: Whitelist-ldap-tls
60 action: permit
match.ip.protocol: tcp
match.ip.tcp.dest-port: 8251
remark: Whitelist-cable-validation
70 action: permit
match.ip.protocol: udp
match.ip.udp.dest-port: 514
remark: Whitelist-rsyslog
80 action: permit
match.ip.protocol: tcp
match.ip.tcp.dest-port: 389
remark: Whitelist-ldap
90 action: permit
match.ip.protocol: tcp
match.ip.tcp.dest-port: 49
remark: Whitelist-tacacs
100 action: permit
match.ip.protocol: udp
match.ip.udp.dest-port: 123
remark: Whitelist-ntp
110 action: permit
match.ip.protocol: udp
match.ip.udp.dest-port: 53
remark: Whitelist-dns
120 action: permit
match.ip.protocol: tcp
match.ip.tcp.dest-port: 53
remark: Whitelist-dns
130 action: permit
match.ip.protocol: udp
match.ip.udp.dest-port: 5353
remark: Whitelist-mDNS
140 action: permit
match.ip.protocol: udp
match.ip.udp.dest-port: 68
remark: Whitelist-dhcp
150 action: permit
match.ip.protocol: udp
match.ip.udp.dest-port: 67
remark: Whitelist-dhcp
160 action: permit
match.ip.protocol: udp
match.ip.udp.dest-port: 4500
remark: Whitelist-IPSec-NAT
170 action: permit
match.ip.protocol: udp
match.ip.udp.dest-port: 500
remark: Whitelist-IKE
180 action: permit
match.ip.protocol: udp
match.ip.udp.dest-port: 1812
remark: Whitelist-radius
190 action: permit
match.ip.protocol: udp
match.ip.udp.dest-port: 1813
remark: Whitelist-radius
200 action: permit
match.ip.protocol: udp
match.ip.udp.dest-port: 1645
remark: Whitelist-radius
210 action: permit
match.ip.protocol: udp
match.ip.udp.dest-port: 1646
remark: Whitelist-radius
220 action: permit
match.ip.protocol: icmp
remark: Whitelist-icmp
230 action: permit
match.ip.protocol: tcp
match.ip.tcp.dest-port: 23108
remark: Whitelist-mst
270 action: deny
To show additional information, such as the connection state, hit count, and update interval, add --rev=applied -o json. For example, nv show acl acl-default-dos --rev=applied -o json.
To show information about a specific rule, run nv show acl <acl-id> rule <rule-id>. For example:
nvos@switch:~$ nv show acl acl-default-dos rule 500
operational applied
--------------------- ----------- -------
match
ip
protocol udp udp
udp
[dest-port] 1646 1646
recent-list
name UDP UDP
update-interval 60 60
hit-count 100 100
action update update
action deny deny
To also show information such as the connection state, add --rev=applied -o json:
nvos@switch:~$ nv show acl acl-default-dos rule 500 --rev=applied -o json
{
"action": {
"deny": {}
},
"match": {
"ip": {
"connection-state": {
"new": {}
},
"protocol": "udp",
"recent-list": {
"action": "update",
"hit-count": 100,
"name": "UDP",
"update-interval": 60
},
"udp": {
"dest-port": {
"1646": {}
}
}
}
}
}
Log Messages
The default firewall rules include a log rule for packets that arrive at the control plane and do not match any user-defined or default firewall rule. The switch generates a log message in /var/log/firewall_packet_capture.log for packets that match the log rule.
Last updated: