yum install bridge-utils |
Se não estiver instalado, o será no momento que o comando executar.
O comando para trabalharmos com bridges é o brctl. E a sua utilização básica é a seguinte:
Usage: brctl [commands]commands: addbr <bridge> add bridge delbr <bridge> delete bridge addif <bridge> <device> add interface to bridge delif <bridge> <device> delete interface from bridge setageing <bridge> <time> set ageing time setbridgeprio <bridge> <prio> set bridge priority setfd <bridge> <time> set bridge forward delay sethello <bridge> <time> set hello time setmaxage <bridge> <time> set max message age setpathcost <bridge> <port> <cost> set path cost setportprio <bridge> <port> <prio> set port priority show show a list of bridges showmacs <bridge> show a list of mac addrs showstp <bridge> show bridge stp info stp <bridge> {on|off} turn stp on/off |
Criemos nossa bridge e adicionemos manualmente, no meu caso a eth1:
brctl addbr br0brctl addif eth1brctl showbridge name bridge id STP enabled interfacesbr0 8000.001517e5c825 no vnet1 vnet0 eth1 |
Vamos criar um script no CentOS para inicializar a bridge no momento do boot:
cd /etc/sysconfig/network-scriptstouch ifcfg-br0 |
E vamos preenche-lo dessa forma:
DEVICE=br0IPV6INIT=noIPV6_AUTOCONF=noONBOOT=yesTYPE=BridgeBOOTPROTO=static |
Eu vou adicionar a interface eth1 e portanto vou mexer no script dele, tornando-o assim:
DEVICE=eth1HWADDR=00:15:17:e5:c8:25IPV6INIT=noIPV6_AUTOCONF=noONBOOT=yesTYPE=EthernetBRIDGE=br0 |
Pronto! Depois disto é só adicioná-la ao configurar sua VM e tudo vai funcionar 100%.
Nenhum comentário:
Postar um comentário