====== FreeBSD - Bridge ====== siehe: [[http://www.naturalborncoder.com/virtualization/2014/10/17/understanding-tun-tap-interfaces/|Understanding TUN TAP Interfaces]] Nur TAP (OSI/ISO-Layer 2) kann in einer Bridge verwendet werden, nicht TUN (OSI/ISO-Layer 3)! ===== CLI ===== [[https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-bridging.html]] Brücke anlegen: > ifconfig bridge create bridge0 > ifconfig bridge0 bridge0: flags=8802 metric 0 mtu 1500 ether 96:3d:4b:f1:79:7a id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15 maxage 20 holdcnt 6 proto rstp maxaddr 100 timeout 1200 root id 00:00:00:00:00:00 priority 0 ifcost 0 port 0 2 NICs an die Brücke anhängen, die vom Host und die vom Gast: > ifconfig bridge0 addm em0 addm fxp0 up jetzt sollte der an die "Brücke" angehängte Netzwerkadapter zu sehen sein: **''member: em0''** und **''member: tap0''**: > ifconfig bridge0 bridge0: flags=8843 metric 0 mtu 1500 ether 58:9c:fc:10:ff:ba id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15 maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200 root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0 member: em0 flags=143 ifmaxaddr 0 port 1 priority 128 path cost 20000 member: tap0 flags=143 ifmaxaddr 0 port 4 priority 128 path cost 2000000 groups: bridge nd6 options=9 eine NIC von der Brücke entfernen: > ifconfig bridge0 deletem fxp0 wenn kein NIC mehr an die Brücke gebunden ist, dann kann man sie auch wieder entfernen: > ifconfig bridge1 destroy ===== Konfigurationsdatei ===== ''/etc/rc.conf'': ... ifconfig_tap0="192.168.1.213/24" ifconfig_tap1="192.168.1.214/24" autobridge_interfaces="bridge0" # List of bridges to check #autobridge_bridge0="tap* vlan0" # Interface glob to automatically add to the bridge autobridge_bridge0="tap*" # Interface glob to automatically add to the bridge ...