Server con più schede di rete

Capita a volte di dover installare server fisici o virtuali che a causa dei servi che devono erogare necessitano di più connessioni di rete verso reti diverse e quindi la cosa più lineare in questi casi è quella di avere interfacce di rete separate.

Un classico esempio può essere un server di video sorveglianza che deve comunicare con la rete delle telecamere e con la rete interna.

In questi scenari dal momento che le schede di rete hanno tutte la stessa velocità conviene impostare sulla scheda di rete che dovrà essere usata per prima per gestire il traffico di routing una metrica manuale più bassa delle altre schede come indicato nella KB299540 An explanation of the Automatic Metric feature for Internet Protocol routes:

“The Automatic Metric feature is configured independently for each network interface in the network. This feature is useful in situations where you have more than one network interface of the same speed, for example, when each network interface has been assigned a default gateway. In this situation, you may want to manually configure the metric on one network interface, and enable the Automatic Metric feature to configure the metric of the other network interface. This setup can enable you to control the network interface that is used first in the routing of IP traffic.”

Per vedere quale è la metrica assegnata ad ogni scheda di rete è possibile utilizzare il segunete comando PowerShell:

 Get-NetIPInterface | Format-Table

Inoltre sulle schede di rete su cui non è specificatamente necessario è consigliabile disabilitare il traffico NetBIOS tramite il Tab WINS delle proprietà del protocollo TCP/IPv4:

Come indicato in Windows Internet Name Service (WINS) Overview se non è necessario implementare WINS o se non vi sono applicazioni che fanno uso di NetBIOS sulla connessione di rete attestata sulla scheda di rete è possibile disabilitarlo.

Altra configurazione necessaria quando si hanno più schede di rete è quella di impostare correttamente l’ordine delle schede e di Binding come riportato in Modify the protocol bindings and network provider order impostando per prima la scheda di rete più utilizzata e il protocollo più utilizzato.

image

“Network performance can be seriously degraded if you rearrange the bindings or provider order in an inappropriate way for your network. Set the connections and the protocols that you use to reach your resources listed first, with less frequently used connections and protocols listed second. For example, if you are on a LAN using primarily IPv4, then it is recommended that the LAN adapter be the first connection listed, and that IPv4 be the first protocol listed for that connection.”

“This can provide improved performance when you have multiple protocols installed and your network primarily uses one. If you set a protocol at the top of the list, it will be tried first. If another protocol is tried first for every packet, many will fail, and the other protocols will not be tried until that failure occurs.”

A riguardo si veda anche la KB 2526067 How to change the network connection priority in Windows 7 e il post Adjusting the Network Protocol Bindings in Windows 10 in cui sono contenute alcune indicazioni circa il fatto che in Windows 10 la modifica dell’ordine di binding diventa meno importante:

“There are no longer any components that utilize the binding order. The only known component that used the binding order was DNS ordering. By default, Windows uses the Route Metric + Interface Metric to determine which route has the highest priority by choosing the route with the lowest value.”

Per vedere l’elenco delle interfacce di rete e il loro ordine di priorità è possibile utilizzare il comando (minore è il valore della metrica e maggiore è la priorità della scheda di rete):

netstat –rn

image

Per modificare se necessario la metrica dell’interfaccia è possibile utilizzare il seguente comando PowerShell Set-NetIPInterface:

Set-NetIPInterface –InterfaceIndex “xx”–InterfaceMetric “yyy”

Nel caso in cui si abbiamo poi più schede di rete connesse alla stessa rete allo stesso switch è possibile avere dei comportamenti inaspettati come indicato nella KB175767 How multiple adapters on the same network are expected to behave, va però precisato questo tipo do configurazione non è consigliabile:

Consider the following scenario:

  • You have a working computer that has Windows installed. 
  • Two network adapters are connected to the same physical network or hub.
  • TCP/IP is installed as the network protocol.
  • The adapter addresses on the same subnet are 192.168.0.1 and 192.168.0.2.
  • A client on the network uses the address 192.168.0.119.

In this scenario, you may expect the two adapters on the same physical network and protocol subnet to perform load balancing. However, by definition, only one adapter may communicate on the network at a time in the Ethernet network topology. Therefore, both adapters cannot be transmitting at the same time and must wait if another device on the network is transmitting. Additionally, broadcast messages must be handled by each adapter because both are listening on the same network. This configuration requires significant overhead, excluding any protocol-related issues. This configuration does not offer a good method for providing a redundant network adapter for the same network.

Windows Server 2012 includes a new feature call SMB Multichannel. SMB Multichannel is part of the SMB 3.0 protocol and lets servers use multiple network connections at the same time.

Windows Server 2012 servers cannot use multiple network connections at the same time if the network is configured by using CSMA/CD.

Another thing to consider is that some network applications bind to specific adapters in the system. If a network application were to bind to the second adapter specifically, application-related traffic that was received from clients on the first adapter might be ignored by the application. This might be caused by NetBIOS name registration on the network. Additionally, if the adapter to which the application is bound fails, the application may fail if it does not use the other adapter.

Usually, unless applications specifically demand it, this kind of configuration is not helpful. Some manufacturers make fault-tolerant network adapters to guard against a single point of failure. These adapters enable two adapters to be included on the same server but enable only one adapter to be used at a time. If the primary adapter fails, the driver deactivates the first card and enables the second by using the same address configuration. The result is a fairly seamless transition to the alternative adapter. This is the preferred method to guard against a single network adapter as a single point of failure.

Per ulteriori informazioni si veda anche il mio post Doppio gateway e impostazione di una scheda di rete come primaria.