vyos@vyos:~$ configure
WARNING: You are currently configuring a live-ISO environment, changes will not persist until installed
[edit]
vyos@vyos# edit nat destination rule 1
[edit nat destination rule 1]
vyos@vyos# set inbound-interface eth0
[edit nat destination rule 1]
vyos@vyos# set destination address 1.0.0.0/24
[edit nat destination rule 1]
vyos@vyos# set translation address 2.0.0.0/24
[edit nat destination rule 1]
vyos@vyos# commit
[ nat ]
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 version of the code available at
https://downloads.vyos.io/rolling/current/amd64/vyos-rolling-latest.iso
- Consult the forum to see how to handle this issue
https://forum.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: 2021-02-12 21:29:18
Image Version: VyOS 1.4-rolling-202102121338
Release Train: sagitta
Built by: autobuild@vyos.net
Built on: Fri 12 Feb 2021 13:38 UTC
Build UUID: bc737bd6-a1da-4443-876d-33c52dfefbdd
Build Commit ID: aec60effa4e36e
Architecture: x86_64
Boot via: livecd
System type: KVM guest
Hardware vendor: QEMU
Hardware model: Standard PC (Q35 + ICH9, 2009)
Hardware S/N:
Hardware UUID: c57f3fa4-9552-406b-b205-6f5ee80eafbd
Traceback (most recent call last):
File "/usr/libexec/vyos/conf_mode/nat.py", line 201, in <module>
generate(c)
File "/usr/libexec/vyos/conf_mode/nat.py", line 186, in generate
permission=0o755)
File "/usr/lib/python3/dist-packages/vyos/template.py", line 112, in render
rendered = render_to_string(template, content, formater)
File "/usr/lib/python3/dist-packages/vyos/template.py", line 82, in render_to_string
rendered = template.render(content)
File "/usr/lib/python3/dist-packages/jinja2/asyncsupport.py", line 76, in render
return original_render(self, *args, **kwargs)
File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 1008, in render
return self.environment.handle_exception(exc_info, True)
File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 780, in handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/lib/python3/dist-packages/jinja2/_compat.py", line 37, in reraise
raise value.with_traceback(tb)
File "/usr/share/vyos/templates/firewall/nftables-nat.tmpl", line 148, in top-level template code
{{ nat_rule(rule, config, 'PREROUTING') }}
File "/usr/lib/python3/dist-packages/jinja2/runtime.py", line 579, in _invoke
rv = self._func(*arguments)
File "/usr/share/vyos/templates/firewall/nftables-nat.tmpl", line 27, in template
{% set trns_addr = 'dnat ip prefix to ip daddr map { ' + config.source.address + ' : ' + config.translation.address + ' }' %}
File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 430, in getattr
return getattr(obj, attribute)
jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'source'
[[nat]] failed
Commit failed
[edit nat destination rule 1]It seems that the jinja2 template calls for source.address where it should call for destination.address