freebsd:freebsd_-_bridge
Inhaltsverzeichnis
FreeBSD - Bridge
siehe: 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<BROADCAST,SIMPLEX,MULTICAST> 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<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> 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<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 1 priority 128 path cost 20000
member: tap0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 4 priority 128 path cost 2000000
groups: bridge
nd6 options=9<PERFORMNUD,IFDISABLED>
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 ...
/home/http/wiki/data/pages/freebsd/freebsd_-_bridge.txt · Zuletzt geändert: von manfred
