Skip to main content

Generic Provider

Setting up Bridge

A provider would qualify as a Generic, if they offer vlan based assignments to the server for eg providing you the subnets directly along with your server via vLAN.

You can use the following script to create the bridge:

cd /opt/hypervisor
php artisan hypervisor:bridge start --interface=<PRIMARY_INTERFACE> --bridge=<BRIDGE_NAME>

To undo the bridge you can again use the following command:

cd /opt/hypervisor
php artisan hypervisor:bridge stop --interface=<PRIMARY_INTERFACE> --bridge=<BRIDGE_NAME>
  • BRIDGE_NAME The name of the bridge you want to create.
  • PRIMARY_INTERFACE The name of the primary interface, you can get this by running the ip route | grep default

Further you can go ahead and make a systemd file to create bridge on startup of the node ( only if the above script works ):

[Unit]
Description=Hypervisor Virtual Bridge Service
After=network.target

[Service]
Type=forking
Restart=no
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
ExecStart=/usr/bin/php /opt/hypervisor/artisan hypervisor:bridge start --interface=<PRIMARY_INTERFACE> --bridge=<BRIDGE_NAME>
ExecStop=/usr/bin/php /opt/hypervisor/artisan hypervisor:bridge stop --interface=<PRIMARY_INTERFACE> --bridge=<BRIDGE_NAME>

[Install]
WantedBy=multi-user.target

You can save the above file in /etc/systemd/system/vbridge-<BRIDGE_NAME>.service

Then the following commands can be performed to take it live.

systemctl enable vbridge-<BRIDGE_NAME>
systemctl start vbridge-<BRIDGE_NAME>