vnet is a simple tool to create bridge(s)/ virtual network device(s) on a linux machine. It is inspired by lxc-net source code that creates lxcbr0 bridge for LXC containers. It is fully written in bash which uses linux network modules available on the host machine. It is independent of other services (e.g. host only adapter or vboxnet which is part of VirtualBox and will be removed if VirtualBox is uninstalled, a scenario when user decides to move from VirtualBox to for example, VMware/KVM.) It supports containers, virtual machines (with the use of TAP adapter for VirtualBox/VMware virtual machines).
The virtual bridge currently supports two types of network traffic:
- Bridged mode, where devices connected on the bridged will be forwarded the networks foreign to the bridge.
- Isolated mode, where devices connected on the bridge will not be isolated within the bridge itself, with the execption of DNS resolution which will however be allowed to be resolved by the gateway of the bridge.
The vnet toolkit will be running in two modes, and the mode of operation is dependant on the executing conditions:
- Package mode, if the vnet toolkit cloned from a remote repo or extracted from a zip file downloaded/received from trustworthy source. The package mode can only be used to setup vnet on the host machine.
- Tool mode, if vnet tool has been installed onto the host machine, and the location where the tool is executed is the same as where it was defined during the installation process. Therefore, when moving/reimaging devices, the user will need just the vnet toolkit and the exported/backup profiles and restore the backup profiles on the new machine after installation of the tool.
- Allow multiple virtual network profiles.
- Uses dnsmasq as a DHCP server, DNS resolver/server.
- Allows Profile(s) to be started automatically on startup (persistent) or by demand.
- Persistent profile are automatically setup by systemd daemon on boot.
- Interactive profile management (new/edit/rename/delete).
- Profiles can be exported/imported for safe keeping or restoration/application on another device.
- Simple unicast MAC generator.
- TAP adapter module which is by default disabled and can be edited by running edit command to support virtual devices that couldn't see virtual bridges.
- Lightweight, customisable as they are all writen in bash.
- Supports multiple vnet profiles for individual needs.
- Easy to deploy, hopefully =).
- Clone this repo from github or extract the vnet package.
- Navigate into
vnetfolder. - Execute
./vnet install. - Follow the instructions as prompted on the installation screen.
They are all outlined here
- LXC developers, for giving me the idea to write these scripts.