Ubuntu: Bridge

From OnnoWiki
Jump to navigation Jump to search

Install

apt install bridge-utils 


Konfigurasi

/etc/network/interfaces
# The local network bridge
auto br0
iface br0 inet static
  bridge_ports enp3s0 tun0
  address 192.168.0.10
  netmask 255.255.255.0


iproute2

Create

# ip link add name bridge_name type bridge
# ip link set bridge_name up
# ip link set eth0 up
# ip link set eth0 master bridge_name

Utility

# bridge link
# ip link set eth0 nomaster
# ip link set eth0 down
# ip link delete bridge_name type bridge


bridge-utils

# brctl addbr bridge_name
# brctl addif bridge_name eth0

Hati2 IP di eth0 akan hilang

$ brctl show
# ip link set dev bridge_name up
# ip link set dev bridge_name down
# brctl delbr bridge_name

Note: To enable the bridge-netfilter functionality, you need to manually load the br_netfilter module:

# modprobe br_netfilter