Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] host interfaces named eth0/eth1/etc. lose their addresses on session shutdown #500

Closed
siliconja opened this issue Jul 28, 2020 · 2 comments
Assignees
Labels

Comments

@siliconja
Copy link
Member

Describe the bug
If your host machine happens to have interfaces named eth0, eth1, etc., when you stop a CORE session you may lose networking. For me, this happened on a remote system, SSH to run the session (Python script), and it is Ubuntu 18.04 upgraded from past Ubuntu version (so it retained "eth0" versus e.g. "ens33" interface naming.)

To Reproduce
Steps to reproduce the behavior:

  1. use the GUI to draw a node linked to a switch
  2. create an eth0 interface on the host system (just to illustrate this bug, if you don't already have an eth0), and assign it an address; ex: ip link add name eth0_0 type veth peer name eth0; ip addr add 192.168.77.1/24 dev eth0
  3. start the session
  4. stop the session
  5. the address from eth0 will be flushed
  6. imagine if you were SSHed into the machine via eth0 now you are locked out

Expected behavior
Class Veth invokes this:
self.node.node_net_client.device_flush(self.name).

But that ip addr flush dev eth0 command is run on the host, not within the node namespace. So the host's IP addresses on eth0 are flushed instead.

Desktop (please complete the following information):

  • Ubuntu 18.04
  • CORE Version 7.0.0 (also 6.5.0)

Additional context
Using the old core-gui to repro this.

@siliconja siliconja added the bug label Jul 28, 2020
@bharnden
Copy link
Contributor

thanks, determined a path for correction. This would involve leverage a shell to run the command in context of a node for node commands where shell=True.

With this it made me think, in a lot of places we use "sh," which is /bin/sh, which is usually a symlink to a distros shell. This can potentially vary and be different and cause issue.

We should probably standardize on using bash to be safe and update that usage across the boards.

@bharnden bharnden self-assigned this Jul 28, 2020
@bharnden
Copy link
Contributor

fixed in latest release 7.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants