EthernetInterconnections


The alternatives for Ethernet interface configuration are either Repeater or Link Aggregation Control Protocol

Install the bridge-utils and ifenslave packages:
sudo apt-get install bridge-utils ifenslave

Ethernets.svg
A pictorial representation of the interface hierarchy for both methodologies

To utilise these instructions in an automated fashion, download either Repeater or Link Aggregation Control Protocol.
sudo nano /etc/network/interfaces


Repeater

Create a Bridge interface for each of the physical Ethernet interfaces:
sudo brctl addbr bridge0
sudo brctl stp bridge0 on
sudo brctl addif bridge0 eth0
sudo brctl addbr bridge1
sudo brctl stp bridge1 on
sudo brctl addif bridge1 eth1
Verify:
brctl show

Insert the bonding kernel module configured in broadcast mode:
sudo modprobe -v bonding mode=3 || sudo insmod /lib/modules/`uname -r`/kernel/drivers/net/bonding/bonding.ko mode=3
Verify:
lsmod | grep bonding

Assign the Bonding interface to cover all of the Bridge interfaces:
sudo ifenslave bond0 bridge0 bridge1
Verify:
ifenslave -a | grep MASTER && ifenslave -a | grep SLAVE

Optional VLAN creation:
sudo bridge vlan add dev bridge0 vid 1 self
sudo bridge vlan add dev bridge1 vid 1 self
sudo ip link add link bond0 bond0.0 type vlan proto 802.1ad id 0
sudo ip link add link bond0 bond0.0.0 type vlan proto 802.1Q id 0
Verify:
bridge vlan
ip link show bond0.0
ip link show bond0.0.0

Request logical addresses:
(sudo dhclient -4 -nw -w bond0 bond0.0 bond0.0.0 &) && (sudo dhclient -N -nw -w bond0 bond0.0 bond0.0.0 &)


Link Aggregation Control Protocol

Insert the bonding kernel module configured in IEEE 802.3ad mode:
sudo modprobe -v bonding mode=4 || sudo insmod /lib/modules/`uname -r`/kernel/drivers/net/bonding/bonding.ko mode=4
Verify:
lsmod | grep bonding

Assign the Bonding interface to cover all of the physical interfaces:
sudo ifenslave bond0 eth0 eth1
Verify:
ifenslave -a | grep MASTER && ifenslave -a | grep SLAVE

Create a Bridge interface to cover the Bonding interface:
sudo brctl addbr bridge0
sudo brctl stp bridge0 on
sudo brctl addif bridge0 bond0
Verify:
brctl show

Bring up the Bridge interface:
sudo ifconfig bridge0 up

Optional VLAN creation:
sudo bridge vlan add dev bridge0 vid 1 self
sudo ip link add link bridge0 bridge0.0 type vlan proto 802.1ad id 0
sudo ip link add link bridge0 bridge0.0.0 type vlan proto 802.1Q id 0
Verify:
bridge vlan
ip link show bridge0.0
ip link show bridge0.0.0

Bring up the VLAN interfaces:
sudo ifconfig bridge0.0 up
sudo ifconfig bridge0.0.0 up

Request logical addresses:
(sudo dhclient -4 -nw -w bridge0 bridge0.0 bridge0.0.0 &) && (sudo dhclient -N -nw -w bridge0 bridge0.0 bridge0.0.0 &)

Optional Pseudo Wire Emulation Edge-to-Edge configuration:
sudo ip l2tp add tunnel encap udp name l2tpeth2 tunnel_id 1 local <This eth2 IP address> udp_sport 1701 peer_tunnel_id 1 remote <That eth2 IP address> udp_dport 1701
sudo modprobe -v l2tp_eth || sudo insmod /lib/modules/`uname -r`/kernel/net/l2tp/l2tp_eth.ko
sudo ip l2tp add session name l2tpeth2 tunnel_id 1 session_id 1 peer_session_id 1
sudo ifconfig l2tpeth2 up
sudo brctl addif bridge0 l2tpeth2
Verify:
sudo ip l2tp show tunnel
sudo ip l2tp show session
brctl show
brctl showmacs bridge0
brctl showstp bridge0

If you wish to bring down the Ethernet tunnel:
sudo ip l2tp del session tunnel_id 1 session_id 1
sudo ip l2tp del tunnel tunnel_id 1
Verify:
sudo ip l2tp show tunnel
sudo ip l2tp show session

L2TPv3.svg
Neither the VLANs nor the PWE3 portions of this topology are reasonable propositions, unless your network and the Internet's interconnections are Fat Trees and until the availability of TRansparent Interconnection of Lots of Links.


Jonathan Ferguson, Ubuntu Wiki, Ethernet Interconnections, https://wiki.ubuntu.com/JonathanFerguson/EthernetInterconnections


JonathanFerguson/EthernetInterconnections (last edited 2015-12-13 10:44:40 by jonathan-ferguson)