patrickernandes
(usa Debian)
Enviado em 01/10/2019 - 10:41h
#Exemplo que uso no CentOS 7:
yum install net-tools bridge-utils
#habilitar ip_forward:
sed -i 's/^\(net.ipv4.ip_forward =\).*/\1 1/' /etc/sysctl.conf; sysctl -p
#checar modulos se estão em execução:
modinfo bridge
#Ajustes:
vi /etc/sysconfig/network-scripts/ifcfg-br0
TYPE=Bridge
BOOTPROTO=none #dhcp
NAME=br0
DEVICE=br0
ONBOOT=yes
DNS1=8.8.8.8
DOMAIN=casa.local
IPADDR=192.168.0.9
PREFIX=24
GATEWAY=192.168.0.1
NM_CONTROLLED=no
DELAY=0
vi /etc/sysconfig/network-scripts/ifcfg-eth0
HWADDR=AA:BB:CC:DD:EE:FF
TYPE=Ethernet
BOOTPROTO=none
NAME=eth0
DEVICE=eth0
ONBOOT=yes
NM_CONTROLLED=no
BRIDGE=br0
#tun:
modprobe tun
echo tun > /etc/modules-load.d/tun.conf
ip tuntap add tap0 mode tap
ifconfig tap0
#vhost:
modprobe vhost-net
echo vhost-net > /etc/modules-load.d/vhost.conf
vi /etc/sysconfig/network-scripts/ifcfg-tap0
DEVICE=tap0
TYPE=Tap
ONBOOT=yes
BRIDGE=br0
brctl addbr br0
brctl addif br0 eth0 tap0
brctl show
systemctl start network.service
systemctl enable network.service
systemctl disable NetworkManager
systemctl disable NetworkManager-wait-online
systemctl disable ModemManager
reboot