tech:linux_network_bridge
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| tech:linux_network_bridge [2025/03/30 21:32] – Jean-Baptiste | tech:linux_network_bridge [2026/06/07 19:12] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | < | ||
| + | {{tag> | ||
| + | |||
| + | # Linux Network Bridge | ||
| + | |||
| + | Voir : | ||
| + | * https:// | ||
| + | * [[# | ||
| + | * https:// | ||
| + | |||
| + | Voir aussi : | ||
| + | * ebtables | ||
| + | |||
| + | |||
| + | ## iproute2 | ||
| + | |||
| + | Voir : | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | Création | ||
| + | ~~~bash | ||
| + | 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 | ||
| + | ~~~bash | ||
| + | bridge link | ||
| + | bridge fdb show dev br0 | ||
| + | bridge vlan show | ||
| + | |||
| + | ip addr add dev br0 192.168.56.11/ | ||
| + | ~~~ | ||
| + | |||
| + | Supression | ||
| + | ~~~bash | ||
| + | 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 | ||
| + | |||
| + | ~~~bash | ||
| + | brctl show | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## tunctl (deprecated). | ||
| + | |||
| + | tunctl (deprecated). Use `ip tuntap` and `ip link` instead | ||
| + | |||
| + | |||
| + | ## SystemD | ||
| + | |||
| + | Voir : https:// | ||
| + | |||
| + | |||
| + | ## nmcli | ||
| + | |||
| + | ~~~bash | ||
| + | nmcli connection add type bridge autoconnect yes con-name br0 ifname br0 | ||
| + | nmcli con show | ||
| + | nmcli -f bridge con show br0 | ||
| + | ~~~ | ||
| + | |||
| + | Disable STP | ||
| + | ~~~bash | ||
| + | sudo nmcli con modify br0 bridge.stp no | ||
| + | ~~~ | ||
| + | |||
| + | Afficher la conf | ||
| + | ~~~bash | ||
| + | nmcli con show | ||
| + | nmcli -f bridge con show br0 | ||
| + | ~~~ | ||
| + | |||
| + | Pour ajouter, ou pour mettre une interface en esclavage | ||
| + | ~~~bash | ||
| + | nmcli con add type bridge-slave ifname team0 master br0 | ||
| + | ~~~ | ||
| + | |||
| + | ça va créer un fichier | ||
| + | |||
| + | `/ | ||
| + | ~~~ini | ||
| + | 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 | ||
| + | |||
| + | `/ | ||
| + | ~~~ini | ||
| + | TYPE=Ethernet | ||
| + | NAME=bridge-slave-team0 | ||
| + | UUID=93645ead-7177-4794-88f3-0a43c95bf179 | ||
| + | DEVICE=team0 | ||
| + | ONBOOT=yes | ||
| + | BRIDGE=br0 | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## RedHat | ||
| + | |||
| + | ~~~ | ||
| + | Edit / | ||
| + | comment out BOOTPROTO | ||
| + | Add BRIDGE=br0 | ||
| + | Create / | ||
| + | The content should be: | ||
| + | |||
| + | DEVICE=br0 | ||
| + | BOOTPROTO=dhcp | ||
| + | ONBOOT=yes | ||
| + | TYPE=Bridge | ||
| + | ~~~ | ||
| + | Source : https:// | ||
| + | |||
| + | |||
| + | ## Debian | ||
| + | |||
| + | ~~~ | ||
| + | / | ||
| + | |||
| + | # Replace old eth0 config with br0 | ||
| + | auto eth0 br0 | ||
| + | |||
| + | # Use old eth0 config for br0, plus bridge stuff | ||
| + | iface br0 inet dhcp | ||
| + | bridge_ports | ||
| + | bridge_stp | ||
| + | bridge_maxwait | ||
| + | bridge_fd | ||
| + | ~~~ | ||
| + | |||
| + | Source : https:// | ||
| + | |||
| + | |||
| + | |||
| + | ## Macvlan | ||
| + | |||
| + | Voir : | ||
| + | * https:// | ||
| + | |||
| + | |||
| + | ## MacVTap | ||
| + | |||
| + | Voir : | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * http:// | ||
| + | * https:// | ||
| + | |||
| + | |||
