X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=nfvbenchvm%2Fdib%2Felements%2Fnfvbenchvm%2Fstatic%2Fetc%2Frc.d%2Frc.local.generator;h=9ac23a3a7c14a715692c67033310c2c4c6ca44a8;hb=a055c1555e0a8c0cfb8c6308990a23eb8db59d13;hp=633403cc0afdb2ab5d8c9a013cd213ebbededdd6;hpb=ae318cc8930dd19a3051fee4a0fc26d1a37c64d8;p=nfvbench.git diff --git a/nfvbenchvm/dib/elements/nfvbenchvm/static/etc/rc.d/rc.local.generator b/nfvbenchvm/dib/elements/nfvbenchvm/static/etc/rc.d/rc.local.generator index 633403c..9ac23a3 100644 --- a/nfvbenchvm/dib/elements/nfvbenchvm/static/etc/rc.d/rc.local.generator +++ b/nfvbenchvm/dib/elements/nfvbenchvm/static/etc/rc.d/rc.local.generator @@ -86,6 +86,24 @@ if [ $INTF_MGMT_CIDR ] && [ $INTF_MGMT_IP_GW ]; then logger "NFVBENCHVM ERROR: Cannot find eth port for management port" return 1 fi + + # By default, configure the MTU of the management interface to the + # conservative value of 1500: this will reduce the risk to get an + # unmanageable VM in some setups. + # + # To set the MTU to a different value, configure the INTF_MGMT_MTU variable + # in /etc/nfvbenchvm.conf. If INTF_MGMT_MTU is set to the special value + # "auto", the MTU will not be configured and it will keep the value set by + # the hypervisor ("legacy" nfvbenchvm behavior). If INTF_MGMT_MTU is unset, + # the MTU will be set to 1500. In other cases, the MTU will be set to the + # value of INTF_MGMT_MTU. + # + if [[ -z "$INTF_MGMT_MTU" ]]; then + ip link set $ETH_PORT mtu 1500 + elif [[ "$INTF_MGMT_MTU" != "auto" ]]; then + ip link set $ETH_PORT mtu $INTF_MGMT_MTU + fi + ip addr add $INTF_MGMT_CIDR dev $ETH_PORT ip link set $ETH_PORT up ip route add default via $INTF_MGMT_IP_GW dev $ETH_PORT @@ -101,4 +119,4 @@ else /nfvbench/start-nfvbench.sh fi -exit 0 \ No newline at end of file +exit 0