linux \u7f51\u5361\u865a\u62df\u5316\u547d\u4ee4<\/strong>\uff0cvlan20\u63d2\u53e3\uff1aens34.10\uff0cens34.20\uff1a<\/p>\n#vconfigaddens3410<\/p>\n
#vconfigaddens3420<\/p>\n
#cd\/etc\/sysconfig\/network-scripts\/<\/p>\n
<\/p>\n
#cpifcfg-ens34ifcfg-ens34.10--\u521b\u5efaens33.10\u63d2\u53e3\u914d\u7f6e\u6587\u4ef6<\/p>\n
\u7f16\u8f91ifcfg-ens34.10\u6587\u4ef6linux\u547d\u4ee4ls\uff0c\u964d\u4f4e\/\u66f4\u6539\u4e0b\u8fb9\u5185\u5bb9\uff1a<\/p>\n
#vimifcfg-ens34.10<\/p>\n
VLAN=yes<\/p>\n
TYPE=vlan<\/p>\n
PHYSDEV=ens34<\/p>\n
VLAN_ID=10<\/p>\n
NAME=ens34.10<\/p>\n
ONBOOT=yes<\/p>\n
ZONE=trusted<\/p>\n
DEVICE=ens34.10<\/p>\n
BRIDGE=brvlan-10<\/p>\n
#cpifcfg-ens34.10ifcfg-ens34.20<\/p>\n
\u7f16\u8f91ifcfg-ens34.20\u6587\u4ef6\uff0c\u964d\u4f4e\/\u66f4\u6539\u4e0b\u8fb9\u5185\u5bb9\uff1a<\/p>\n
#vimifcfg-ens34.20<\/p>\n
VLAN=yes<\/p>\n
TYPE=vlan<\/p>\n
PHYSDEV=ens34<\/p>\n
VLAN_ID=20<\/p>\n
NAME=ens34.20<\/p>\n
ONBOOT=yes<\/p>\n
ZONE=trusted<\/p>\n
DEVICE=ens34.20<\/p>\n
BRIDGE=brvlan-20<\/p>\n
(4)\u5206\u522b\u6784\u5efa\u96c6\u7ebf\u5668brvlan-10\uff0cbrvlan-20<\/p>\n
#brctladdbrbrvlan-10<\/p>\n
#brctladdbrbrvlan-20<\/p>\n
(5)\u7f16\u8f91\u96c6\u7ebf\u5668brvlan-10\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n
#vimifcfg-brvlan-10<\/p>\n
TYPE=bridge<\/p>\n
BOOTPROTO=static<\/p>\n
NAME=brvlan-10<\/p>\n
<\/p>\n
DEVICE=brvlan-10<\/p>\n
ONBOOT=yes<\/p>\n
\u7f16\u8f91\u96c6\u7ebf\u5668brvlan-20\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n
#vimifcfg-brvlan-20<\/p>\n
TYPE=bridge<\/p>\n
BOOTPROTO=static<\/p>\n
NAME=brvlan-20<\/p>\n
DEVICE=brvlan-20<\/p>\n
ONBOOT=yes<\/p>\n
(6)\u5c06\u96c6\u7ebf\u5668brvlan-10\u63a5\u5230\u7f51\u53e3ens34.10\uff0cbrvlan-20\u63a5\u5230\u7f51\u53e3ens34.20<\/p>\n
#brctladdifbrvlan-10ens34.10<\/p>\n
#brctladdifbrvlan-20ens34.20<\/p>\n
(7)\u91cd\u65b0\u542f\u52a8\u7f51\u8def\u670d\u52a1<\/p>\n
#systemctlrestartnetwork<\/p>\n
\u4e94\u3001Vlan\u6a21\u5f0f\u6d4b\u8bd5\u865a\u673a<\/p>\n
\u5148\u5c06NetworkManager\u670d\u52a1\u5173\u6389<\/p>\n
(1)\u5728\u5bbf\u4e3b\u673a\u4e2d\u65e9\u5df2\u63d0\u65e9\u521b\u5efa\u597d\u4e86\u865a\u673aVM1<\/p>\n
\u5728virt-manager\u4e0a\u5c06VM1\u7684\u865a\u62df\u7f51\u5361\u6302\u5230brvlan-10\u4e0a<\/p>\n
(2)\u4eceVM1\u514b\u9686\u4e00\u53f0\u865a\u673aVM2<\/p>\n
virst-clone-ovm1-nvm2-f\/var\/lib\/libvirt\/images\/vm2.qcow2<\/p>\n
(3)\u542f\u52a8VM1\u548cVM2\uff0c\u5e76\u914d\u7f6eip<\/p>\n
(4)\u67e5\u770bBridge\uff0c\u53d1\u89c9brvlan10\u65e9\u5df2\u8054\u63a5\u4e86vnet0vnet1\u8bbe\u5907\u3002<\/p>\n
\u516d\u3001\u7f51\u5361\u914d\u7f6ebond(\u7ed1\u5b9a)<\/p>\n
(1)\u7f51\u5361bond(\u7ed1\u5b9a)\uff0c\u4e5f\u53eb\u505a\u7f51\u5361\u6346\u7ed1\u3002\u5c31\u662f\u5c06\u4e24\u4e2a\u6216\u5219\u66f4\u591a\u7684\u5316\u5b66\u7f51\u5361\u7ed1\u5b9a\u6210\u4e00\u4e2a\u865a\u62df\u7f51\u5361\u3002\u7f51\u5361\u662f\u901a\u8fc7\u628a\u591a\u5f20\u7f51\u5361\u7ed1\u5b9a\u4e3a\u4e00\u4e2a\u903b\u8f91\u7f51\u5361\uff0c\u5b9e\u73b0\u672c\u5730\u7f51\u5361\u7684\u5197\u4f59\uff0c\u5e26\u5bbd\u6269\u5bb9\u548c\u8d1f\u8f7d\u5747\u8861\uff0c\u5728\u5e94\u7528\u5e03\u7f72\u4e2d\u662f\u4e00\u79cd\u5e38\u7528\u7684\u6280\u672f\u3002<\/p>\n
\u591a\u7f51\u5361\u7ed1\u5b9a\u5b9e\u9645\u4e0a\u987b\u8981\u63d0\u4f9b\u4e00\u4e2a\u989d\u5916\u7684\u8f6f\u4ef6\u7684bond\u9a71\u52a8\u7a0b\u5e8f\u5b9e\u73b0\u3002\u901a\u8fc7\u9a71\u52a8\u7a0b\u5e8f\u53ef\u4ee5\u5c06\u591a\u5757\u7f51\u5361\u5c4f\u853d\u3002\u5bf9TCP\/IP\u5408\u540c\u5c42\u53ea\u5b58\u5728\u4e00\u4e2aBond\u7f51\u5361\uff0c\u5728Bond\u7a0b\u5e8f\u4e2d\u5b9e\u73b0\u7f51\u8def\u6d41\u91cf\u7684\u8d1f\u8f7d\u5747\u8861\uff0c\u5c06\u8981\u4e00\u4e2a\u7f51\u8def\u6073\u6c42\u91cd\u5b9a\u4f4d\u5230\u4e0d\u540c\u7684\u7f51\u5361\u4e0a\uff0c\u6765\u63d0\u5347\u603b\u4f53\u7f51\u8def\u7684\u53ef\u7528\u6027\u3002<\/p>\n
(2)\u7f51\u5361\u7ed1\u5b9a\u7684\u76ee\u7684\uff1a<\/p>\n
1.\u63d0\u5347\u7f51\u5361\u7684\u541e\u5410\u91cf\u3002<\/p>\n
2.\u63d0\u9ad8\u7f51\u8def\u7684\u9ad8\u53ef\u7528\uff0c\u540c\u65f6\u4e5f\u80fd\u5b9e\u73b0\u8d1f\u8f7d\u5747\u8861\u3002<\/p>\n
(3)\u7f51\u5361\u914d\u7f6ebond(\u7ed1\u5b9a)bond\u6a21\u5f0f\uff1a<\/p>\n
1\u3001Mode=0(balance-rr)\u8868\u793a\u8d1f\u8f7d\u5206\u62c5round-robin\uff0c\u5e73\u8861\u534f\u7a0b\u7b56\u7565\uff0c\u5177\u6709\u8d1f\u8f7d\u5e73\u8861\u548c\u5bb9\u9519\u529f\u80fd<\/p>\n
bond\u7684\u7f51\u5361MAC\u4e3a\u5f53\u524d\u6d3b\u52a8\u7684\u7f51\u5361\u7684MAC\u5730\u5740\uff0c\u987b\u8981\u4ea4\u6362\u673a\u8bbe\u7f6e\u805a\u5408\u6a21\u5f0f\uff0c\u5c06\u591a\u4e2a\u7f51\u5361\u7ed1\u5b9a\u4e3a\u4e00\u6761\u94fe\u8def\u3002<\/p>\n
2\u3001Mode=1(active-backup)\u8868\u793a\u4e3b\u5907\u6a21\u5f0f\uff0c\u5177\u6709\u5bb9\u9519\u529f\u80fd\uff0c\u53ea\u6709\u4e00\u5757\u7f51\u5361\u662factive,\u53e6\u5916\u4e00\u5757\u662f\u5907\u7684standby\uff0c\u8fd9\u65f6\u5047\u82e5\u4ea4\u6362\u673a\u914d\u7684\u662f\u6346\u7ed1\uff0c\u5c06\u4e0d\u80fd\u6b63\u5e38\u5de5\u4f5c\uff0c\u7531\u4e8e\u4ea4\u6362\u673a\u5f80\u4e24\u5757\u7f51\u5361\u5206\u5305\uff0c\u6709\u4e00\u534a\u5305\u662f\u9057\u5f03\u7684\u3002<\/p>\n
3\u3001Mode=2(balance-xor)\u8868\u793aXORHash\u8d1f\u8f7d\u5206\u62c5(\u5f02\u6216\u5e73\u8861\u7b56\u7565)\uff0c\u5177\u6709\u8d1f\u8f7d\u5e73\u8861\u548c\u5bb9\u9519\u529f\u80fd<\/p>\n
\u6bcf\u4f4dslave\u63d2\u53e3\u4f20\u8f93\u6bcf\u4f4d\u6570\u636e\u5305\u548c\u4ea4\u6362\u673a\u7684\u805a\u5408\u5f3a\u5236\u4e0d\u534f\u5546\u5f62\u5f0f\u914d\u5408\u3002(\u987b\u8981xmit_hash_policy)\u3002<\/p>\n
4\u3001Mode=3(broadcast)\u8868\u793a\u6240\u6709\u5305\u4ece\u6240\u6709interface\u53d1\u51fa\uff0c\u5e7f\u64ad\u7b56\u7565\uff0c\u5177\u6709\u5bb9\u9519\u80fd\u529b\uff0c\u8fd9\u4e2a\u4e0d\u5747\u8861\uff0c\u53ea\u6709\u5197\u4f59\u673a\u5236...\u548c\u4ea4\u6362\u673a\u7684\u805a\u5408\u5f3a\u5236\u4e0d\u534f\u5546\u5f62\u5f0f\u914d\u5408\u3002<\/p>\n
5\u3001Mode=4(802.3ad)\u8868\u793a\u652f\u6301802.3ad\u5408\u540c(IEEE802.3ad\u52a8\u6001\u94fe\u63a5\u805a\u5408)\u548c\u4ea4\u6362\u673a\u7684\u805a\u5408LACP\u65b9\u6cd5\u914d\u5408(\u987b\u8981xmit_hash_policy)\u3002<\/p>\n
6\u3001Mode=5(balance-tlb)\u9002\u914d\u5668\u4f20\u8f93\u8d1f\u8f7d\u5747\u8861\uff0c\u5e76\u884c\u53d1\u9001\uff0c\u96be\u4ee5\u5e76\u884c\u63a5\u6536\uff0c\u89e3\u51b3\u4e86\u6570\u636e\u53d1\u9001\u7684\u56f0\u5c40\u3002\u662f\u6309\u7167\u6bcf\u4f4dslave\u7684\u8d1f\u8f7d\u60c5\u51b5\u9009\u62e9slave\u8fdb\u884c\u53d1\u9001\uff0c\u63a5\u6536\u65f6\u4f7f\u7528\u5f53\u540e\u8f6e\u5230\u7684slave\u3002<\/p>\n
7\u3001Mode=6(balance-alb)\u57285\u7684tlb\u57fa\u7840\u4e0a\u964d\u4f4e\u4e86rlb\u3002\u9002\u914d\u5668\u8d1f\u8f7d\u5747\u8861\u6a21\u5f0f\u5e76\u884c\u53d1\u9001\uff0c\u5e76\u884c\u63a5\u6536\u6570\u636e\u5305\u3002<\/p>\n
5\u548c6\u4e0d\u987b\u8981\u4ea4\u6362\u673a\u7aef\u7684\u8bbe\u7f6e\uff0c\u7f51\u5361\u80fd\u624b\u52a8\u805a\u5408\u30024\u987b\u8981\u652f\u6301802.3ad\u30020\uff0c2\u548c3\u7406\u8bba\u4e0a\u987b\u8981\u9759\u6001\u805a\u5408\u65b9\u6cd5\uff0c\u4f46\u5b9e\u6d4b\u4e2d0\u53ef\u4ee5\u901a\u8fc7mac\u5730\u5740\u8bef\u5bfc\u7684\u5f62\u5f0f\u5728\u4ea4\u6362\u673a\u4e0d\u8bbe\u7f6e\u7684\u60c5\u51b5\u4e0b\u4e0d\u592a\u5747\u8861\u5730\u8fdb\u884c\u63a5\u6536\u3002<\/p>\n
\u5e38\u7528\u7684\u6709\u4e09\u79cd\uff1a<\/p>\n
mode=0\uff1a\u5e73\u8861\u8d1f\u8f7d\u6a21\u5f0f\uff0c\u6709\u624b\u52a8\u5907\u63f4\uff0c\u4f46\u987b\u8981\u201dSwitch\u201d\u652f\u63f4\u53ca\u8bbe\u5b9a\u3002<\/p>\n
mode=1\uff1a\u624b\u52a8\u5907\u63f4\u6a21\u5f0f\uff0c\u5176\u4e2d\u4e00\u6761\u7ebf\u82e5\u65ad\u7ebf\uff0c\u5176\u4ed6\u7ebf\u8def\u5c06\u4f1a\u624b\u52a8\u5907\u63f4\u3002<\/p>\n
mode=6\uff1a\u5e73\u8861\u8d1f\u8f7d\u6a21\u5f0f\uff0c\u6709\u624b\u52a8\u5907\u63f4\uff0c\u4f55\u5fc5\u201dSwitch\u201d\u652f\u63f4\u53ca\u8bbe\u5b9a\u3002<\/p>\n
(4)\u7f51\u5361\u914d\u7f6ebond(\u7ed1\u5b9a)<\/p>\n
1\u3001eth1\uff0ceth2\uff0ceth3\u90fd\u914d\u7f6e\u7ed1\u5b9a\u4e3abond0linux\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\uff0c\u6bd4\u5982\uff1a<\/p>\n
#catifcfg-eth1<\/p>\n
TYPE=Ethernet<\/p>\n
BOOTPROTO=none<\/p>\n
DEVICE=eth1<\/p>\n
ONBOOT=yes<\/p>\n
MASTER=bond0<\/p>\n
SLAVE=yes<\/p>\n
\u8f7d\u5165bond\u6a21\u5757\uff1a<\/p>\n
#modprobebonding<\/p>\n
2\u3001\u67e5\u770bbond0\uff0c\u5e76\u6865\u63a5\u5230br1<\/p>\n
#catifcfg-bond0<\/p>\n
DEVICE=bond0<\/p>\n
TYPE=Bond<\/p>\n
NAME=bond0<\/p>\n
BONDING_MASTER=yes<\/p>\n
BOOTPROTO=static<\/p>\n
USERCTL=no<\/p>\n
ONBOOT=yes<\/p>\n
#IPADDR=192.168.10.10<\/p>\n
#PREFIX=24<\/p>\n
#GATEWAY=192.168.10.19<\/p>\n
BONDING_OPTS=\"mode=6miimon=100\"<\/p>\n
BRIDGE=br1<\/p>\n
3\u3001\u67e5\u770b\u96c6\u7ebf\u5668br0<\/p>\n
catifcfg-br1<\/p>\n
TYPE=Bridge<\/p>\n
DEVICE=br1<\/p>\n
ONBOOT=yes<\/p>\n
IPADDR=192.168.10.1<\/p>\n
IPADDR1=192.168.20.1<\/p>\n
IPADDR2=192.168.30.1<\/p>\n
IPADDR3=192.168.40.1<\/p>\n
IPADDR4=192.168.50.1<\/p>\n
PREFIX3=24<\/p>\n
PREFIX4=24<\/p>\n
#GATEWAY=172.16.0.1<\/p>\n
#DNS1=172.16.254.251<\/p>\n
#DNS2=223.5.5.5<\/p>\n
4\u3001\u91cd\u542f\u7cfb\u7edf<\/p>\n
\u67e5\u770b\u7f51\u5361\u4fe1\u606f\uff1a<\/p>\n
#ethtoolbond0<\/p>\n
\u4e03\u3001\u7f51\u5361\u914d\u7f6ebond+vlan\u5b9e\u8df5<\/p>\n
(1)\u521b\u5efabond0\uff0c\u5e76\u521b\u5efa\u914d\u7f6e\u6587\u4ef6<\/p>\n
(2)\u5c06bond0\u6865\u63a5\u5230br1\uff0c\u5e76\u521b\u5efabr1\u914d\u7f6e\u6587\u4ef6\uff0c\u91cd\u542f\u7f51\u8def\u670d\u52a1<\/p>\n
(3)\u5728br1\u4e0a\uff0c\u521b\u5efa\u865a\u62dfvlan\u7f51\u53e3\uff1abr1.10\uff0cbr1.20\uff0c\u5e76\u521b\u5efa\u914d\u7f6e\u6587\u4ef6<\/p>\n
(4)\u521b\u5efabrvlan-10\uff0cbrvlan-10\uff0c\u5e76\u521b\u5efa\u914d\u7f6e\u6587\u4ef6<\/p>\n
(5)\u5c06\u96c6\u7ebf\u5668\u4e0e\u865a\u62dfvlan\u7f51\u53e3\u8054\u63a5<\/p>\n
brctladdifbrvlan-10br1.10<\/p>\n
brctladdifbrvlan-20br1.20<\/p>\n
(6)\u91cd\u542f\u7f51\u8def\u670d\u52a1<\/p>\n","protected":false},"excerpt":{"rendered":"
\u521b\u5efavlan\u63a5\u53e3\u524d\uff0c\u5728\u8bbe\u5907\u4e0a\u6dfb\u52a0\u4e00\u5757\u7f51\u5361ens34\uff0c\u591a\u7f51\u5361\u7ed1\u5b9a\u5b9e\u9645\u4e0a\u9700\u8981\u63d0\u4f9b\u4e00\u4e2a\u989d\u5916\u7684\u8f6f\u4ef6\u7684bond\u9a71\u52a8\u7a0b\u5e8f\u5b9e\u73b0\u3002\u901a\u8fc7\u9a71\u52a8\u7a0b\u5e8f\u53ef\u4ee5\u5c06\u591a\u5757\u7f51\u5361\u5c4f\u853d\u3002\u5bf9TCP\/IP\u534f\u8bae\u5c42\u53ea\u5b58\u5728\u4e00\u4e2aBond\u7f51\u5361\uff0c\u5728Bond\u7a0b\u5e8f\u4e2d\u5b9e\u73b0\u7f51\u7edc\u6d41\u91cf\u7684\u8d1f\u8f7d\u5747\u8861\uff0c\u5373\u5c06\u4e00\u4e2a\u7f51\u7edc\u8bf7\u6c42\u91cd\u5b9a\u4f4d\u5230\u4e0d\u540c\u7684\u7f51\u5361\u4e0a\uff0c\u6765\u63d0\u9ad8\u603b\u4f53\u7f51\u7edc\u7684\u53ef\u7528\u6027\u3002<\/p>\n","protected":false},"author":1,"featured_media":287547,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-287546","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/287546","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=287546"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/287546\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/287547"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=287546"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=287546"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=287546"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}