Linux Network Bridge

Voir :

https://www.linux-kvm.org/page/Networking

MacVTap

https://linuxfr.org/forums/linux-general/posts/fonctionnalite-tun-tap

Voir aussi :

ebtables

iproute2

Voir :

https://wiki.archlinux.org/index.php/Network_bridge

https://baturin.org/docs/iproute2/

Création

ip link add br0 type bridge ip link set br0 up ip link set enp0s8 up #ip addr flush enp0s8 ip link set enp0s8 master br0

Affichage et configuration

bridge link bridge fdb show dev br0 bridge vlan show ip addr add dev br0 192.168.56.11/24

Supression

ip addr flush br0 ip link set enp0s8 nomaster #ip link set enp0s8 down ip link del br0 type bridge

brctl (deprecated)

brctl (deprecated). Use ip link instead

brctl show

tunctl (deprecated).

tunctl (deprecated). Use ip tuntap and ip link instead

SystemD

Voir : https://wiki.archlinux.org/index.php/Systemd-networkd#Bridge_interface

nmcli

nmcli connection add type bridge autoconnect yes con-name br0 ifname br0 nmcli con show nmcli -f bridge con show br0

Disable STP

sudo nmcli con modify br0 bridge.stp no

Afficher la conf

nmcli con show nmcli -f bridge con show br0

Pour ajouter, ou pour mettre une interface en esclavage

nmcli con add type bridge-slave ifname team0 master br0

ça va créer un fichier

/etc/sysconfig/network-scripts/ifcfg-br0

STP=no TYPE=Bridge PROXY_METHOD=none BROWSER_ONLY=no BOOTPROTO=dhcp DEFROUTE=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_FAILURE_FATAL=no IPV6_ADDR_GEN_MODE=stable-privacy NAME=br0 UUID=8ddf2382-7458-4f94-8986-40e95415ea20 DEVICE=br0 ONBOOT=yes

Un nouveau fichier est apparu

/etc/sysconfig/network-scripts/ifcfg-bridge-slave-team0

TYPE=Ethernet NAME=bridge-slave-team0 UUID=93645ead-7177-4794-88f3-0a43c95bf179 DEVICE=team0 ONBOOT=yes BRIDGE=br0

RedHat

Edit /etc/sysconfig/network-scripts/ifcfg-eth0
comment out BOOTPROTO
Add BRIDGE=br0
Create /etc/sysconfig/network-scripts/ifcfg-br0
The content should be:
DEVICE=br0
BOOTPROTO=dhcp
ONBOOT=yes
TYPE=Bridge

Source : https://www.linux-kvm.org/page/Networking

Debian

/etc/network/interfaces
# Replace old eth0 config with br0
auto eth0 br0
# Use old eth0 config for br0, plus bridge stuff
iface br0 inet dhcp
bridge_ports eth0
bridge_stp off
bridge_maxwait 0
bridge_fd 0

Source : https://www.linux-kvm.org/page/Networking

Macvlan

Voir :

https://mghrepo.github.io/pse-mdbook/PSE_Res/virtualisation_reseau/macvlan.html

MacVTap

Voir :

https://www.furorteutonicus.eu/2013/08/04/enabling-host-guest-networking-with-kvm-macvlan-and-macvtap/

https://virt.kernelnewbies.org/MacVTap

https://www.ibm.com/support/knowledgecenter/en/linuxonibm/liaag/wkvm/wkvm_c_net_macvtap.htm

https://www.ibm.com/support/knowledgecenter/linuxonibm/liaag/wehs/l0wehs00_kvmguestvirtnetconfusingmacvtap.htm

https://www.flat-planet.net/?p=479

https://www.fir3net.com/UNIX/Linux/what-is-macvtap.html

https://linuxnatives.net/2012/virtualized-bridged-networking-with-macvtap

https://suhu0426.github.io/Web/Presentation/20150120/index.html

https://blog.scottlowe.org/2016/02/09/using-kvm-libvirt-macvtap-interfaces/

http://www.math.cmu.edu/~gautam/sj/blog/20140303-kvm-macvtap.html

https://events.static.linuxfound.org/sites/events/files/slides/2016%20-%20Linux%20Networking%20explained_0.pdf