Hello,
I’m new to this forum but I would like to share my experience with VyOS (1.3) running as docker container for lab purpose, as I not find any relevant topic here. I’ve done everything on docker in Debian WSL 2 mode on Windows 10 Enterprise 1909, but I’ve seen same behavior on bare metal Ubuntu 18 LTS.
I’ve begun with building a container from “official” instructions found on Vyos-build’s Github. So I ended with this build command:
docker build --no-cache --pull --compress -f Dockerfile -t vyos:1.3-`date -u +%Y%m%d%H%M%S` --build-arg BUILD_DATE="`date -u --rfc-3339=seconds`" --build-arg VYOS_VERSION=1.3 --build-arg DEBIAN_VERSION=jessie --progress plain ..
Everything run smoothly, and it ended with a fresh docker image of VyOS 1.3 ![]()
Next I succesfully start a container r1 with this image:
docker run -v /lib/modules:/lib/modules --privileged --name r1 -d vyos:1.3-20201030211657
Then I connect to it via:
docker exec -it r1 su vyos
…and get a beautiful VyOS prompt
:
vyos@vyos:/tmp$
Then things went bad with first try to assign address on interface:
vyos@vyos# run show interfaces
Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down
Interface IP Address S/L Description
--------- ---------- --- -----------
eth0 172.17.0.3/16 u/u
lo 127.0.0.1/8 u/u
vyos@vyos#
vyos@vyos#
vyos@vyos# set interfaces ethernet eth0 address 10.1.1.1/24
[edit]
vyos@vyos# commit
[ interfaces ethernet eth0 ]
VyOS had an issue completing a command.
We are sorry that you encountered a problem while using VyOS.
There are a few things you can do to help us (and yourself):
- Make sure you are running the latest stable version of VyOS
the code is available at https://downloads.vyos.io/?dir=release/current
- Contact us using the online help desk
https://support.vyos.io/
- Join our community on slack where our users exchange help and advice
https://vyos.slack.com
When reporting problems, please include as much information as possible:
- do not obfuscate any data (feel free to contact us privately if your
business policy requires it)
- and include all the information presented below
Report Time: 2020-10-30 21:29:14
Image Version: VyOS 1.3dev0-2371-g700d03d2
Release Train: equuleus
Built by: Sentrium S.L.
Built on: 2020-10-30 21:22:20 UTC
Build UUID: eef4f706-7c74-4a4c-a15e-bc2e3ae7d035
Build Commit ID: unknown
Architecture: x86_64
Boot via: installed image
System type: Microsoft Hyper-V guest
Hardware vendor: Unknown
Hardware model: Unknown
Hardware S/N: Unknown
Hardware UUID: Unknown
Traceback (most recent call last):
File "/usr/libexec/vyos/conf_mode/interfaces-ethernet.py", line 94, in <module>
apply(c)
File "/usr/libexec/vyos/conf_mode/interfaces-ethernet.py", line 86, in apply
e.update(ethernet)
File "/usr/lib/python3/dist-packages/vyos/ifconfig/ethernet.py", line 278, in update
super().update(config)
File "/usr/lib/python3/dist-packages/vyos/ifconfig/interface.py", line 1077, in update
self.add_ipv6_eui64_address('fe80::/64')
File "/usr/lib/python3/dist-packages/vyos/ifconfig/interface.py", line 522, in add_ipv6_eui64_address
self.add_addr(f'{eui64}/{prefixlen}')
File "/usr/lib/python3/dist-packages/vyos/ifconfig/interface.py", line 782, in add_addr
self._cmd(f'ip addr add "{addr}" '
File "/usr/lib/python3/dist-packages/vyos/ifconfig/control.py", line 51, in _cmd
return cmd(command, self.debug)
File "/usr/lib/python3/dist-packages/vyos/util.py", line 179, in cmd
raise OSError(code, feedback)
FileNotFoundError: [Errno 2] failed to run command: ip addr add "fe80::42:acff:fe11:3/64" dev "eth0"
returned:
exit code: 2
noteworthy:
cmd 'ip addr add "fe80::42:acff:fe11:3/64" dev "eth0"'
returned (out):
returned (err):
RTNETLINK answers: Permission denied
[[interfaces ethernet eth0]] failed
Commit failed
![]()
I get the point that it try to assign IPv6 address in the process of assigning an IPv4 address… Weird ![]()
So I try to disable IPv6 on VyOS with:
vyos@vyos# set system ipv6 disable
…and got the same issue after restarting the container
(in the mean time I’d put instruction for docker run to bind a persistent volume for /config).
So I came back to initial github’s instructions and find a note about initializing docker in IPv6 mode. I followed instructions, apply and restart docker but this time docker don’t let me start the container:
docker: Error response from daemon: Address already in use.
![]()
I googled it for a while and don’t find any useful tips to correct this issue… It seems dockerd never deallocate an IPv6 (from space defined in daemon.json) an then cannot start new containers on default docker network bridge.
So I try another approach: creating a dedicated network, IPv6 enabled with different subnet than the one defined in daemon.json, and run VyOS container on it:
docker network create --internal --ipv6 --attachable --subnet fe81::/64 net6
docker run -v /lib/modules:/lib/modules --privileged --name r1 --network net6 -d vyos:1.3-20201030211657
Container successfully start
, then I can plug in and try to assign IPs:
C:\>docker exec -it r1 su vyos
vyos@vyos:/tmp$ sh interfaces
Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down
Interface IP Address S/L Description
--------- ---------- --- -----------
eth0 172.20.0.2/16 u/u
fe81::2/64
lo 127.0.0.1/8 u/u
::1/128
vyos@vyos# set interfaces ethernet eth0 address 1.1.1.1/24
[edit]
vyos@vyos# commit
[edit]
vyos@vyos# run show interfaces
Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down
Interface IP Address S/L Description
--------- ---------- --- -----------
eth0 1.1.1.1/24 u/u
lo 127.0.0.1/8 u/u
::1/128
[edit]
vyos@vyos#
ET VOILA !
![]()
I hope you enjoyed it and also that this topic may help ones that may fall into this issue
!
Cheers
!
PS: I’ve found a Vyos bug that may be the one I encounter here: T2516, may @Dmitry be interrested ![]()




. It’s why I let Docker manage IPs on “connected” networks between VyOS containers.