commit 4dffef2ff492c35c053651a044fbc29f9bb8216d
parent 65c56e33c8b045df3aaebba0ce6650efefdfc9a5
Author: Stefan Koch <programming@stefan-koch.name>
Date: Tue, 26 Jan 2021 22:33:18 +0100
remove setup of bridge, expect it to exist
Diffstat:
3 files changed, 5 insertions(+), 44 deletions(-)
diff --git a/README.md b/README.md
@@ -91,17 +91,9 @@ qemu-system-x86_64 -cpu host -accel kvm -m 4096 -hda $BASE_IMAGE -cdrom $ISO
The qcow2 is your base image. It must be located inside the
`$BASE_IMAGE_FOLDER` directory. This is a configurable environment variable.
-To start the server you have to define your host's IP address and gateway. This
-is needed, because aetherscale re-maps the IP configuration from your
-physical interface to the newly created bridge device.
-
-For example, if your PC has the IP address `192.168.2.123` in a `/24` subnet,
-the gateway is `192.168.2.1` and your ethernet device is `enp0s25`.
-
-```bash
-NETWORK_IP=192.168.2.123/24 NETWORK_GATEWAY=192.168.2.1 \
- NETWORK_PHYSICAL_DEVICE=enp0s25 aetherscale
-```
+aetherscale expects a bridge network on the physical ethernet which can be
+used to attach additional TAP interfaces for VMs. If this interface does not
+exist, an error will be displayed on startup of the server.
Once the server is running, you can start a VM with:
diff --git a/aetherscale/computing.py b/aetherscale/computing.py
@@ -10,7 +10,6 @@ import string
import subprocess
import sys
import tempfile
-import time
from typing import List, Optional, Dict, Any, Callable, Tuple, Iterator
from . import networking
@@ -22,9 +21,6 @@ from .vpn.tinc import TincVirtualNetwork
import aetherscale.vpn.radvd
-VDE_FOLDER = '/tmp/vde.ctl'
-VDE_TAP_INTERFACE = 'tap-vde'
-
EXCHANGE_NAME = 'computing'
COMPETING_QUEUE = 'computing-competing'
QUEUE_COMMANDS_MAP = {
@@ -538,34 +534,11 @@ def run():
channel.basic_consume(
queue=COMPETING_QUEUE, on_message_callback=bound_callback)
- # a TAP interface for VDE must already have been created
- vde_tap_iproute = networking.Iproute2Network()
-
- # TODO: VDE is not used anymore, we only need the br0 interface
- if not networking.Iproute2Network.check_device_existence(VDE_TAP_INTERFACE):
- vde_tap_iproute.bridged_network(
- 'br0', config.NETWORK_PHYSICAL_DEVICE,
- config.NETWORK_IP, config.NETWORK_GATEWAY,
- flush_ip_device=True)
- vde_tap_iproute.tap_device(VDE_TAP_INTERFACE, config.USER, 'br0')
-
- if not vde_tap_iproute.setup():
- print('Could not setup VDE tap device', file=sys.stderr)
- sys.exit(1)
-
- logging.info('Bringing up VDE networking')
- service_manager.install_service(
- Path('data/systemd/aetherscale-vde.service'),
- 'aetherscale-vde.service')
- service_manager.start_service('aetherscale-vde.service')
- # Give systemd a bit time to start VDE
- time.sleep(0.5)
- if not service_manager.service_is_running('aetherscale-vde.service'):
- logging.error('Failed to start VDE networking.')
+ if not networking.Iproute2Network.check_device_existence('br0'):
+ print('aetherscale expects a device br0 to exist', file=sys.stderr)
sys.exit(1)
try:
channel.start_consuming()
except KeyboardInterrupt:
print('Keyboard interrupt, stopping service')
- vde_tap_iproute.teardown()
diff --git a/aetherscale/config.py b/aetherscale/config.py
@@ -17,10 +17,6 @@ USER_IMAGE_FOLDER = Path(os.getenv('USER_IMAGE_FOLDER', default='user_images'))
AETHERSCALE_CONFIG_DIR = Path.home() / '.config/aetherscale'
(AETHERSCALE_CONFIG_DIR / 'networking').mkdir(parents=True, exist_ok=True)
-NETWORK_IP = os.getenv('NETWORK_IP', default='192.168.0.1/24')
-NETWORK_GATEWAY = os.getenv('NETWORK_GATEWAY', default='192.168.0.1')
-NETWORK_PHYSICAL_DEVICE = os.getenv('NETWORK_PHYSICAL_DEVICE', default='eth0')
-
VPN_CONFIG_FOLDER = AETHERSCALE_CONFIG_DIR / 'tinc'
VPN_NUM_PREPARED_INTERFACES = 2
VPN_48_PREFIX = 'fde7:2361:234a'