OpenVZ Forum


Home » General » Support » Removing venet0 from VE (OpenVZ7 - Virtuozzo Linux 7.2)
icon5.gif  Removing venet0 from VE (OpenVZ7 - Virtuozzo Linux 7.2) [message #52729] Tue, 07 February 2017 17:03
A(r|d)min is currently offline  A(r|d)min
Messages: 6
Registered: February 2017
Junior Member
Hi community,

the article about the network mode "bridged" (https:// docs.openvz.org/openvz_users_guide.webhelp/_bridged_mode_for _containers.html) in the documentation says this mode can only be an addition to the host-routed network. But a VE without a host-routed network is exactly what I want to have. My VEs should have only a bridged interface.

So I was able to get rid of venet0 on the physical host and I removed the network "Host-Only". But venet0 still exists in the VE. It seems like no network traffic can go through venet0 on the VE anymore and that's great. But how do I remove the network device of the VE. I really want this net device to disappear. Has someone an idea?

This is what I've done to get rid of venet0 on the physical host:

1)
I modified /usr/libexec/vz so the function setup_net is looking like this (got the idea from here https://openvz.org/Disable_venet_interface):
setup_net()
{
        local hwcsum_set=1 tso_set=1 val
        local rx=on tx=on sg=on tso=on
        local ethtool_args= iface_params

        # We do not want to export the whole config file.
        eval $(. ${VZCONF} && echo USE_NET_TSO="${USE_NET_TSO}" \
                USE_NET_HWCSUM="${USE_NET_HWCSUM}")

        if [ -n "${VE_ROUTE_SRC_DEV}" ]; then
          setup_venet
        fi

        if [ "${USE_NET_HWCSUM}" = "yes" ]; then
                ethtool_args="${ethtool_args} rx on tx on sg on"
        elif [ "${USE_NET_HWCSUM}" = "no" ]; then
                ethtool_args="${ethtool_args} rx off tx off sg off"
        else
                hwcsum_set=0
        fi

        if [ "${USE_NET_TSO}" = "yes" ]; then
                ethtool_args="${ethtool_args} tso on"
        elif [ "${USE_NET_TSO}" = "no" ]; then
                ethtool_args="${ethtool_args} tso off"
        else
                tso_set=0
        fi

        if [[ ${hwcsum_set} -eq 0 || ${tso_set} -eq 0 ]]; then
                # Get minimal common subset of capabilities.
                for iface in $(get_physical_interfaces); do
                        iface_params=$(ethtool -k "${iface}" | awk '
                                /^rx-checksumming:/{print "rx", $2};
                                /^tx-checksumming:/{print "tx", $2};
                                /^scatter-gather:/{print "sg", $2};
                                /^tcp-segmentation-offload:/{print "tso", $2}')
                        for param in rx tx sg tso; do
                                val=$(echo "${iface_params}" | awk "/${param}/{print \$2}")
                                [ "${val}" = "off" ] && eval ${param}=off
                        done
                done
                [ ${hwcsum_set} -eq 0 ] && ethtool_args="${ethtool_args} rx ${rx} tx ${tx} sg ${sg}"
                [ ${tso_set} -eq 0 ] && ethtool_args="${ethtool_args} tso ${tso}"
        fi
        if [ -n "$VE_ROUTE_SRC_DEV"]; then
          [ -n "${ethtool_args}" ] && ethtool -K venet0 ${ethtool_args} &>/dev/null
        fi
        return 0
}


2)
To take effect I have this in the /etc/vz/vz.conf:
VE_ROUTE_SRC_DEV=""


3)
prlsrvctl net del Host-Only


And after reboot there should be no venet0 on the physical host. But still there is a venet0 in the VE.
This had no effect:
prlctl set OpenVZ_Tests_VE_d2 --netif_del venet0
Previous Topic: Creating a template from installation
Next Topic: SSL cert on https://bugs.openvz.org expired
Goto Forum:
  


Current Time: Wed Apr 24 10:01:05 GMT 2024

Total time taken to generate the page: 0.01376 seconds