[hack] phase in networking
This commit is contained in:
parent
bd03f95e99
commit
8a451ff4ff
1 changed files with 21 additions and 0 deletions
21
uncloud/hack/net.py
Normal file
21
uncloud/hack/net.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
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
|
Loading…
Reference in a new issue