Skip to main content

Tips réseaux


Second bridge

cat /etc/network/interfaceautointerface

auto vmbr1
iface vmbr1 inet static
  address 192.168.122.1
  netmask 255.255.255.0
  bridge_ports none
  bridge_stp off
  bridge_fd 0
  post-up echo 1 > /proc/sys/net/ipv4/ip_forward
  post-up   iptables -t nat -A POSTROUTING -s '192.168.122.0/24' -o vmbr0 -j MASQUERADE
  post-down iptables -t nat -D POSTROUTING -s '192.168.122.0/24' -o vmbr0  -j MASQUERADE

 

VPN Wireguard entre deux cluster (via un bridge)

 

cat /etc/network/interface

auto vmbr2
iface vmbr2 inet static
  address 10.24.100.1/24
  netmask 255.255.255.0
  bridge_ports none
  bridge-stp off
  bridge-fd 0
  post-up echo 1 > /proc/sys/net/ipv4/ip_forward
  post-up   iptables -t nat -A POSTROUTING -s '10.24.100.0/24' -o wg0 -j MASQUERADE
  post-down iptables -t nat -D POSTROUTING -s '10.24.100.0/24' -o wg0  -j MASQUERADE