πŸ”€πŸš€ Isolating Traffic & Ensuring NFS πŸ–₯️ Redundancy with Bonding - Link Aggregation

10 minute read

Published:

πŸ‘‹ Bonding - Link Aggregation cumulus linux / Isolating Traffic / NFS

🎯 Objective

The goal of this project is to πŸ”’ isolate traffic between πŸ’» Machine1 & Machine2 while ensuring both can access the πŸ—‚οΈ NFS server. Additionally, redundancy is implemented for the server’s 🌐 network interfaces to enhance πŸ”„ fault tolerance.

πŸ“Œ Constraints

  1. πŸ—οΈ Layer 2 switches (Cumulus Linux) for Switch 1 & Switch 2.
  2. Only Switch 3 can use Layer 3 (πŸ“‘ routing if needed).
  3. ❌ No additional VMware LAN segments for isolation.

🌐 Network Design Without Redundancy

Network Design

We divided the πŸ—οΈ implementation into 2️⃣ parts:

  1. βš™οΈ Configuring devices to allow πŸ–₯️ client-to-server communication while isolating clients from each other.
  2. πŸš€ Enabling high availability for the πŸ“ NFS server.

πŸ”§ Infrastructure Choices

  • πŸ’» Machine 1 & Machine 2: Separated into VLANs (Machine1 in VLAN πŸ”Ÿ, Machine2 in VLAN 2️⃣0️⃣) to prevent direct communication.
  • πŸ“ NFS Server: Interface in 🌈 trunk mode to receive traffic from both VLANs.
  • πŸ–§ Switch 1: 1️⃣ access port for Machine1, 2️⃣ trunk ports (to NFS server & Switch3).
  • πŸ–§ Switch 2: 2️⃣ access ports for Machine2.
  • πŸ–§ Switch 3: Acts as an intermediary switch.

πŸ”Œ Switch Port Roles

  • Switch1:
    • 🟒 swp1: VLANπŸ”Ÿ (access mode)
    • 🌈 swp2: Trunk to πŸ“ NFS Server
    • 🌈 swp3: Trunk to Switch3
  • Switch2:
    • 🟒 swp1, swp2: VLAN2️⃣0️⃣ (access mode)
  • Switch3:
    • 🌈 swp1: Trunk to Switch1
    • 🟒 swp2: VLAN2️⃣0️⃣ (access mode)

❓ Why VLANs?

We used VLANs to πŸ—οΈ isolate πŸ’» Machine1 from πŸ’» Machine2 while keeping πŸ–§ Switch3 as a Layer 2 switch. Since they remain in the same 🌍 LAN, VLANs allow πŸ”„ separation without adding 🌐 inter-VLAN routing.

βš™οΈ Switch Configuration

πŸ–§ Switch 1

net add interface swp1 bridge access 10
net add interface swp2,swp3 bridge vids 10,20
net add bridge bridge ports swp1,swp2,swp3
net add bridge bridge vids 10,20
net commit

Switch 1 Config

πŸ–§ Switch 2

net add interface swp1,swp2 bridge access 20
net add bridge bridge ports swp1,swp2
net add bridge bridge vids 20
net commit

Switch 2 Config

πŸ–§ Switch 3

net add interface swp1 bridge vids 10,20
net add interface swp2 bridge access 20
net add bridge bridge ports swp1,swp2
net add bridge bridge vids 20
net commit

Switch 3 Config

πŸ“ NFS Server & Client Setup

πŸ–₯️ NFS Server Configuration

🌐 Network Setup

Install VLAN support on the server & clients:

apt install vlan

NFS Network Setup

Configure the πŸ“ NFS server with 🌈 Dual IP (sub-interfaces) to support VLAN-based communication.

πŸ“¦ NFS Installation

Install required packages & set up πŸ“‚ directory sharing:

sudo apt install nfs-kernel-server
mkdir -p /machine1 /machine2
echo "/machine1 10.0.0.1(rw,sync,no_subtree_check)" >> /etc/exports
echo "/machine2 20.0.0.1(rw,sync,no_subtree_check)" >> /etc/exports
exportfs -a

NFS Installation NFS config

πŸ’» Client Machines Setup

πŸ’Ύ Mounting NFS Shares on Clients

πŸ”Ή Machine1:

mkdir -p /mnt/machine1
mount -t nfs 10.0.0.1:/machine1 /mnt/machine1

NFS mount

πŸ”Ή Machine2:

mkdir -p /mnt/machine2
mount -t nfs 20.0.0.1:/machine2

NFS mount

πŸ› οΈ Testing

πŸ’» Machine 1 to πŸ“ NFS Server

πŸ“‘ Ping Test

ping 10.0.0.1

Ping Test

πŸ’Ύ Write Test

πŸ” Capture of TCP exchanges:

Write Test

πŸ”„ Adding Fault Tolerance

Fault Tolerance

To improve reliability, we connected the πŸ“ NFS server to 2️⃣ network interfaces (ens34 & ens35) aggregated under πŸ”— bond0 using ⚑ LACP (Link Aggregation Control Protocol). This allows VLANs πŸ”Ÿ & 2️⃣0️⃣ to pass through while ensuring redundancy.

πŸ–§ Switch 1 Configuration for LACP

net del bridge bridge ports swp2
net add interface swp4 bridge vids 10,20
net add bond bond0 bond slaves swp2,swp4
net add bridge bridge ports bond0
net commit

LACP Server

πŸ–₯️ Server Configuration for LACP

LACP Server

πŸ“ˆ Performance Testing

Run πŸ“‘ iperf tests to measure πŸ“Š bandwidth with & without πŸ”— link aggregation:

iperf -c 10.0.0.1 -t 10
iperf -c 10.0.0.1 -P 4 -t 10

πŸ› οΈ Testing LACP Failover

With this setup, πŸ”„ network failures are handled smoothly without disrupting πŸ–₯️ client access to the πŸ“ NFS server. βœ…

LACP Server