FreeBSD Configure NIC Jumbo Frames

Q.Under Linux I can set Jumbo Frames by modifying configuration file. How do I configure FreeBSD network card to enable Jumbo frames on all of my NIC for 1000 Mbps speed and make MTU configuration persistence?

A. You can use standard FreeBSD ifconfig command to set Jumbo Frames i.e. set the Maximum Transport Unit (MTU) frame size above its default of 1500 bytes. The maximum MTU setting for Jumbo Frames is 16110. This value coincides with the maximum Jumbo Frames size of 16128.

Make sure your adapter driver and network infrastructure supports jumbo frames.

FreeBSD command to set MTU (Jumbo Frames)

Login as the root user and use ifconfig command as follows:

WARNING! Using Jumbo Frames at 10 or 100 Mbps may result in poor performance or loss of link.

# ifconfig {interface-name} {ip-address} mtu 9000
# ifconfig em0 10.20.110.2 mtu 9000

Alternativly, you can use router command to set mtu:
# route change 10.20.110.2 -mtu 9000

Task: FreeBSD – Find out MTU settings

To confirm the MTU used between two specific devices. use route command as follows::
# route get {destination-IP-address}
# route get 10.20.110.2

Output:

route get 10.20.110.2
   route to: 10.20.110.2
destination: 10.20.110.0
       mask: 255.255.255.192
  interface: em0
      flags: 
 recvpipe  sendpipe  ssthresh  rtt,msec    rttvar  hopcount      mtu     expire
       0         0         0         0         0         0      9000   -454924 

Make Jumbo Frames Configuration Persistence

Set mtu settings by editing /etc/rc.conf file:
# vi /etc/rc.conf
Modify interface em0 as follows, enter:
ifconfig_em0="inet x.x.x.x netmask y.y.y.y media 1000baseTX mediaopt full-duplex mtu 9000"
Save and close the file. Restart networking:
# /etc/rc.d/netif restart
Please note that you may also need to tune the application / network protocol such as NFS and SMB to take advantage of Jumbo Frames.

Posted by: SXI ADMIN

The author is the creator of SXI LLC and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.