Networking: Difference between revisions

Axka (talk | contribs)
Add link aggregation
Axka (talk | contribs)
Update link aggregation section
Line 241: Line 241:
! Bonding mode !! Description !! Switch configuration
! Bonding mode !! Description !! Switch configuration
|-
|-
| <code>balance-rr</code> || Transmit packets round-robin. || Requires static EtherChannel enabled, not LACP-negotiated.
| <code>balance-rr</code> || '''Default'''. Transmit packets round-robin. || Requires static EtherChannel enabled, not LACP-negotiated.
|-
|-
| <code>active-backup</code> || Only one slave in the bond in active. If it fails, another one is picked to be active. || No configuration required on the switch.
| <code>active-backup</code> || Recommended for fault tolerance when 802.3ad isn't available. Only one slave in the bond in active. If it fails, another one is picked to be active. || No configuration required on the switch.
|-
|-
| <code>balance-xor</code> || Transmit packets based on the selected transmit hash policy. || Requires static EtherChannel enabled, not LACP-negotiated.
| <code>balance-xor</code> || Transmit packets based on the selected transmit hash policy. || Requires static EtherChannel enabled, not LACP-negotiated.
Line 249: Line 249:
| <code>broadcast</code> || Transmit everything on all slave interfaces. || Requires static EtherChannel enabled, not LACP-negotiated.
| <code>broadcast</code> || Transmit everything on all slave interfaces. || Requires static EtherChannel enabled, not LACP-negotiated.
|-
|-
| <code>802.3ad</code> || IEEE 802.3ad Dynamic link aggregation. Transmits packets based on the selected transmit hash policy. || Requires LACP-negotiated EtherChannel enabled. In simpler terms, dynamic LACP.
| <code>802.3ad</code> || '''Recommended'''. IEEE 802.3ad Dynamic link aggregation. Transmits packets based on the selected transmit hash policy. || Requires LACP-negotiated EtherChannel enabled. In simpler terms, dynamic LACP.
|-
|-
| <code>balance-tlb</code> || Adaptive transmit load balancing || No configuration required on the switch.
| <code>balance-tlb</code> || Adaptive transmit load balancing || No configuration required on the switch.
Line 260: Line 260:
=== NetworkManager ===
=== NetworkManager ===


{{Warning|This has not been fully tested.}}
{{Warning|This has not been fully tested. I'm not sure if all the properties are required.}}


{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
Line 266: Line 266:
     "Bond connection 1" = {
     "Bond connection 1" = {
       bond = {
       bond = {
        downdelay = "0";
         miimon = "100"; # Monitor MII link every 100ms
         miimon = "1";
         mode = "802.3ad";
         mode = "802.3ad"; # dynamic LACP
         xmit_hash_policy = "layer3+4"; # IP and TCP/UDP hash
         updelay = "0";
       };
       };
       connection = {
       connection = {
Line 290: Line 289:
         id = "bond0 port 1";
         id = "bond0 port 1";
         type = "ethernet";
         type = "ethernet";
         interface-name = "eth1"; # Replace this
         interface-name = "enp2s0";
         controller = "bond0";
         controller = "bond0";
         port-type = "bond";
         port-type = "bond";
Line 299: Line 298:
         id = "bond0 port 2";
         id = "bond0 port 2";
         type = "ethernet";
         type = "ethernet";
         interface-name = "eth2"; # Replace this
         interface-name = "enp3s0";
         controller = "bond0";
         controller = "bond0";
         port-type = "bond";
         port-type = "bond";
Line 307: Line 306:
</nowiki>}}
</nowiki>}}


=== systemd-networkd ===
=== systemd-networkd and scripted networking ===


=== legacy scripted networking? ===
See [[Systemd/networkd#Bonding]] for more detailed configuration possibilities.
 
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
  networking.bonds = {
    bond0 = {
      interfaces = [ "enp2s0" "enp3s0" ];
      driverOptions = {
        miimon = "100"; # Monitor MII link every 100ms
        mode = "802.3ad";
        xmit_hash_policy = "layer3+4"; # IP and TCP/UDP hash
      };
    };
  };
</nowiki>}}


=== Teaming ===
=== Teaming ===