uncloud-mravi/uncloud/hack/net.py
2020-01-15 13:26:05 +01:00

25 lines
720 B
Python

import subprocess
class VXLANBridge(object):
def __init__(self, bridgedev=None, uplinkdev=None):
self.management_vni = 1
cmd_create_vxlan = "ip -6 link add {vxlandev} type vxlan id {netid} dstport 4789 group ff05::{netid} dev {uplinkdev} ttl 5"
cmd_up_dev = "ip link set {dev} up"
cmd_create_bridge="ip link add {bridgedev} type bridge"
cmd_add_to_bridge="ip link set {vxlandev} master {bridgedev} up"
cmd_add_addr="ip addr add {ip} dev {bridgedev}"
def setup_networking(dev=wlan0, v6net):
ip=2a0a:e5c1:111:888::48/64
vxlandev=vxlan${netid}
bridgedev=br${netid}
class DNSRA(object):
def __init__(self):
pass
class Firewall(object):
pass