networkop / docker-topo

Docker topology builder for network simulations
BSD 3-Clause "New" or "Revised" License
139 stars 41 forks source link

Version 2 requires sudo and credentials. #42

Closed rogerscuall closed 3 years ago

rogerscuall commented 4 years ago

I have followed the steps on this repo and when I try to create a topology I get this:

❯ docker-topo --create 3-node.yml
INFO:__main__:Version 2 requires sudo. Restarting script with sudo
sudo: setrlimit(RLIMIT_STACK): Invalid argument
Password:
Sorry, try again

Prompting me for a password that I don't know. I have looked but I don't find it in any place. I changed the yml file to use version 1 and then I still get the prompt for credentials but the devices at least run, although the links between then are missing. This is the configuration file for version 2:

links:
  - endpoints: ["cEOS-1:eth0", "cEOS-2:eth0", "cEOS-3:eth0"]
    driver: bridge
  - endpoints: ["cEOS-1:eth1", "cEOS-2:eth2"]
  - endpoints: ["cEOS-1:eth2", "cEOS-3:eth1"]
  - endpoints: ["cEOS-2:eth1", "cEOS-3:eth2"]

VERSION: 2
driver: veth
PREFIX: 3-node
CONF_DIR: ./config
CEOS_IMAGE: ceosimage1:latest
PUBLISH_BASE: 9000

For version 1 is the same file changing the line VERSION: 1 Thanks.

hansbogert commented 4 years ago

How do you normally run a privileged command on your computer?

networkop commented 4 years ago

@rogerscuall it's asking you for a sudo password, normally you should be able to use the same password you use to login. If it doesn't work, you need'd to ask your administrator to give you sudo access.

rogerscuall commented 4 years ago

Wow, 😲 I cannot believe this happened, I tried my sudo credentials multiple times, and it did not work, so I assumed it was the credentials of the image itself, but I just tried again, and it did work. Thanks, @hansbogert and @networkop, for the quick response. Thanks.

rogerscuall commented 4 years ago

Hi @networkop / @hansbogert , I'm very new to arista, but I have done other vendors; I believe I have configured the minimal to ping between two directly connected interfaces, but unfortunately, I cannot ping. All packets are getting lost. The configuration is just an IP on both sides. It looks that the interfaces are up. Is this expected on MAC OS X using the driver bridge?

networkop commented 4 years ago

can you see those interfaces as lldp neighbors of each other?

hansbogert commented 4 years ago

To take the OS out of the equation I'm willing to test it on my linux-machine, can you post your configs, possibly be using the archive functionality of the docker-topo command ? (use the -a flag)

rogerscuall commented 4 years ago

I'm not sure what happened, but this morning I'm getting a completely different error. I did not change the virtualenv and is consistently happening on all the configurations I tried, the error is related to:

  File "/SOME_PATH/arista/docker-topo/testdir/lib/python3.8/site-packages/urllib3/response.py", line 696, in _update_chunk_length
    self.chunk_left = int(line, 16)
ValueError: invalid literal for int() with base 16: b''

More info on this link: https://hastebin.com/jatisilawu.sql I'm not able to do docker-topo --create anymore. I even cloned this repo on another folder and created a new virtualenv, and still the same issue. @networkop , LLDP was not working before this issue. @hansbogert , I won't be able to do the archive option because of the issue I mentioned, but I did save the configuration yesterday. 3-node.zip Thanks.

networkop commented 4 years ago

@rogerscuall there's a few issues you can check:

  1. your topology file creates all links as bridged. i believe this has the limitation of not honoring the interface names you define in the yaml file -- more specifically, link names are always allocated sequentically when using bridge. So eth0, eth1, eth2... there's no way to specify an arbitrary link name with docker.
  2. based on the above, try converting it back to how the file looked before -- with veth being the default driver and bridge only used to connect eth0 interfaces
  3. Every time you rebuilt a topology, make sure you --destroy the previous one first, before creating a new one. old leftover docker containers may prevent you from spinning up a new topology.
rogerscuall commented 4 years ago

I decided to move to Linux because I cannot get around the issues I have on MAC OS X. Right now, in Ubuntu, everything looks good, I have been using the example 3-node.yml:

links:
  - endpoints: ["cEOS-1:eth0", "cEOS-2:eth0", "cEOS-3:eth0"]
    driver: bridge
  - endpoints: ["cEOS-1:eth1", "cEOS-2:eth2"]
  - endpoints: ["cEOS-1:eth2", "cEOS-3:eth1"]
  - endpoints: ["cEOS-2:eth1", "cEOS-3:eth2"]

VERSION: 2
driver: veth
PREFIX: 3-node
CONF_DIR: ./config
CEOS_IMAGE: ceosimage:latest
PUBLISH_BASE: 9000

The interface Eth0 is not showing up, not sure if Arista has Eth0, or if that matter at all, but I moved it to Eth3, and nothing either. The show interface status does not show Eth0/Eth3, not sure if it is because the driver is "bridge."

networkop commented 3 years ago

eth0 becomes the management interface, so this is expected. that's how cEOS works