There’s a really good guide on installing and setting up AG by Brent Ozar, but if you want to setup a multi subnet failover cluster, you will need a lot of ports opened up so that your AG will actually work.
| Port number | Between | Reason |
| 5022 TCP | Nodes | AlwaysOn port for primary and secondary replicas |
| 1433 TCP | Nodes | SQL Server communication |
| 3343 UDP | Nodes | Cluster node communication |
| 137 UDP | Nodes | DNS communication |
| 135 TCP/UDP | Nodes and Cluster IP | DNS communication |
| 49152 through 65535 TCP/UDP | Nodes | Dynamic ports communication |
| 445 | Nodes | SMB communication |
| 139 | Nodes | NetBIOS communication |
| 464 | Nodes and domain controllers | Active Directory communication |
| 1433 | Network and VPN for DBAs to nodes and listener IP |
