FreeBSD Configure NIC Jumbo Frames

Posted on in Categories , last updated November 13, 2008

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: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin and a trainer for the Linux operating system/Unix shell scripting. He has worked with global clients and in various industries, including IT, education, defense and space research, and the nonprofit sector. Follow him on Twitter, Facebook, Google+.

Share this on (or read 6 comments/add one below):

6 comment

  1. OK, I did it…but “route get” shows mtu 1500 =( What could I do?


    [[email protected] /usr/home/dyr]# ifconfig em1 mtu 9198
    [[email protected] /usr/home/dyr]# ifconfig em1
    em1: flags=8943 metric 0 mtu 9198
    options=19b
    ether 00:30:48:63:da:c7
    inet 10.77.77.222 netmask 0xffffff00 broadcast 10.77.77.255
    media: Ethernet autoselect (1000baseTX )
    status: active
    [[email protected] /usr/home/dyr]# route get 10.77.77.1
    route to: 10.77.77.1
    destination: 10.77.77.1
    gateway: home-rs.vs.smartspb.net
    interface: em0
    flags:
    recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire
    0 0 0 0 0 0 1500 0

    Cisco at another side already set to use jumbo frames:

    home-rs#show interfaces gigabitEthernet 1/0/2
    GigabitEthernet1/0/2 is up, line protocol is up (connected)
    Hardware is Gigabit Ethernet, address is 0014.f286.5302 (bia 0014.f286.5302)
    Description: home-vr/em1
    MTU 9198 bytes, BW 1000000 Kbit, DLY 10 usec,
    reliability 255/255, txload 1/255, rxload 1/255
    Encapsulation ARPA, loopback not set
    Keepalive not set
    Full-duplex, 1000Mb/s, media type is 10/100/1000BaseTX
    input flow-control is off, output flow-control is unsupported
    ARP type: ARPA, ARP Timeout 04:00:00
    Last input never, output 1w0d, output hang never
    Last clearing of "show interface" counters 2w0d
    Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
    Queueing strategy: fifo
    Output queue: 0/40 (size/max)
    5 minute input rate 0 bits/sec, 0 packets/sec
    5 minute output rate 0 bits/sec, 0 packets/sec
    17031 packets input, 5586651 bytes, 0 no buffer
    Received 16022 broadcasts (0 multicast)
    0 runts, 0 giants, 0 throttles
    0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
    0 watchdog, 0 multicast, 0 pause input
    0 input packets with dribble condition detected
    1654 packets output, 469745 bytes, 0 underruns
    0 output errors, 0 collisions, 0 interface resets
    0 babbles, 0 late collision, 0 deferred
    0 lost carrier, 0 no carrier, 0 PAUSE output
    0 output buffer failures, 0 output buffers swapped out

    What’s wrong?

  2. It’s sad cause it’s also don’t working %-(


    [[email protected] /etc/ipfw]# route change 10.77.77.1 -mtu 9100
    change host 10.77.77.1
    [[email protected] /etc/ipfw]# route get 10.77.77.1
    route to: 10.77.77.1
    destination: 10.77.77.1
    gateway: home-rs.vs.smartspb.net
    interface: em0
    flags:
    recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire
    0 0 0 0 0 0 9100 0
    [[email protected] /etc/ipfw]# ping 10.77.77.1
    PING 10.77.77.1 (10.77.77.1): 56 data bytes
    64 bytes from 10.77.77.1: icmp_seq=0 ttl=255 time=0.530 ms
    ^C
    --- 10.77.77.1 ping statistics ---
    1 packets transmitted, 1 packets received, 0.0% packet loss
    round-trip min/avg/max/stddev = 0.530/0.530/0.530/0.000 ms
    [[email protected] /etc/ipfw]# route get 10.77.77.1
    route to: 10.77.77.1
    destination: 10.77.77.1
    gateway: home-rs.vs.smartspb.net
    interface: em0
    flags:
    recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire
    0 0 0 0 0 0 1500 0
    [[email protected] /etc/ipfw]#

  3. Forcing the duplex to full is a really bad idea, as if the other side is set to auto-duplex, the correct behaviour for it will be to fall back to half-duplex, in which case you’ll end up with a duplex mismatch.

Leave a Comment