Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
linux:networking [2007/02/25 16:29] a |
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 9: | Line 9: | ||
* [[http:// | * [[http:// | ||
* **[[http:// | * **[[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
* [[: | * [[: | ||
* [[: | * [[: | ||
Line 24: | 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 74: | Line 83: | ||
This file will do it all regarding VLAN creation during boot process. No rc.* scripts necessary, and the VLAN setting is completely in line with the Fedora specifications. | This file will do it all regarding VLAN creation during boot process. No rc.* scripts necessary, and the VLAN setting is completely in line with the Fedora specifications. | ||
+ | |||
==== nameif/ | ==== nameif/ | ||
Line 83: | Line 93: | ||
ifrename ce mas hotplug v kernelu avtomatsko dela ne da bi rabu kaj poganjat | ifrename ce mas hotplug v kernelu avtomatsko dela ne da bi rabu kaj poganjat | ||
samo v /etc/iftab vpises kar hoces | samo v /etc/iftab vpises kar hoces | ||
+ | |||
+ | |||
+ | ===== Working with VLANs (Debian) ===== | ||
+ | ''/ | ||
+ | auto vlan667 | ||
+ | iface vlan667 inet static | ||
+ | address 10.10.40.4 | ||
+ | netmask 255.255.255.0 | ||
+ | vlan_raw_device eth1 | ||
+ | |||
+ | ===== Ethernet bonding ===== | ||
+ | Ethernet bonding refers to aggregating multiple ethernet channels together to form a single channel. This is primarily used for redundancy in ethernet paths or for load balancing. This page refers in particular to performing ethernet bonding under Linux, and so does not limit itself to discussion of 802.3ad Trunk Aggregation. | ||
+ | |||
+ | ==== Ethernet Bonding Types ==== | ||
+ | |||
+ | ^mode=0 (balance-rr)|Round-robin policy: Transmit packets in sequential order from the first available slave through the last. This mode provides load balancing and fault tolerance. | | ||
+ | ^mode=1 (active-backup)|One slave interface is active at any time. If one interface fails, another interface takes over the MAC address and becomes the active interface. Provides fault tolerance only. Doesn’t require special switch support| | ||
+ | ^mode=2 (balance-xor)|Tranmissions are balanced across the slave interfaces based on ((source MAC) XOR (dest MAC)) modula slave count. The same slave is selected for each destination MAC. Provides load balancing and fault tolerance. | | ||
+ | ^mode=3 (broadcast)|Transmits everything on all slave interfaces. Provides fault tolerance. | | ||
+ | ^mode=4 (802.3ad)|This is classic IEEE 802.3ad Dynamic link aggregation. This requires 802.3ad support in the switch and driver support for retrieving the speed and duplex of each slave. | | ||
+ | ^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. | | ||
+ | |||
+ | |||
+ | ==== Setup ==== | ||
+ | To use Bonding Ethernet for High-Availability (fail-over) on Debian Lenny you need to: | ||
+ | | ||
+ | |||
+ | Edit / | ||
+ | < | ||
+ | iface bond0 inet static | ||
+ | address 10.0.1.5 | ||
+ | netmask 255.255.255.0 | ||
+ | network 10.0.1.0 | ||
+ | gateway 10.0.1.254 | ||
+ | up / | ||
+ | down / | ||
+ | </ | ||
+ | |||
+ | Add the following lines to your / | ||
+ | |||
+ | alias bond0 bonding | ||
+ | | ||
+ | |||
+ | |||
+ | ==== 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 | ||
+ | ! | ||
+ | </ | ||
+ | |||
+ | |||
+ | | ||
+ | | ||
+ |