sandia-minimega / minimega

minimega
GNU General Public License v3.0
148 stars 66 forks source link

bug: virtual interfaces in containers in ns bridges don't create or delete properly #1387

Open mkunz7 opened 4 years ago

mkunz7 commented 4 years ago

Describe your environment

  1. minimega version latest
  2. Linux distro/version ubuntu 18.04.3 desktop
  3. Go compiler version 1.12.13
  4. VM types containers

Describe the bug Containers are not created or deleted properly in ns bridges

To Reproduce start minimega on three nodes

ns add-hosts all
ns bridge test
vm config filesystem /root/uminirouterfs/
vm config fifo 1
vm config net test,foo
vm config init /init
vm config preinit /root/uminirouterfs/preinit
vm launch container uminirouter
vm start uminirouter
router uminirouter interface 0 1.0.0.1/24
router uminirouter dhcp 1.0.0.1 range 1.0.0.2 1.0.0.254
router uminirouter commit
vm kill all
vm flush
nuke
nuke
nuke

start minimega back up on just node1 and boot a uminirouter without a bridge

vm config filesystem /root/uminirouterfs/
vm config fifo 1
vm config net test2
vm config init /init
vm config preinit /root/uminirouterfs/preinit
vm launch container uminirouter
vm start uminirouter
router uminirouter interface 0 1.0.0.1/24
router uminirouter dhcp 1.0.0.1 range 1.0.0.2 1.0.0.254
router uminirouter commit

Hop on the container interface and you will see gretap0 in ifconfig -a, even though we are not using a gre tunnel.

router will throw this error

/ # cat  minirouter.log
2019/11/26 00:28:18 ERROR ip.go:104: exit status 2: RTNETLINK answers: Cannot assign requested address

Expected behavior Container interfaces should function in ns bridges