Set gateway mode automatically #18
|
@ -11,6 +11,10 @@ confdir = /usr/share/naxalnet/networkd
|
||||||
# See man:systemd.network(5)
|
# See man:systemd.network(5)
|
||||||
runtimedir = /run/systemd/network
|
runtimedir = /run/systemd/network
|
||||||
|
|
||||||
|
[device]
|
||||||
|
batman=bat0
|
||||||
|
bridge=bridge0
|
||||||
|
|
||||||
[adhoc]
|
[adhoc]
|
||||||
# All your nodes should have the same name
|
# All your nodes should have the same name
|
||||||
name = NxMesh
|
name = NxMesh
|
||||||
|
@ -20,4 +24,3 @@ name = NxMesh
|
||||||
ssid = MeshWiFi
|
ssid = MeshWiFi
|
||||||
# Note the spelling. It's passwd, not password.
|
# Note the spelling. It's passwd, not password.
|
||||||
passwd = naxalnet256
|
passwd = naxalnet256
|
||||||
|
|
||||||
|
|
|
@ -35,4 +35,4 @@ See README.md for documentation.
|
||||||
#
|
#
|
||||||
# In case you forgot to change the version, skip the number
|
# In case you forgot to change the version, skip the number
|
||||||
# and put the next number in the next commit.
|
# and put the next number in the next commit.
|
||||||
__version__ = "0.4.0a5"
|
__version__ = "0.4.0a5.dev1"
|
||||||
|
|
|
@ -158,6 +158,18 @@ def parse_args() -> Namespace:
|
||||||
help="send log messages to systemd journal",
|
help="send log messages to systemd journal",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
parser.add_argument(
|
||||||
|
"--batman-device",
|
||||||
|
default=config["device"]["batman"],
|
||||||
|
help="name of interface used by batman-adv",
|
||||||
|
)
|
||||||
|
|
||||||
|
parser.add_argument(
|
||||||
|
"--bridge-device",
|
||||||
|
default=config["device"]["bridge"],
|
||||||
|
help="name of bridge interface",
|
||||||
|
)
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--version",
|
"--version",
|
||||||
"-V",
|
"-V",
|
||||||
|
|
|
@ -31,6 +31,7 @@ CONFIG = {
|
||||||
"confdir": "/usr/share/naxalnet/networkd",
|
"confdir": "/usr/share/naxalnet/networkd",
|
||||||
"runtimedir": "/run/systemd/network",
|
"runtimedir": "/run/systemd/network",
|
||||||
},
|
},
|
||||||
|
"device": {"batman": "bat0", "bridge": "bridge0"},
|
||||||
"adhoc": {"name": "NxMesh"},
|
"adhoc": {"name": "NxMesh"},
|
||||||
"ap": {"ssid": "MeshWiFi", "passwd": "naxalnet256"},
|
"ap": {"ssid": "MeshWiFi", "passwd": "naxalnet256"},
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,8 +64,7 @@ def setup_mesh():
|
||||||
dest.mkdir(parents=True, exist_ok=True)
|
dest.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
networkd = NetworkD(runtime_dir=args.networkd_runtime_dir)
|
networkd = NetworkD(runtime_dir=args.networkd_runtime_dir)
|
||||||
# TODO: replace with valus from args
|
networkd.set_vars(batdev=args.batman_device, bridgedev=args.bridge_device)
|
||||||
networkd.set_vars(batdev="bat0", bridgedev="bridge0")
|
|
||||||
for i in get_sorted_glob(args.networkd_config_dir, MESH_GLOB):
|
for i in get_sorted_glob(args.networkd_config_dir, MESH_GLOB):
|
||||||
logger.debug("Adding network config %s", i)
|
logger.debug("Adding network config %s", i)
|
||||||
networkd.add_config(i)
|
networkd.add_config(i)
|
||||||
|
|
Loading…
Reference in New Issue