uncloud-mravi/uncloud/hack/net.py

28 lines
736 B
Python
Raw Normal View History

2020-01-15 11:40:37 +00:00
import subprocess
2020-01-19 08:16:29 +00:00
class ManagementBridge(VXLANBridge):
pass
2020-01-15 11:40:37 +00:00
class VXLANBridge(object):
2020-01-19 08:16:29 +00:00
def __init__(self, vni, bridgedev=None, uplinkdev=None):
2020-01-15 11:40:37 +00:00
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):
vxlandev=vxlan${netid}
bridgedev=br${netid}
class DNSRA(object):
def __init__(self):
pass
2020-01-15 12:26:05 +00:00
class Firewall(object):
pass