core-admin/qubes/vm/netvm.py
Wojtek Porczyk 80d664441d core3: fixes from Marek
This is adapted from commit 90a50dca406e3d40c88ea338566e0460589df7a3.
2015-10-05 12:46:13 +02:00

35 lines
770 B
Python

#!/usr/bin/python2 -O
# vim: fileencoding=utf-8
import qubes.vm.qubesvm
class NetVM(qubes.vm.appvm.AppVM):
'''Network interface VM'''
netvm = qubes.property('netvm', setter=qubes.property.forbidden)
def __init__(self, *args, **kwargs):
super(NetVM, self).__init__(*args, **kwargs)
def get_ip_for_vm(self, vm):
return '10.137.{}.{}'.format(self.qid, vm.qid + 2)
@property
def gateway(self):
return '10.137.{}.1'.format(self.qid)
@property
def secondary_dns(self):
return '10.137.{}.254'.format(self.qid)
# @property
# def netmask(self):
# return '255.255.255.0'
#
# @property
# def provides_network(self):
# return True
netmask = '255.255.255.0'
provides_network = True