반응형
https://wiki.debian.org/BridgeNetworkConnections#Introduction
Configuring bridging in /etc/network/interfaces
To make your bridge a little more permanent, you’re gonna need to edit /etc/network/interfaces. Using our example names, make it look like this and you’re set (if you want to use DHCP):
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo br0 iface lo inet loopback # Set up interfaces manually, avoiding conflicts with, e.g., network manager iface eth0 inet manual iface eth1 inet manual # Bridge setup iface br0 inet dhcp bridge_ports eth0 eth1
To bring up your bridge, you just have to issue # ifup br0 and it’ll bring up the other necessary interfaces without anything in your interfaces file about the bridged interfaces.
If you like static IP’s, then you can just add the static IP options under the br0 interface setup. Kinda like this:
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo br0 iface lo inet loopback # Set up interfaces manually, avoiding conflicts with, e.g., network manager iface eth0 inet manual iface eth1 inet manual # Bridge setup iface br0 inet static bridge_ports eth0 eth1 address 192.168.1.2 broadcast 192.168.1.255 netmask 255.255.255.0 gateway 192.168.1.1