Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix(eos_cli_config_gen): Remove requirement for original_ip to be unique under interface IP NAT #3900

Merged
merged 8 commits into from
Apr 29, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ interface Management1
| --------- | ----------- | ------------- | ----------- | ------------- | --------------- | -------- | ----- | -------- | ------- |
| - | 1.0.0.1 | - | - | 2.0.0.1 | - | - | - | 0 | - |
| - | 1.0.0.2 | 22 | - | 2.0.0.2 | - | - | - | 0 | - |
| - | 1.0.0.3 | 22 | - | 2.0.0.3 | 23 | - | - | 0 | - |
| - | 1.0.0.2 | 23 | - | 2.0.0.3 | 23 | - | - | 0 | - |
| - | 1.0.0.4 | 22 | - | 2.0.0.4 | 23 | udp | - | 0 | - |
| - | 1.0.0.5 | 22 | - | 2.0.0.5 | 23 | tcp | 1 | 0 | - |
| - | 1.0.0.6 | 22 | - | 2.0.0.6 | 23 | tcp | 2 | 5 | Comment Test |
Expand Down Expand Up @@ -182,7 +182,7 @@ ip nat profile NAT-PROFILE-NO-VRF-2
ip nat source dynamic access-list ACL19 pool POOL19 full-cone priority 10 comment Priority_10
ip nat destination static 1.0.0.1 2.0.0.1
ip nat destination static 1.0.0.2 22 2.0.0.2
ip nat destination static 1.0.0.3 22 2.0.0.3 23
ip nat destination static 1.0.0.2 23 2.0.0.3 23
ip nat destination static 1.0.0.4 22 2.0.0.4 23 protocol udp
ip nat destination static 1.0.0.5 22 2.0.0.5 23 protocol tcp group 1
ip nat destination static 1.0.0.6 22 2.0.0.6 23 protocol tcp group 2 comment Comment Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ ip nat profile NAT-PROFILE-NO-VRF-2
ip nat source dynamic access-list ACL19 pool POOL19 full-cone priority 10 comment Priority_10
ip nat destination static 1.0.0.1 2.0.0.1
ip nat destination static 1.0.0.2 22 2.0.0.2
ip nat destination static 1.0.0.3 22 2.0.0.3 23
ip nat destination static 1.0.0.2 23 2.0.0.3 23
ip nat destination static 1.0.0.4 22 2.0.0.4 23 protocol udp
ip nat destination static 1.0.0.5 22 2.0.0.5 23 protocol tcp group 1
ip nat destination static 1.0.0.6 22 2.0.0.6 23 protocol tcp group 2 comment Comment Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ ip_nat:
- original_ip: 1.0.0.2
translated_ip: 2.0.0.2
original_port: 22
- original_ip: 1.0.0.3
- original_ip: 1.0.0.2
translated_ip: 2.0.0.3
original_port: 22
original_port: 23
translated_port: 23
- original_ip: 1.0.0.4
translated_ip: 2.0.0.4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;comment</samp>](## "ethernet_interfaces.[].ip_nat.destination.static.[].comment") | String | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;direction</samp>](## "ethernet_interfaces.[].ip_nat.destination.static.[].direction") | String | | | Valid Values:<br>- <code>egress</code><br>- <code>ingress</code> | Egress or ingress can be the default. This depends on source/destination, EOS version, and hardware platform.<br>EOS might remove this keyword in the configuration. So, check the configuration on targeted HW/SW.<br> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;group</samp>](## "ethernet_interfaces.[].ip_nat.destination.static.[].group") | Integer | | | Min: 1<br>Max: 65535 | 'access_list' and 'group' are mutual exclusive. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;original_ip</samp>](## "ethernet_interfaces.[].ip_nat.destination.static.[].original_ip") | String | Required, Unique | | | IPv4 address. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;original_port</samp>](## "ethernet_interfaces.[].ip_nat.destination.static.[].original_port") | Integer | | | Min: 1<br>Max: 65535 | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;original_ip</samp>](## "ethernet_interfaces.[].ip_nat.destination.static.[].original_ip") | String | | | | IPv4 address. The combination of original_ip and original_port must be unique. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;original_port</samp>](## "ethernet_interfaces.[].ip_nat.destination.static.[].original_port") | Integer | | | Min: 1<br>Max: 65535 | The combination of original_ip and original_port must be unique. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;priority</samp>](## "ethernet_interfaces.[].ip_nat.destination.static.[].priority") | Integer | | | Min: 0<br>Max: 4294967295 | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;protocol</samp>](## "ethernet_interfaces.[].ip_nat.destination.static.[].protocol") | String | | | Valid Values:<br>- <code>udp</code><br>- <code>tcp</code> | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;translated_ip</samp>](## "ethernet_interfaces.[].ip_nat.destination.static.[].translated_ip") | String | Required | | | IPv4 address. |
Expand All @@ -117,8 +117,8 @@
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;comment</samp>](## "ethernet_interfaces.[].ip_nat.source.static.[].comment") | String | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;direction</samp>](## "ethernet_interfaces.[].ip_nat.source.static.[].direction") | String | | | Valid Values:<br>- <code>egress</code><br>- <code>ingress</code> | Egress or ingress can be the default. This depends on source/destination, EOS version, and hardware platform.<br>EOS might remove this keyword in the configuration. So, check the configuration on targeted HW/SW.<br> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;group</samp>](## "ethernet_interfaces.[].ip_nat.source.static.[].group") | Integer | | | Min: 1<br>Max: 65535 | 'access_list' and 'group' are mutual exclusive. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;original_ip</samp>](## "ethernet_interfaces.[].ip_nat.source.static.[].original_ip") | String | Required, Unique | | | IPv4 address. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;original_port</samp>](## "ethernet_interfaces.[].ip_nat.source.static.[].original_port") | Integer | | | Min: 1<br>Max: 65535 | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;original_ip</samp>](## "ethernet_interfaces.[].ip_nat.source.static.[].original_ip") | String | | | | IPv4 address. The combination of original_ip and original_port must be unique. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;original_port</samp>](## "ethernet_interfaces.[].ip_nat.source.static.[].original_port") | Integer | | | Min: 1<br>Max: 65535 | The combination of original_ip and original_port must be unique. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;priority</samp>](## "ethernet_interfaces.[].ip_nat.source.static.[].priority") | Integer | | | Min: 0<br>Max: 4294967295 | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;protocol</samp>](## "ethernet_interfaces.[].ip_nat.source.static.[].protocol") | String | | | Valid Values:<br>- <code>udp</code><br>- <code>tcp</code> | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;translated_ip</samp>](## "ethernet_interfaces.[].ip_nat.source.static.[].translated_ip") | String | Required | | | IPv4 address. |
Expand Down Expand Up @@ -576,8 +576,10 @@
# 'access_list' and 'group' are mutual exclusive.
group: <int; 1-65535>

# IPv4 address.
original_ip: <str; required; unique>
# IPv4 address. The combination of original_ip and original_port must be unique.
original_ip: <str>

# The combination of original_ip and original_port must be unique.
original_port: <int; 1-65535>
priority: <int; 0-4294967295>
protocol: <str; "udp" | "tcp">
Expand Down Expand Up @@ -610,8 +612,10 @@
# 'access_list' and 'group' are mutual exclusive.
group: <int; 1-65535>

# IPv4 address.
original_ip: <str; required; unique>
# IPv4 address. The combination of original_ip and original_port must be unique.
original_ip: <str>

# The combination of original_ip and original_port must be unique.
original_port: <int; 1-65535>
priority: <int; 0-4294967295>
protocol: <str; "udp" | "tcp">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;comment</samp>](## "ip_nat.profiles.[].destination.static.[].comment") | String | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;direction</samp>](## "ip_nat.profiles.[].destination.static.[].direction") | String | | | Valid Values:<br>- <code>egress</code><br>- <code>ingress</code> | Egress or ingress can be the default. This depends on source/destination, EOS version, and hardware platform.<br>EOS might remove this keyword in the configuration. So, check the configuration on targeted HW/SW.<br> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;group</samp>](## "ip_nat.profiles.[].destination.static.[].group") | Integer | | | Min: 1<br>Max: 65535 | 'access_list' and 'group' are mutual exclusive. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;original_ip</samp>](## "ip_nat.profiles.[].destination.static.[].original_ip") | String | Required, Unique | | | IPv4 address. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;original_port</samp>](## "ip_nat.profiles.[].destination.static.[].original_port") | Integer | | | Min: 1<br>Max: 65535 | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;original_ip</samp>](## "ip_nat.profiles.[].destination.static.[].original_ip") | String | | | | IPv4 address. The combination of original_ip and original_port must be unique. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;original_port</samp>](## "ip_nat.profiles.[].destination.static.[].original_port") | Integer | | | Min: 1<br>Max: 65535 | The combination of original_ip and original_port must be unique. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;priority</samp>](## "ip_nat.profiles.[].destination.static.[].priority") | Integer | | | Min: 0<br>Max: 4294967295 | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;protocol</samp>](## "ip_nat.profiles.[].destination.static.[].protocol") | String | | | Valid Values:<br>- <code>udp</code><br>- <code>tcp</code> | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;translated_ip</samp>](## "ip_nat.profiles.[].destination.static.[].translated_ip") | String | Required | | | IPv4 address. |
Expand All @@ -41,8 +41,8 @@
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;comment</samp>](## "ip_nat.profiles.[].source.static.[].comment") | String | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;direction</samp>](## "ip_nat.profiles.[].source.static.[].direction") | String | | | Valid Values:<br>- <code>egress</code><br>- <code>ingress</code> | Egress or ingress can be the default. This depends on source/destination, EOS version, and hardware platform.<br>EOS might remove this keyword in the configuration. So, check the configuration on targeted HW/SW.<br> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;group</samp>](## "ip_nat.profiles.[].source.static.[].group") | Integer | | | Min: 1<br>Max: 65535 | 'access_list' and 'group' are mutual exclusive. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;original_ip</samp>](## "ip_nat.profiles.[].source.static.[].original_ip") | String | Required, Unique | | | IPv4 address. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;original_port</samp>](## "ip_nat.profiles.[].source.static.[].original_port") | Integer | | | Min: 1<br>Max: 65535 | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;original_ip</samp>](## "ip_nat.profiles.[].source.static.[].original_ip") | String | | | | IPv4 address. The combination of original_ip and original_port must be unique. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;original_port</samp>](## "ip_nat.profiles.[].source.static.[].original_port") | Integer | | | Min: 1<br>Max: 65535 | The combination of original_ip and original_port must be unique. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;priority</samp>](## "ip_nat.profiles.[].source.static.[].priority") | Integer | | | Min: 0<br>Max: 4294967295 | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;protocol</samp>](## "ip_nat.profiles.[].source.static.[].protocol") | String | | | Valid Values:<br>- <code>udp</code><br>- <code>tcp</code> | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;translated_ip</samp>](## "ip_nat.profiles.[].source.static.[].translated_ip") | String | Required | | | IPv4 address. |
Expand Down Expand Up @@ -116,8 +116,10 @@
# 'access_list' and 'group' are mutual exclusive.
group: <int; 1-65535>

# IPv4 address.
original_ip: <str; required; unique>
# IPv4 address. The combination of original_ip and original_port must be unique.
original_ip: <str>

# The combination of original_ip and original_port must be unique.
original_port: <int; 1-65535>
priority: <int; 0-4294967295>
protocol: <str; "udp" | "tcp">
Expand Down Expand Up @@ -150,8 +152,10 @@
# 'access_list' and 'group' are mutual exclusive.
group: <int; 1-65535>

# IPv4 address.
original_ip: <str; required; unique>
# IPv4 address. The combination of original_ip and original_port must be unique.
original_ip: <str>

# The combination of original_ip and original_port must be unique.
original_port: <int; 1-65535>
priority: <int; 0-4294967295>
protocol: <str; "udp" | "tcp">
Expand Down