Permanently set eth0 MTU.

Hi Guys,

I need to permanently set the MTU on eth0, I know this is very “linux installation variable” from past painful experience.

Does anyone know the correct way to do this on the BeagleV/Fire before I head off hacking everything to try to get it to work?

Thanks

Andy

FYI, I don’t have a BeagleV.
This is assuming you are running debian 12 image.

$cat /etc/network/interfaces
iface eth0 inet mtu xxxx

Also, make sure the kernel is actually assigning eth0 to the interface.

$ls /sys/class/net
1 Like

Thanks for the reply.

/etc/network/interfaces didn’t exist, so I added it with iface eth0 inet mtu 1200, rebooted, MTU did not change.

beagle@BeagleV:~$ ifconfig
docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
        ether 02:42:9e:a7:c9:68  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.10  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 2a02:c7c:dd80:7300:204:a3ff:fe2e:aa6b  prefixlen 64  scopeid 0x0<global>
        inet6 fd04:bfdb:70f2:0:204:a3ff:fe2e:aa6b  prefixlen 64  scopeid 0x0<global>
        inet6 fe80::204:a3ff:fe2e:aa6b  prefixlen 64  scopeid 0x20<link>
        ether 00:04:a3:2e:aa:6b  txqueuelen 1000  (Ethernet)
        RX packets 533  bytes 101241 (101.2 KB)
        RX errors 0  dropped 218  overruns 0  frame 0
        TX packets 57  bytes 8433 (8.4 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 53  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 100  bytes 8811 (8.8 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 100  bytes 8811 (8.8 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.7.2  netmask 255.255.255.0  broadcast 192.168.7.255
        inet6 fe80::204:a3ff:fe2e:aa6e  prefixlen 64  scopeid 0x20<link>
        ether 00:04:a3:2e:aa:6e  txqueuelen 1000  (Ethernet)
        RX packets 342  bytes 52299 (52.2 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 252  bytes 44308 (44.3 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Here is the version info:

beagle@BeagleV:~$ uname -a
Linux BeagleV 6.1.33-linux4microchip+fpga-2023.06-20231019+ #1 SMP Thu Oct 19 16:01:29 UTC 2023 riscv64 riscv64 riscv64 GNU/Linux

beagle@BeagleV:~$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 23.04
Release:	23.04
Codename:	lunar

beagle@BeagleV:~$ cat  /etc/os-release
PRETTY_NAME="Ubuntu 23.04"
NAME="Ubuntu"
VERSION_ID="23.04"
VERSION="23.04 (Lunar Lobster)"
VERSION_CODENAME=lunar
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=lunar
LOGO=ubuntu-logo

Are you using systemd-networkd to manage networkng ?
If so /etc/network/interfaces might be being ignored.

1 Like

Hi @benedict.hewson,

I edited /etc/systemd/network/eth0.network and bingo it works, so I guess it is using systemd-networkd :slight_smile:

Thanks for the pointer.

Andy