{"id":159559,"date":"2019-10-19T09:01:52","date_gmt":"2019-10-19T01:01:52","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=159559"},"modified":"2019-09-28T11:04:00","modified_gmt":"2019-09-28T03:04:00","slug":"linux-pre-net","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/linux-pre-net.html","title":{"rendered":"Linux\u7269\u7406\u7f51\u5361\u805a\u5408\u53ca\u6865\u63a5"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n
\nLinux\u5185\u90e8\u5b9e\u73b0\u7684bridge\u53ef\u4ee5\u628a\u4e00\u53f0\u673a\u5668\u4e0a\u7684\u591a\u5f20\u7f51\u5361\u6865\u63a5\u8d77\u6765\uff0c\u4ece\u800c\u628a\u81ea\u5df1\u4f5c\u4e3a\u4e00\u53f0\u4ea4\u6362\u673a\u3002\u540c\u65f6\uff0cLInux bridge\u8fd8\u652f\u6301\u865a\u62df\u7aef\u53e3\uff0c\u5373\u6865\u63a5\u7684\u4e0d\u4e00\u5b9a\u90fd\u662f\u7269\u7406\u7f51\u5361\u63a5\u53e3\uff0c\u8fd8\u53ef\u4ee5\u662f\u865a\u62df\u63a5\u53e3\u3002\u76ee\u524d\u4e3b\u8981\u8868\u73b0\u4e3aTap\u63a5\u53e3\uff0cTap\u63a5\u53e3\u5728\u903b\u8f91\u4e0a\u548c\u7269\u7406\u7f51\u5361\u5b9e\u73b0\u76f8\u540c\u7684\u529f\u80fd\uff0c\u90fd\u53ef\u4ee5\u63a5\u6536\u548c\u53d1\u9001\u6570\u636e\u5305\u3002\u6240\u4ee5\u8fd9\u4e00\u5e94\u7528\u4e5f\u6210\u5c31\u4e86\u865a\u62df\u5316\u73af\u5883\u4e0b\u7684bridge\u5b9e\u73b0\u3002
\n\u5230\u6b64\u57fa\u7840\u7406\u8bba\u77e5\u8bc6\u5c31\u4ecb\u7ecd\u5b8c\u4e86\uff0c\u90a3\u4e48\u63a5\u4e0b\u6765\u5c31\u7ed3\u5408Linux\u6e90\u4ee3\u7801\u5206\u6790\u4e0b\u6865\u63a5\u6a21\u5f0f\u4e0b\u6570\u636e\u5305\u7684\u8f6c\u53d1\u6d41\u7a0b\u3002
\n<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
\u8bf4\u660e\uff1a<\/strong><\/div>\n
(1)\u3001\u5728\u7f51\u5361\u805a\u5408\u7ed1\u5b9a\u4e4b\u524d\uff0c\u8981\u5148\u505c\u7528NetworkManager\u670d\u52a1(\u6216\u8005\u5728\u7f51\u5361\u4e2d\u6dfb\u52a0\u53c2\u6570\uff1aNM_CONTROLLED=no)\uff0c\u5426\u5219\u7cfb\u7edf\u91cd\u542f\u540e\u7ed1\u5b9a\u7684IP\u5931\u6548\u4e86\u3002<\/strong><\/span><\/div>\n
\r\n# systemctl stop NetworkManager\r\n\r\n# systemctl disable NetworkManager\r\n<\/pre>\n
(2)\u3001\u7f51\u5361\u6865\u63a5\u670d\u52a1\u5668\u9700\u8981\u4f9d\u8d56KVM\u865a\u62df\u5316\u76f8\u5173\u670d\u52a1\uff1a<\/strong><\/span><\/div>\n
\r\n# vim \/etc\/yum.repos.d\/opennebula.repo\r\n\r\n    \u6dfb\u52a0\u5982\u4e0b\u5185\u5bb9:\r\n    [opennebula]\r\n    name=opennebula\r\n    baseurl=http:\/\/downloads.opennebula.org\/repo\/5.0\/CentOS\/7\/x86_64\r\n    enabled=1\r\n    gpgcheck=0\r\n\r\n# yum install opennebula-node-kvm\r\n<\/pre>\n

\u51c6\u5907\u5de5\u4f5c\u5b8c\u6210\u540e\uff0c\u5c31\u53ef\u4ee5\u6b63\u5f0f\u5f00\u59cb\u4e86\uff01<\/p>\n

1\u3001\u7f16\u8f91\u7269\u7406\u7f51\u5361\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n

\r\n# vim ifcfg-eno1\r\n\r\nDEVICE=eno1\r\nTYPE=Ethernet\r\nBOOTPROTO=none\r\nNM_CONTROLLED=no\r\nONBOOT=yes\r\nMASTER=bond0\r\nSLAVE=yes\r\n\r\n# vim ifcfg-ens15f0\r\n\r\nDEVICE=ens15f0\r\nTYPE=Ethernet\r\nBOOTPROTO=none\r\nNM_CONTROLLED=no\r\nONBOOT=yes\r\nMASTER=bond0\r\nSLAVE=yes\r\n<\/pre>\n

2\u3001\u521b\u5efa\u805a\u5408\u7f51\u5361\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n

\r\n# vim ifcfg-bond0\r\n\r\nDEVICE=bond0\r\nTYPE=bond\r\nBOOTPROTO=none\r\nNM_CONTROLLED=no\r\nONBOOT=yes\r\nBRIDGE=br0\r\n<\/pre>\n

3\u3001\u521b\u5efa\u6865\u63a5\u7f51\u5361\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n

\r\n# vim ifcfg-br0\r\n\r\nDEVICE=br0\r\nTYPE=Bridge\r\nBOOTPROTO=none\r\nONBOOT=yes\r\nNM_CONTROLLED=no\r\nIPADDR=192.168.1.233\r\nNETMASK=255.255.255.0\r\nGATEWAY=192.168.1.1\r\n<\/pre>\n

4\u3001\u7f16\u8f91\u7f51\u5361\u805a\u670d\u52a1\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n

\r\n# vim \/etc\/modprobe.d\/bonding.conf\r\n\r\nalias bond0 bonding\r\noptions bonding mode=4 miimon=100\r\n<\/pre>\n

5\u3001\u6267\u884c\u7f51\u5361\u805a\u5408\u547d\u4ee4\uff1a<\/p>\n

\r\n# modprobe bonding\r\n<\/pre>\n

6\u3001\u67e5\u770b\u805a\u5408\u7f51\u5361\u7684\u72b6\u6001\uff1a<\/p>\n

\r\n# cat \/proc\/net\/bonding\/bond0\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"

# systemctl stop NetworkManager # systemctl disable Net […]<\/p>\n","protected":false},"author":63,"featured_media":159560,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-159559","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/159559","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\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=159559"}],"version-history":[{"count":8,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/159559\/revisions"}],"predecessor-version":[{"id":160421,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/159559\/revisions\/160421"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/159560"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=159559"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=159559"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=159559"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}