[Reprinted] For Linux bridge configuration, xen and opennebula configuration are mandatory.

Source: Internet
Author: User

Configure bridges in the inux System

First, install the NIC and connect it to the network. This is nonsense.
Then start!

Set linux to run bridges and configure Bridges
We need to let linux know about the bridge. First, we need to tell it that we want a virtual ethernet bridge interface: (this will be executed on the host bridge, but it is unclear to see the test scenario)
Root @ bridge: ~> Brctl addbr br0
Second, we do not need STPS (Spanning Tree Protocol. Because we only have one vro, it is absolutely impossible to form a ring. We can disable this function. (This can also reduce packet pollution in the network environment ):
Root @ bridge: ~> Brctl stp br0 off
After these preparations, we can finally do something immediate. We add two (or more) Ethernet physical interfaces, which means we attach them to the newly generated logical (virtual) Bridge interface br0.
Root @ bridge: ~> Brctl addif br0 eth0
Root @ bridge: ~> Brctl addif br0 eth1
Now, our two Ethernet physical interfaces have changed to two logical ports on the bridge. The two physical interfaces used to exist and will not disappear in the future. If you don't believe it, check it out. Now they are part of the Logical bridge device, so IP addresses are no longer needed. Next, release these IP addresses.
Root @ bridge: ~> Ifconfig eth0 down
Root @ bridge: ~> Ifconfig eth1 down
Root @ bridge: ~> Ifconfig eth0 0.0.0.0 up
Root @ bridge: ~> Ifconfig eth1 0.0.0.0 up

Okay! We now have a box w/o which is not available for any IP address. Now, if you want to configure your firewall or router through TP, you can only use the local control port. Won't you tell me that your machine does not even have a serial port?
Note: The above red part is actually optional. In the test, I found that even if the original NIC address is not released, the bridge can also work! However, to be more standardized, or to avoid any inexplicable problems, we 'd better follow these four steps as required!

Finally, enable the bridge root @ bridge: ~> Ifconfig br0 up

Optional. an IP address is assigned to the new bridge interface.
Root @ bridge: ~> Ifconfig br0 10.0.3.129

Or combine the last two steps:
Root @ bridge: ~> Ifconfig br0 10.0.3.129 up
There is one more up!

Now we are done.

Disable the Bridge command


Brctl delif ena eth1;
Brctl delif ena eth0;
Ifconfig ena down;
Brctl delbr ena;

 

From: http://hi.baidu.com/renchunyun/blog/item/e3dea432ce0130f01b4cff6a.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.