Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
linux:networking [2009/03/19 12:49] a bonding setup (debian) - HA |
linux:networking [2014/08/21 10:27] zagi [TCP Tunning (linux kernel)] |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Linux networking ====== | ====== Linux networking ====== | ||
+ | ===== Usefull links ===== | ||
- | === Usefull links === | ||
* [[http:// | * [[http:// | ||
* [[http:// | * [[http:// | ||
Line 28: | Line 28: | ||
===== TCP Tunning (linux kernel) ===== | ===== TCP Tunning (linux kernel) ===== | ||
+ | Change initial tcp window: | ||
+ | |||
+ | ip route | while read p; do ip route change $p initcwnd 20 initrwnd 20; done | ||
+ | |||
+ | |||
{{page> | {{page> | ||
Line 110: | Line 115: | ||
^mode=5 (balance-tlb)|Adaptive Transmit Load Balancing. Incoming traffic is received on the active slave only, outgoing traffic is distributed according to the current load on each slave. Doesn’t require special switch support | | ^mode=5 (balance-tlb)|Adaptive Transmit Load Balancing. Incoming traffic is received on the active slave only, outgoing traffic is distributed according to the current load on each slave. Doesn’t require special switch support | | ||
^mode=6 (balance-alb)|Adaptive Load Balancing - provides both transmit load balancing (TLB) and receive load balancing for IPv4 via ARP negotiation. Doesn’t require special switch support, but does require the ability to change the MAC address of a device while it is open. | | ^mode=6 (balance-alb)|Adaptive Load Balancing - provides both transmit load balancing (TLB) and receive load balancing for IPv4 via ARP negotiation. Doesn’t require special switch support, but does require the ability to change the MAC address of a device while it is open. | | ||
+ | |||
==== Setup ==== | ==== Setup ==== | ||
Line 131: | Line 137: | ||
| | ||
+ | |||
+ | ==== Joining interfaces for bandwidth ==== | ||
+ | |||
+ | The following section describes how to bond two or more interfaces to provide shared bandwidth and reliablity. We have two options for this, using the //mode 0// (balanced-rr) or //mode 4// (802.3ad or LACP). If the server is connected to a Cisco switch, I recommend using balanced-rr as described below. | ||
+ | |||
+ | First we have to configure the module in / | ||
+ | |||
+ | < | ||
+ | alias bond0 bonding | ||
+ | alias eth0 tg3 | ||
+ | alias eth1 e1000 | ||
+ | options bonding mode=0 miimon=100 | ||
+ | </ | ||
+ | |||
+ | Then, we configure the bonding interface: | ||
+ | |||
+ | < | ||
+ | auto bond0 | ||
+ | iface bond0 inet static | ||
+ | address 192.168.0.1 | ||
+ | netmask 255.255.255.252 | ||
+ | hwaddress ether 00: | ||
+ | up ifenslave bond0 eth0 eth1 | ||
+ | down ifenslave -d bond0 eth0 eth1 | ||
+ | </ | ||
+ | |||
+ | |||
+ | On the Cisco side, we also have to configure the appropriate physical interfaces and the PortChannel interface: | ||
+ | |||
+ | < | ||
+ | interface Port-Channel 1 | ||
+ | | ||
+ | | ||
+ | | ||
+ | ! | ||
+ | |||
+ | interface FastEthernet 0/4 | ||
+ | !you might need this options | ||
+ | !no switchport | ||
+ | !no ip address | ||
+ | channel-group 1 mode on | ||
+ | ! | ||
+ | |||
+ | interface FastEthernet 0/5 | ||
+ | !you might need this options | ||
+ | !no switchport | ||
+ | !no ip address | ||
+ | channel-group 1 mode on | ||
+ | !channel-group 1 mode active | ||
+ | ! | ||
+ | </ | ||
+ | |||
+ | |||
+ | | ||
+ | | ||