linux系統下配置橋接器(CentOS 5.5)

來源:互聯網
上載者:User

需要安裝如下
 bridge-utils和tunctl
yum search一下:
yum install bridge-utils.noarch
yum install tunctl.x86_64

1.查看是否存在邏輯(虛擬)橋接器介面
   brctl show
   如果已經存在可以用brctl delbr +橋接器名 刪除
2.增加一個新的邏輯(虛擬)橋接器介面br0
   brctl addbr br0
3.建立tap0,可以給虛擬機器使用
   tunctl -b    //應該是會出來個tap0
4.把eth0和tap0都加進邏輯(虛擬)橋接器br0
   brctl addif br0 eth0
   brctl addif br0 tap0
5.把eth0和tap0都整成混雜模式
   ifconfig eth0 0.0.0.0
   ifconfig tap0 0.0.0.0
6.配置橋接器IP並啟動
   ifconfig br0 10.239.54.105 up

7關閉橋接器命令

     brctl delif ena eth1;

     brctl delif ena eth0;

     ifconfig ena down;

     brctl delbr ena;

8啟動橋接器命令

ifconfig ena up;

總結:

主要命令為brctl

1、建立橋接器裝置 br0:  brctl addbr br0

2、向br0中添加網卡 eth0  eth1

                               
brctl addif eth0

                                brctl addif eth1

3、從橋接器中刪除網卡 eth0 eth1

                               brctl delif eth0

                               brctl delif eth1

4、刪除橋接器 br0 :   brctl  delbr  br0

PS:以上步驟可以手動設定在/etc/sysconfig/network-scripts/目錄下建立ifcfg-br0(br0為橋接器介面名稱),配置ifcfg-br0、ifcfg-eth0等。

參考:
  http://www.cnblogs.com/iceocean/articles/1594193.html
  http://sqxsqx84.blog.163.com/blog/static/2343305120095872539938/

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.