顯示頁面舊版反向連結Fold/unfold all回到頁頂 本頁是唯讀的,您可以看到原始碼,但不能更動它。您如果覺得它不應被鎖上,請詢問管理員。 ====== Linux Bridge 設定與觀念 ====== 這文件說明在 Linux 底下如何將兩張網卡設定 Bridge 的方式, 並解說有關 Ethernet 的 STP(Spanning Tree Protocol) 基本觀念. * http://www.tldp.org/HOWTO/BRIDGE-STP-HOWTO/index.html ===== Example ===== * 於 CentOS6 內建立一個 virbr1 然後將 eth1 加入 * 建立 virbr1 的 Bridge Ingerface <code> brctl addbr virbr1 </code> * 查看建立的結果 <code> brctl show virbr1 </code><file> bridge name bridge id STP enabled interfaces virbr1 8000.000000000000 no </file> * 將 eth1 加入 virbr1, 先更改 eth1 設定<code> vi /etc/sysconfig/network-scripts/ifcfg-eth1 </code><file> DEVICE=eth1 TYPE=Ethernet UUID=758d91ab-d139-417a-be51-95f3eeafe6d0 ONBOOT=yes NM_CONTROLLED=no BOOTPROTO=none DEFROUTE=yes IPV4_FAILURE_FATAL=yes IPV6INIT=no NAME="System eth1" #IPADDR=192.168.0.252 #PREFIX=24 #GATEWAY=192.168.0.249 HWADDR=20:CF:30:23:2A:C3 #DNS1=192.168.0.245 LAST_CONNECT=1395632272 BRIDGE=virbr1 </file> * 再更改 virbr1 設定<code> vi /etc/sysconfig/network-scripts/ifcfg-virbr1 </code><file> DEVICE=virbr1 TYPE=Bridge BOOTPROTO=none IPADDR=192.168.0.252 NETMASK=255.255.255.0 ONBOOT=yes DELAY=0 </file> * 通常需要重新開機才會正常 {{tag>linux bridge}} tech/linux_bridge.txt 上一次變更: 2016/07/15 06:08由 jonathan