Posted on November 23, 2020 10:47 pm
 |  Asked by Roman Dodin
 |  50 views
Tags:
0
0
Print Friendly, PDF & Email

Hello,
I create a ceos image with the following command

docker create –name=ceostest –privileged -e INTFTYPE=eth -e ETBA=4 -e SKIP_ZEROTOUCH_BARRIER_IN_SYSDBINIT=1 -e CEOS=1 -e EOS_PLATFORM=ceoslab -e container=docker -i -t ceos /sbin/init systemd.setenv=INTFTYPE=eth systemd.setenv=ETBA=4 systemd.setenv=SKIP_ZEROTOUCH_BARRIER_IN_SYSDBINIT=1 systemd.setenv=CEOS=1 systemd.setenv=EOS_PLATFORM=ceoslab systemd.setenv=container=docker systemd.setenv=MAPETH0=1 systemd.setenv=MGMT_INTF=eth0

 

Unfortunately, the Ma0 interface doesn’t come up with interface IP that docker assigned to eth0 interface. Is there a way to start a cEOS container and have network access to its interface via docker network?

0
Posted by Tamas Plugor
Answered on November 23, 2020 11:10 pm

Hi Roman,

That should work for you, you'll also have to connect the docker networks to your container, e.g. docker network connect net144 ceos104 and once you exec in you should be able to see the IP address in bash with ifconfig command (at this point if you have a username password SSH should work too), which then you can assign in the running config to ma0 interface as well.

 

[root@master-node ~]# docker inspect ceos104 | grep -A10 bridge | grep IP
"IPAMConfig": null,
"IPAddress": "172.17.0.2",

localhost#bash ifconfig eth0 | grep inet
inet 172.17.0.2 netmask 255.255.0.0 broadcast 172.17.255.255

ctrl+D

[root@master-node ~]# ssh tamas@172.17.0.2
Password:
localhost>

 

To speed things up in your lab builds I'd recommend using docker topo and build your configs too which you could load into your containers.

Few examples:

https://github.com/networkop/docker-topo

https://github.com/noredistribution/labs/tree/master/ceos-lab-evpn-irb

https://github.com/networkRob/rLab-eos

HTH,

Tamas

 

Post your Answer

You must be logged in to post an answer.