|
|
The network is virtual, your privacy is not... |
Links:Main screen
Activities
Hosted by: |
Example: bridging Ethernet segments using tinc under LinuxNormally, in the default router mode, tinc will only tunnel IPv4 and IPv6 unicast packets. However, since 1.0pre5 there is an option to let the tinc daemon act as a switch or a hub (using the Mode configuration variable). This mode is necessary for tinc to pass non-IP based protocols (NetBEUI, AppleTalk, IPX, etcetera), and to allow broadcast-based functionality in some applications (Windows 'Network Neighborhood' without a WINS server, among others) to be usable on a VPN created with tinc.In switch and hub mode, broadcast packets are broadcast to other daemons and (in switch mode) MAC addresses are dynamically learned from other tinc daemons in order to route packets. With these mode tinc can be used to act as a bridge between two or more Ethernet segments.
OverviewThe network setup is as follows:
Configuration of the kernelIn addition to the standard kernel configuration described in the Configuring the kernel section of the manual, a bridge device needs to be added to your kernel configuration.To add the bridge device to the Linux 2.4.0 and higher kernels, select the option under 'Networking options' called 802.1d Ethernet Bridging. You may either compile this option as a module or build it into the kernel. Configuration of the interfacesSwitch and hub modes require that both sides of a tinc VPN be contained within the same subnet (in this example, the subnet is 192.168.0.0/16). This is no different from the configuration that would be required if tinc was replaced with an actual switch or hub.
Configuration of tincNote that switch' and hub' mode do not utilize the Subnet variable in the host files. Instead, any packet received by the bridge interface will be passed to the TUN/TAP device for processing. If your tinc instance is running in hub mode, all packets are forwarded to the remote tinc instance. In switch mode, tinc maintains an ARP cache to determine whether any received packet should be forwarded to the remote tinc instance.
host# cat /etc/tinc/vpn/tinc.conf Name = segment1 Device = /dev/tun Mode = switch ConnectTo = segment2 host# cat /etc/tinc/vpn/tinc-up #!/bin/sh ifconfig vpn 0.0.0.0 brctl addif bridge vpn ifconfig vpn up host# ls /etc/tinc/vpn/hosts segment1 segment2 ... host# cat /etc/tinc/vpn/hosts/segment1 Address = 123.234.123.42 -----BEGIN RSA PUBLIC KEY----- ... -----END RSA PUBLIC KEY----- host# cat /etc/tinc/vpn/hosts/segment2 Address = 200.201.202.203 -----BEGIN RSA PUBLIC KEY----- ... -----END RSA PUBLIC KEY----- Additional ConfigurationIf the Ethernet interface added to the bridge was used for the default route, you will need to re-add the default route.If you want to be able to filter packets on your bridge interface, you will need to patch your kernel to support this functionality. The link to this patch is located in the section below. More informationFor more information on Linux bridging, see the bridge-utils homepage, or consult the Linux bridging mailing list.In order to filter packets on the bridge interface, you probably need the bridge-netfilter patches.
$Id: bridging.html 292 2007-07-24 17:03:55Z guus $ |