Page MenuHomeVyOS Platform

NAT: OSError when configuring translation address range
Closed, ResolvedPublicBUG

Description

Reported vis Slack: https://vyos.slack.com/archives/C976FK9S6/p1601416545007500

vyos@vyos# set nat source rule 100 translation address '10.10.0.1-10.10.0.254'
vyos@vyos# set nat source rule 100 outbound-interface eth0
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:      2020-10-01 19:50:48
Image Version:    VyOS 1.3-rolling-202009261100
Release Train:    equuleus

Built by:         autobuild@vyos.net
Built on:         Sat 26 Sep 2020 11:00 UTC
Build UUID:       fa2e283b-d743-41b6-b13d-b67c6e886465
Build Commit ID:  6586659716d960

Architecture:     x86_64
Boot via:         installed image
System type:      VMware guest

Hardware vendor:  VMware, Inc.
Hardware model:   VMware Virtual Platform
Hardware S/N:     VMware-42 3f 67 73 77 df c4 80-42 c9 42 af ff 15 de 0b
Hardware UUID:    73673f42-df77-80c4-42c9-42afff15de0b

Traceback (most recent call last):
  File "/usr/libexec/vyos/conf_mode/nat.py", line 282, in <module>
    verify(c)
  File "/usr/libexec/vyos/conf_mode/nat.py", line 241, in verify
    if addr != 'masquerade' and not is_addr_assigned(addr):
  File "/usr/lib/python3/dist-packages/vyos/validate.py", line 145, in is_addr_assigned
    tmp = is_intf_addr_assigned(intf, addr)
  File "/usr/lib/python3/dist-packages/vyos/validate.py", line 91, in is_intf_addr_assigned
    return _is_intf_addr_assigned(intf, addr)
  File "/usr/lib/python3/dist-packages/vyos/validate.py", line 121, in _is_intf_addr_assigned
    if not _are_same_ip(address, ip_addr):
  File "/usr/lib/python3/dist-packages/vyos/validate.py", line 85, in _are_same_ip
    return socket.inet_pton(f_one, one) == socket.inet_pton(f_one, two)
OSError: illegal IP address string passed to inet_pton

Details

Difficulty level
Easy (less than an hour)
Version
1.3-rolling-202009261100
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)

Event Timeline

c-po claimed this task.
c-po triaged this task as High priority.
c-po changed Difficulty level from Unknown (require assessment) to Easy (less than an hour).
erkin set Issue type to Bug (incorrect behavior).Aug 29 2021, 12:46 PM
erkin removed a subscriber: Active contributors.