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