Bridge

To set up a bridge named br0 (part 1)

  • apt install bridge-utils
  1. brctl addbr br0
  2. brctl addif eth0 br0
  3. brctl addif eth1 br0

 

To set up a bridge named br0 (part 2)

  1. ip link add br0 type bridge
  2. ip link set eth0 master br0′
  3. ip link set eth1 master br0

 

To set up a bridge without bridging and name (part 3)

  1. tc qdisc add dev eth0 ingress
  2. tc qdisc add dev eth1 ingress
  3. tc filter add dev eth0 parent ffff: protocol all u32 match u32 0 0 action mirred egress mirror dev eth1
  4. tc filter add dev eth1 parent ffff: protocol all u32 match u32 0 0 action mirred egress mirror dev eth0