Virtual Networks
Virtual Networks covers a vast variety of topics.
Contents |
Virtual Private Network
VPN, such as:
Virtual Local Area Network
VLAN
Virtual Ethernet Bridge
In Linux, the brctl command is used for setting up (Virtual) Ethernet Bridges.
Creating TAP/TUN devices
Assuming the Linux kernel is compiled to support TAP/TUN and the appropriate device node has been created in /dev/net, there are several ways to create TAP/TUN devices:
- using tunctl command (from UML utilities)
- using the openvpn command (from OpenVPN)
- using the ip command (from iproute2):
# ip tuntap add mode tap
will add a new tapX device
The new tapX can be added to a Virtual Ethernet Bridge:
# brctl addif brY tapX # ip link set tapX up
VirtualBox and Linux Ethernet Bridges
VirtualBox allows a guest to have multiple network interfaces, any of which can be connected to host Ethernet Bridges. However, probably due to the multi-platform nature of VirtualBox, the bridged interfaces do not appear as normal Linux Ethernet Bridge interfaces, eg. when viewed using:
brctl show
Also, the VirtualBox documentation clearly discusses the bridge mode as "connecting to a special interface alongside the physical interface".
External links
- Why does adding a non-VLANed interface to a bridge break the VLANed interfaces? - the answer is a good coverage of setting up tagged VLANs on Virtual Bridges, from unix.stackexchange.com
- Tun/Tap interface tutorial
- Tap Interfaces and Linux Bridge
- my answer to Reach LXC container from a virtualbox guest on the same host at serverfault.com
- Thinking of using a VPN? Check the privacy policy first at EFA.com.au