|
|
|
|
@ -62,6 +62,7 @@ def check_profiles(scenario):
|
|
|
|
|
verified = {} |
|
|
|
|
for owner in public + [node for node in NODES if node.nat]: |
|
|
|
|
observer = second if owner.name == first.name else first |
|
|
|
|
agents[owner.name].rpc("nat_auto", enabled=1) |
|
|
|
|
if not scenario.args.tcp_only: |
|
|
|
|
contacts = set(profile(agents[owner.name].rpc("stats"), "udp")["contacts"]) |
|
|
|
|
helper = next((node for node in public if node.name not in {owner.name, observer.name} and node.ip not in contacts), None) |
|
|
|
|
@ -103,6 +104,7 @@ def check_profiles(scenario):
|
|
|
|
|
print(f"NAT {owner.name}/{protocol}: {actual['mapping']} / {actual['inbound']}" |
|
|
|
|
f" external={actual['external'] or '-'} reason={actual['reason']}", flush=True) |
|
|
|
|
verified[owner.name] = observed |
|
|
|
|
agents[owner.name].rpc("nat_auto", enabled=0) |
|
|
|
|
(scenario.network.directory / "nat-profiles.json").write_text(json.dumps(verified, indent=2) + "\n") |
|
|
|
|
|
|
|
|
|
# Повтор на использовавшемся порту сохраняет mapping, но не обновляет OPEN |
|
|
|
|
|