diff --git a/defaults/main.yml b/defaults/main.yml index c82829b3..c72c2168 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -23,6 +23,7 @@ lxc_net_bridge_port: none lxc_net_address: 10.0.3.1 lxc_net_netmask: 255.255.255.0 lxc_net_gateway: none ## if "none" no gateway will on the LXC bridge, nat must be "false" to use a gateway. +#lxc_net_mtu: 1500 ##setting this variable will add mtu configuration for the lxc config and network bridge # lxc container nat enabled lxc_net_nat: true ## If "true" nat rules will be created with the lxc network. diff --git a/templates/lxc-net-bridge.cfg.j2 b/templates/lxc-net-bridge.cfg.j2 index afcb161b..436cb6c0 100644 --- a/templates/lxc-net-bridge.cfg.j2 +++ b/templates/lxc-net-bridge.cfg.j2 @@ -7,6 +7,9 @@ iface {{ lxc_net_bridge }} inet static {% if lxc_net_nat == "true" %} {% if lxc_net_gateway != "none" %} gateway {{ lxc_net_gateway }} +{% endif %} +{% if lxc_net_mtu is defined %} + mtu {{ lxc_net_mtu }} {% endif %} # nat rules start and stop post-up /usr/local/bin/lxc-system-manage iptables-create diff --git a/templates/lxc-openstack.conf.j2 b/templates/lxc-openstack.conf.j2 index 24b38da7..97ab4975 100644 --- a/templates/lxc-openstack.conf.j2 +++ b/templates/lxc-openstack.conf.j2 @@ -10,4 +10,7 @@ lxc.network.type = {{ lxc_container_net_type }} lxc.network.name = {{ lxc_container_net_name }} lxc.network.link = {{ lxc_container_net_link }} lxc.network.flags = up +{% if lxc_net_mtu is defined %} +lxc.network.mtu = {{ lxc_net_mtu }} +{% endif %} lxc.network.hwaddr = 00:16:3e:xx:xx:xx