You are not logged in.

#1 2024-12-16 11:58:07

fam007e
Member
From: Dhaka, Bangladesh
Registered: 2024-05-04
Posts: 11
Website

PPOE connection to my desktop directly and optimizing MTU size.

I want to know whether I can connect to my desktop to PPOE directly from my ONU. Moreover, is there a way to optimize the MTU size of the connection. I'm doing this as a fallback option as recently my router is showing some connectivity issues.
Will running this give the optimum value of MTU size:

#!/bin/bash

# Check if the destination is provided as an argument
if [ $# -ne 1 ]; then
    echo "Usage: $0 <destination>"
    exit 1
fi

# Extract destination from the command-line argument
destination="$1"

# Define the range of MTU sizes to test
min_mtu=1400
max_mtu=1500
step=1

# Function to perform ping test for a specific MTU size
ping_with_mtu() {
    mtu=$1
    ping -M do -c 4 -s $((mtu - 28)) -W 1 -q $destination >/dev/null
    result=$?
    return $result
}

# Iterate over the range of MTU sizes and perform ping tests
optimized_mtu=0
for (( mtu = min_mtu; mtu <= max_mtu; mtu += step )); do
    ping_with_mtu $mtu
    if [ $? -ne 0 ]; then
        optimized_mtu=$((mtu - step))
        break
    fi
done

# Only display the optimized MTU size once it's found
echo $optimized_mtu

Last edited by fam007e (2024-12-16 12:01:56)

Offline

Board footer

Powered by FluxBB