Friday, October 10, 2008

Link aggregarion and Logical Interfaces

The two ends of the network interface configuration spectrum are -

"Link aggregation, or IEEE 802.3ad, is a computer networking term which describes using multiple Ethernet network cables/ports in parallel to increase the link speed beyond the limits of any one single cable or port, and to increase the redundancy for higher availability." (ref: http://en.wikipedia.org/wiki/Link_aggregation)

- and -



Link Aggregation and Logical Interfaces

Logical interfaces allow you to assign multiple IP addresses to a single physical interface, and share the bandwidth of a single interface across multiple IP addresses.



Link Aggregation:
Over the years there have been a couple ways to configure link aggregation on Solaris, the current method is via the 'dladm' command. Here's a script to detect all physical interfaces on your host and create a single aggregated link assigned the name 'aggr1'.

#!/bin/sh

if [ $# -lt 1 ]; then
echo "Usage: ./trunk.sh [ip address]"
exit 1
fi

interfaces=`dladm show-link | grep -v LINK | awk '{print $1}'`
dladm_cmd="dladm create-aggr -l passive"
for i in $interfaces; do
dladm_cmd="${dladm_cmd} -d $i"
done
dladm_cmd="${dladm_cmd} 1"

echo "
To enable trunking, execute the following commands:

${dladm_cmd}
ifconfig aggr1 plumb ${1}/24 up
dladm show-aggr
echo \"${1}\" > /etc/hostname.aggr1
svcadm disable network/physical:nwam
svcadm enable network/physical:default
"
exit 0


Examples of dladm command output used in the script:
# dladm show-link
LINK CLASS MTU STATE OVER
e1000g4 phys 1500 up --
e1000g0 phys 1500 up --
e1000g2 phys 1500 unknown --
e1000g1 phys 1500 up --
e1000g3 phys 1500 unknown --
e1000g5 phys 1500 up --

Create link aggregation named 'aggr1', using interfaces e1000g1, e1000g4 and e1000g5:
# dladm create-aggr -l passive -d e1000g1 -d e1000g4 -d e1000g5 1


Show status of aggr1 interface:
# dladm show-aggr
LINK POLICY ADDRPOLICY LACPACTIVITY LACPTIMER FLAGS
aggr1 L4 auto passive short -----

Note that to use this feature you must coordinate with you network switch administrator. The policy and and aggregated interfaces must configured identically on the other end of the ethernet cables ...


We use the Link Aggregation Control Protocol (LACP) in passive mode to control simultaneous transmission on multiple interfaces. Any single stream is transmitted completely on an individual interface, but multiple simultaneous streams can be active across all interfaces.

Logical Interfaces:
A single physical interface can be assigned multiple IP addresses - you may have already seen this in my earlier post on zones, where I configured a set of zones to share a single physical network interface.


Use /network/physical:default service to manage network interfaces:
# svcadm disable svc:/network/physical:nwam
# svcadm enable svc:/network/physical:default


Example: Configure a second address on interface bge0
# ifconfig bge0
bge0: flags=201000843 mtu 1500 index 2
inet 192.168.1.200 netmask ffffff00 broadcast 192.168.1.255

# ifconfig bge0:1 plumb
# ifconfig bge0:1 172.0.1.111/24 up
# ifconfig bge0:1
bge0:1: flags=201000843 mtu 1500 index 2
inet 172.0.1.111 netmask ffffff00 broadcast 172.0.255.255


That was simple ! Your bge0 interface now participates on two subnets: 192.168.1.0/24 and 172.0.1.0/24.


To make this bge0:1 configuration permanent, create the file /etc/hostname.bge0:1 containing the ip address 172.0.1.111. Your logical interface will be initialized each time you boot your system.


Readers who read this page, also read:




Bookmark and Share My Zimbio http://www.wikio.com

0 comments: