How to change adapter MTU

I’m deploying IPFire in a Vultr instance. It will serve as a firewall between the internet and a VPC (Virtual Private Cloud).

According to Vultr documentation:

“For optimal performance, set the VPC adapter MTU to 1450.”

I understan this means I need to setup the GREEN interface with a MTU of 1450, instead of the default of 1500:

-bash-5.1$ ip a show green0
3: green0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc cake state UP group default qlen 1000
    link/ether 5a:00:03:e2:ed:38 brd ff:ff:ff:ff:ff:ff
    inet scope global green0
       valid_lft forever preferred_lft forever

My questions:

  1. How to change the MTU for GREEN interface?
  2. How to use DHCP to get clients in the GREEN network to use the new MTU value?

Thank you.

Carlos, I changed the file /var/dhcp/dhcpd.conf and added a line:

        max-lease-time 3600;
        option interface-mtu 9000;   # jumbo frames

Went to a client, restarted networking so as to renew ip and got:

enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc fq_codel state UP group default qlen 1000

But … the next ipfire release may reset the dhcpd.conf

Thanks for answering.

I guess you mean /var/ipfire/dhcp/dhcp.conf.

I think that those configurations can be made with the WUI (Network > DHCP Server > Additional DHCP options). But I’d like some one to confirm. So I suppose it will be something like this:

  • Option name: interface-mtu
  • Option value: 1450

But what about the IPFires’s GREEN adapter itself? I think you should set the MTU in the adapter first.

1 Like

sorry, typo. I guess you can do it from the WUI.

There is /var/ipfire/ethernet/settings but no option GREEN_FORCE_MTU=
Maybe add it and ipfire might be smart to figure it out :slight_smile:

There is a local file available. If this is the right file, then the .local should survive an update…

[root@ipfire ~] # ls -al /var/ipfire/dhcp/dhcpd.conf*
-rw-r--r-- 1 nobody nobody 2127 Jan 14 14:02 /var/ipfire/dhcp/dhcpd.conf
-rw-r--r-- 1 nobody nobody    0 Jun 10  2017 /var/ipfire/dhcp/dhcpd.conf.local
[root@ipfire ~] # 

Click on the List options button:

maybe this will help!

The dhcp.conf.local is the correct file for additional changes to dhcp but you can only use it to add global dhcp parameters as the contents are appended to the end of the normal dhcp.conf file. So you can’t add commands related just to a subnet like Green.

The main dhcp.conf file will be overwritten every time you do any change to the dhcp wui page

1 Like

Hi Jon,
You are absolutely right, that is the place for that mtu option and it can be limited to the GREEN interface as well be selecting the Option scope:

1 Like

:roll_eyes: How I didn’t see that. Thank you.

I can confirm that adding the option in the WUI works to pass MTU value to dhcp clients. I tested this with an Ubuntu client and it gets the desired MTU value. This answers one of my questions.

But IPFire’s green interface is still in 1500:

ifconfig | grep mtu | grep green

green0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

Is my understanding that the MTU size should be the same for the network. In this case the GREEN network (IPFire + DHCP clients).

I’m looking for something like this:

But for IPFire, and want to be sure it won’t get modified after an update.

I wonder if the dhcp server needs to be bounced??

[root@ipfire ~]# /etc/rc.d/init.d/dhcp
Usage: /etc/rc.d/init.d/dhcp {start|stop|reload|restart|status}
1 Like

What do you mean? I actually rebooted the server.

And I don’t think any changes in DHCP server configuration would change IPFire’s GREEN adapter MTU size. It only affects the clients. Please correct me if I’m wrong.

rebooting the ipfire box is fine!


Can someone please help me with my question about changing the MTU in IPFire’s GREEN adapter?

I only found docs online about other distros, but those configuration files don’t exists in IPFire, and I don’t know where to look.

Thank you.

Carlos, you can add a line in /etc/sysconfig/rc.local to force 1500 to the green interface.
Anything in that file executes after boot.
You can find the actual command, am not in the lab at the moment.

1 Like

Thank you.

I did a test adding the following line to /etc/sysconfig/rc.local:

/sbin/ip link set mtu 1450 dev gree0

And it seems to work.

Not sure if it should be ip or ifconfig, or another command. Or if the command structure is OK. All documentation I find is for Debian or RedHat.

1 Like

ip is correct. excellent.