OpenVZ Remove Venet

Source: Internet
Author: User

Venet is a network device created by default when OpenVZ creates container, and venet does not need to exist after bridging, and you will find that you cannot set a default gateway when creating container, or the gateway is missing after restarting.

The Official chart lists the differences between Veth and Venet.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/71/96/wKioL1XUNPXxA9CPAADsnGsoKWQ496.jpg "title=" Vethandvenet.png "alt=" Wkiol1xunpxxa9cpaadsngsokwq496.jpg "/>

Now list the methods to get rid of venet and make sure container is created directly using Veth

First, stop using VZ

/etc/init.d/vz stop

Second, modify the configuration file

The following number of file lines differ slightly depending on the VZ kernel version, please note

63 Line Start

     63        # net_modules= "${VNET_ Modules} ${veth_modules} "     64         ####################################     65         # Patch for disable venet interface     66         # Block 1     67         # 2015-08-14 Fox Chan     68         ###################################     69         net_modules= "${veth_modules}"      70         if [ -n  "${vzdev}"  ]      71        then     72                 net_modules= "${net_modules} ${vnet_modules}"       73        fi     74         ####################################      75        #  patch for disable venet  interface     76        #   end block 1     77        #   2015-08-14 Fox Chan     78         ###################################


235 rows

    235         ############################# #######    236         # patch for  disable venet interface    237          # Block 2    238          # 2015-08-14 Fox Chan    239          ###################################    240          if [ -n  "$VZDEV"  ]    241          then    242                  __echo  "bringing up interface  $VZDEV:  "    243                  ip link set  $VZDEV  up    244                  print_result     245                 ip  addr add 0.0.0.0/0 dev  $VZDEV     246                  if [  "${ipv6}"  =   "Yes"  ]; then    247                          ip -6  addr add fe80::1/128 dev  $VZDEV     248                  fi    249          fi    250         ### #################################    251          # Patch for disable venet interface    252          # End Block 2    253          # 2015-08-14 fox chan    254          ###################################


265 rows

    265         ############################# #######    266         # patch for  disable venet interface    267          # Block 3    268          # 2015-08-14 Fox Chan    269          ###################################    270          if [ -n  "$VZDEV"  ]    271          then    272     273                  if ip  addr list | grep -q  "Venet0:.*up"  2>/dev/null; then    274                           __echo  "bringing down interface  $VZDEV: "      275                          ip link set  $VZDEV  down     276                          print_result    277                  fi     278         fi    279          ####################################    280          # patch for disable venet interface    281          # Block 3    282          # 2015-08-14 Fox Chan     283         ###################################


Third, restart the VZ service

Attachments for my vz file that can be downloaded with your own or used

This article is from the "Silver Fox" blog, please be sure to keep this source http://foxhound.blog.51cto.com/1167932/1686016

OpenVZ Remove Venet

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.