diff --git a/src/primaite/simulator/network/creation.py b/src/primaite/simulator/network/creation.py index 5e0d0ce8..009ac861 100644 --- a/src/primaite/simulator/network/creation.py +++ b/src/primaite/simulator/network/creation.py @@ -167,7 +167,6 @@ class OfficeLANAdder(NetworkNodeAdder, identifier="office_lan"): # Optionally include a router in the LAN if config.include_router: default_gateway = IPv4Address(f"192.168.{config.subnet_base}.1") - # router = Router(hostname=f"router_{config.lan_name}", start_up_duration=0) router = Router.from_config( config={"hostname": f"router_{config.lan_name}", "type": "router", "start_up_duration": 0} ) @@ -230,7 +229,7 @@ class OfficeLANAdder(NetworkNodeAdder, identifier="office_lan"): "type": "computer", "hostname": f"pc_{i}_{config.lan_name}", "ip_address": f"192.168.{config.subnet_base}.{i+config.pcs_ip_block_start-1}", - "default_gateway": "192.168.10.1", + "default_gateway": default_gateway, "start_up_duration": 0, } pc = Computer.from_config(config=pc_cfg) diff --git a/src/primaite/simulator/network/hardware/base.py b/src/primaite/simulator/network/hardware/base.py index 36623a6f..29d46164 100644 --- a/src/primaite/simulator/network/hardware/base.py +++ b/src/primaite/simulator/network/hardware/base.py @@ -2242,10 +2242,6 @@ class Node(SimComponent, ABC): for app_id in self.applications: self.applications[app_id].close() - # Turn off all processes in the node - # for process_id in self.processes: - # self.processes[process_id] - def _start_up_actions(self): """Actions to perform when the node is starting up.""" # Turn on all the services in the node @@ -2258,10 +2254,6 @@ class Node(SimComponent, ABC): print(f"Starting application:{self.applications[app_id].config.type}") self.applications[app_id].run() - # Turn off all processes in the node - # for process_id in self.processes: - # self.processes[process_id] - def _install_system_software(self) -> None: """Preinstall required software.""" for _, software_class in self.SYSTEM_SOFTWARE.items(): diff --git a/src/primaite/simulator/network/hardware/nodes/network/switch.py b/src/primaite/simulator/network/hardware/nodes/network/switch.py index 54e1d7ef..8a9fdb24 100644 --- a/src/primaite/simulator/network/hardware/nodes/network/switch.py +++ b/src/primaite/simulator/network/hardware/nodes/network/switch.py @@ -109,7 +109,7 @@ class Switch(NetworkNode, identifier="switch"): def __init__(self, **kwargs): super().__init__(**kwargs) - for i in range(1, kwargs["config"].num_ports + 1): + for i in range(1, self.config.num_ports + 1): self.connect_nic(SwitchPort()) def _install_system_software(self):