ARTICLE DETAIL

资讯详情

深耕网站建设、视觉设计与SEO优化的一线实战洞察。

bonding广播模式模拟测试

bonding广播模式模拟测试 #创建测试环境# 创建网络命名空间ipnetnsaddbond-ns1ipnetnsaddbond-ns2# 创建三对 veth 接口使用三对以演示主备模式iplinkaddveth0-ns2typeveth peer name veth0-ns1iplinkaddveth1-ns2typeveth peer name veth1-ns1# 将 veth-ns 端移到命名空/iplinksetveth0-ns1 netns bond-ns1iplinksetveth1-ns1 netns bond-ns1iplinksetveth0-ns2 netns bond-ns2iplinksetveth1-ns2 netns bond-ns2# 创建 bond1 接口#ip netns exec bond-ns1 ip link add bond1 type bond mode 3 miimon 100ipnetnsexecbond-ns1iplinkaddbond1typebond mode3# 将 veth 接口添加到 bondipnetnsexecbond-ns1iplinksetveth0-ns1 master bond1ipnetnsexecbond-ns1iplinksetveth1-ns1 master bond1# 激活所有接口ipnetnsexecbond-ns1iplinksetveth0-ns1 upipnetnsexecbond-ns1iplinksetveth1-ns1 upipnetnsexecbond-ns1iplinksetbond1 upipnetnsexecbond-ns1iplinksetlo up# 为 bond1 分配 IP 地址ipnetnsexecbond-ns1ipaddradd192.168.10.1/24 dev bond1#检查 bond0 状态在命名空间ipnetnsexecbond-ns1cat/proc/net/bonding/bond1# 创建 bond2 接口#ip netns exec bond-ns2 ip link add bond2 type bond mode 3 miimon 100ipnetnsexecbond-ns2iplinkaddbond2typebond mode3# 将 veth 接口添加到 bondipnetnsexecbond-ns2iplinksetveth0-ns2 master bond2ipnetnsexecbond-ns2iplinksetveth1-ns2 master bond2# 激活所有接口ipnetnsexecbond-ns2iplinksetveth0-ns2 upipnetnsexecbond-ns2iplinksetveth1-ns2 upipnetnsexecbond-ns2iplinksetbond2 upipnetnsexecbond-ns2iplinksetlo up# 为 bond2 分配 IP 地址ipnetnsexecbond-ns2ipaddradd192.168.10.2/24 dev bond2#检查 bond0 状态在命名空间ipnetnsexecbond-ns2cat/proc/net/bonding/bond2
返回列表