Page MenuHomeVyOS Platform

Error showing nat66 source and destination
Closed, ResolvedPublicBUG

Description

Error when viewing source and destination rules in nat66.
Error source rule:

vyos@vyos:~$ show nat66 source rules 
Traceback (most recent call last):
Rule       Source                                             Translation                                        Outbound Interface
----       ------                                             -----------                                        ------------------
  File "/usr/libexec/vyos/op_mode/show_nat66_rules.py", line 96, in <module>
    print(format_nat66_rule.format(rule, srcdest, tran_addr, interface))
NameError: name 'tran_addr' is not defined

Error destination rule:

vyos@vyos:~$ show nat66 destination rules 
Rule       Destination                                        Translation                                        Inbound Interface
----       -----------                                        -----------                                        -----------------
Traceback (most recent call last):
  File "/usr/libexec/vyos/op_mode/show_nat66_rules.py", line 74, in <module>
    srcdest = dict_search('match.right.prefix.addr', data['expr'][2])
  File "/usr/lib/python3/dist-packages/vyos/util.py", line 765, in dict_search
    c = c.get(p, {})
AttributeError: 'str' object has no attribute 'get'

VyOS configuration:

set interfaces ethernet eth0 address '2001:1111:1111:1111::10/64'
set interfaces ethernet eth1 address 'fd00:1111:1111:1111::1/64'
set nat66 destination rule 100 destination address '2001:1111:1111:1111::10'
set nat66 destination rule 100 inbound-interface 'eth0'
set nat66 destination rule 100 translation address 'fd00:1111:1111:1111::10'
set nat66 source rule 100 destination prefix '!fd00:2222:2222:2222::/64'
set nat66 source rule 100 outbound-interface 'eth0'
set nat66 source rule 100 source prefix 'fd00:1111:1111:1111::/64'
set nat66 source rule 100 translation address '2001:1111:1111:1111::10'

Details

Difficulty level
Unknown (require assessment)
Version
VyOS 1.4-rolling-202208190217
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Unspecified (please specify)

Related Objects

Event Timeline

Viacheslav changed the task status from Open to In progress.Aug 24 2022, 11:41 AM
Viacheslav claimed this task.
Viacheslav added a subscriber: Viacheslav.

PR https://github.com/vyos/vyos-1x/pull/1491

set nat66 destination rule 100 destination address '2001:1111:1111:1111::10'
set nat66 destination rule 100 inbound-interface 'eth0'
set nat66 destination rule 100 translation address 'fd00:1111:1111:1111::10'
set nat66 source rule 100 destination prefix '!fd00:2222:2222:2222::/64'
set nat66 source rule 100 outbound-interface 'eth0'
set nat66 source rule 100 source prefix 'fd00:1111:1111:1111::/64'
set nat66 source rule 100 translation address '2001:1111:1111:1111::10'
set nat66 source rule 120 destination prefix '2001:db8:2222::/64'
set nat66 source rule 120 outbound-interface 'eth0'
set nat66 source rule 120 source prefix '2001:db8:1111::/64'
set nat66 source rule 120 translation address 'masquerade'
set nat66 source rule 130 destination prefix '2001:db8:2222::/64'
set nat66 source rule 130 outbound-interface 'eth0'
set nat66 source rule 130 source prefix '2001:db8:2244::/64'
set nat66 source rule 130 translation address 'masquerade'

show

vyos@r14:~$ show nat66 source rules 
Rule    Source                    Destination                Proto    Out-Int    Translation
------  ------------------------  -------------------------  -------  ---------  -----------------------
100     fd00:1111:1111:1111::/64  !fd00:2222:2222:2222::/64  IP6      eth0       2001:1111:1111:1111::10
        sport any                 dport any
120     2001:db8:1111::/64        2001:db8:2222::/64         IP6      eth0       masquerade
        sport any                 dport any
130     2001:db8:2244::/64        2001:db8:2222::/64         IP6      eth0       masquerade
        sport any                 dport any
vyos@r14:~$ 
vyos@r14:~$ 
vyos@r14:~$ show nat66 destination  rules 
Rule    Source     Destination              Proto    In-Int    Translation
------  ---------  -----------------------  -------  --------  -----------------------
100     ::/0       2001:1111:1111:1111::10  any      eth0      fd00:1111:1111:1111::10
        sport any  dport any
vyos@r14:~$
Viacheslav moved this task from Need Triage to Finished on the VyOS 1.4 Sagitta board.