You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that if you set up a device interface VLAN with an IP that doesn't have a broadcast set that it will throw an error when you remove the RJ45 node or when you stop the session.
The error I receive is:
Traceback (most recent call last):
File "/home/<user>/Documents/afsim/core/daemon/core/utils.py", line 543, in threadpool
result = future.result()
File "/usr/lib/python3.9/concurrent/futures/_base.py", line 439, in result
return self.__get_result()
File "/usr/lib/python3.9/concurrent/futures/_base.py", line 391, in __get_result
raise self._exception
File "/usr/lib/python3.9/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/<user>/Documents/afsim/core/daemon/core/nodes/physical.py", line 86, in shutdown
self.restore_state()
File "/home/<user>/Documents/afsim/core/daemon/core/nodes/physical.py", line 191, in restore_state
for addr in self.old_addrs:
File "/home/<user>/Documents/afsim/core/daemon/core/nodes/netclient.py", line 174, in create_address
self.run(f"{IP} address add {address} broadcast {broadcast} dev {device}")
File "/home/<user>/Documents/afsim/core/daemon/core/nodes/base.py", line 221, in host_cmd
return utils.cmd(args, env, cwd, wait, shell)
File "/home/<user>/Documents/afsim/core/daemon/core/utils.py", line 243, in cmd
raise CoreCommandError(status, input_args, stdout, stderr)
core.errors.CoreCommandError: command(ip address add 9.9.9.1/24 broadcast global dev enp0s3.999), status(1):
stdout:
stderr: Error: inet address is expected rather than "global".
The steps I took to get this is to run:
sudo ip link add link <interface_name> name <interface_name>.999 type vlan id 999
sudo ip addr add 9.9.9.1/24 dev <interface_name>.999
sudo ip link set up <interface_name>.999
Then run the core daemon and bring up the core-gui. Create an rj45 node (selecting the new vlan) and an mdr, link them together then run the simulation. Stop it and then I get the error.
I found if you instead run: sudo ip addr add 9.9.9.1/24 broadcast 255.255.255.255 dev <interface_name>.999
to add the ip then this error doesn't happen.
I think it may be an issue with how ip info is saved in core/daemon/core/nodes/physical.py. I added a print of (items) right after line 166 in save_state and got the following output (the third line is of most importance):
When it loops over each line and finds the inet line, it saves items[1] and items[3] which is the ip then the word "global".
When the code goes to restore_state the values that were appended to self.old_addrs previously are not two ips like expected. It attempts to create an address using the saved ip but also the word "global" as the broadcast ip which causes the error above.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I noticed that if you set up a device interface VLAN with an IP that doesn't have a broadcast set that it will throw an error when you remove the RJ45 node or when you stop the session.
The error I receive is:
The steps I took to get this is to run:
Then run the core daemon and bring up the core-gui. Create an rj45 node (selecting the new vlan) and an mdr, link them together then run the simulation. Stop it and then I get the error.
I found if you instead run:
sudo ip addr add 9.9.9.1/24 broadcast 255.255.255.255 dev <interface_name>.999
to add the ip then this error doesn't happen.
I think it may be an issue with how ip info is saved in core/daemon/core/nodes/physical.py. I added a print of (items) right after line 166 in
save_state
and got the following output (the third line is of most importance):When it loops over each line and finds the inet line, it saves items[1] and items[3] which is the ip then the word "global".
When the code goes to
restore_state
the values that were appended toself.old_addrs
previously are not two ips like expected. It attempts to create an address using the saved ip but also the word "global" as the broadcast ip which causes the error above.Beta Was this translation helpful? Give feedback.
All reactions