Hello,
how can I change MTU of a network interface with a Vagrantfile option ?
What I have is:
[root@dev-local ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 08:00:27:a9:2d:51 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic enp0s3 valid_lft 85575sec preferred_lft 85575sec
inet6 fe80::a00:27ff:fea9:2d51/64 scope link
valid_lft forever preferred_lft forever
3: enp0s8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 08:00:27:8b:7e:e7 brd ff:ff:ff:ff:ff:ff
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fe8b:7ee7/64 scope link
valid_lft forever preferred_lft forever
[root@dev-local ~]#
I would like to change MTU of enp0s3 to 1300.
The Vagrantfile is this:
Vagrant.configure(2) do |config|
config.vm.provider "virtualbox" do |v|
v.memory = 512
v.cpus = 1
v.customize ["modifyvm", :id, "--cpuexecutioncap", "50"]
end
config.vm.hostname = "dev-local"
config.ssh.username = 'root'
config.ssh.password = 'root'
config.ssh.insert_key = 'true'
config.ssh.pty = false
config.vm.boot_timeout = 600
config.vm.network "private_network", ip: "192.168.10.10"
if ENV['ROOT_TFS_MAPPINGS']
config.vm.synced_folder ENV['ROOT_TFS_MAPPINGS'], "/src"
end
if Vagrant.has_plugin?("vagrant-vbguest")
config.vbguest.auto_update = true
config.vbguest.no_remote = true
end
end
If I change manually /etc/sysconfig/network-scripts/ifcfg-enp0s3, the interface has no ip address mounted after a "vagrant reload". It seems that vagrant is in some way aware that the file was manually changed and this causes a failure...
Thanks