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

Ansible-Changes-for-Proxy-ARP/ND-Proxy #479

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- sonic_l3_interfaces - Added support for Proxy-ARP/ND-Proxy feature (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/479).
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ def __init__(self, **kwargs):
'type': 'list'
},
'anycast_addresses': {'elements': 'str', 'type': 'list'},
'proxy_arp': {
'options': {
'mode': {'choices': ['DISABLE', 'REMOTE_ONLY', 'ALL'], 'type': 'str'},
},
'type': 'dict'
},
},
'type': 'dict'
},
Expand All @@ -68,7 +74,14 @@ def __init__(self, **kwargs):
},
'autoconf': {'type': 'bool'},
'dad': {'choices': ['ENABLE', 'DISABLE', 'DISABLE_IPV6_ON_FAILURE'], 'type': 'str'},
'enabled': {'type': 'bool'}
'enabled': {'type': 'bool'},
'nd_proxy': {
'options': {
'mode': {'choices': ['DISABLE', 'REMOTE_ONLY', 'ALL'], 'type': 'str'},
'nd_proxy_rules': {'elements': 'str', 'type': 'list'}
},
'type': 'dict'
},
},
'type': 'dict'
},
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ def get_l3_interfaces(self):
if l3_ipv4:
l3_dict['ipv4']['addresses'] = l3_ipv4

if 'openconfig-if-ip:ipv4' in ip and 'proxy-arp' in ip['openconfig-if-ip:ipv4'] and \
'config' in ip['openconfig-if-ip:ipv4']['proxy-arp'] and \
'mode' in ip['openconfig-if-ip:ipv4']['proxy-arp']['config']:
l3_dict['ipv4'].setdefault('proxy_arp', {})
l3_dict['ipv4']['proxy_arp']['mode'] = ip['openconfig-if-ip:ipv4']['proxy-arp']['config']['mode']

l3_dict['ipv6'] = dict()
l3_ipv6 = list()
if 'openconfig-if-ip:ipv6' in ip:
Expand All @@ -115,6 +121,12 @@ def get_l3_interfaces(self):
l3_dict['ipv6']['autoconf'] = ip['openconfig-if-ip:ipv6']['config']['ipv6_autoconfig']
if 'config' in ip['openconfig-if-ip:ipv6'] and 'ipv6_dad' in ip['openconfig-if-ip:ipv6']['config']:
l3_dict['ipv6']['dad'] = ip['openconfig-if-ip:ipv6']['config']['ipv6_dad']
if 'nd-proxy' in ip['openconfig-if-ip:ipv6'] and 'config' in ip['openconfig-if-ip:ipv6']['nd-proxy'] and \
'mode' in ip['openconfig-if-ip:ipv6']['nd-proxy']['config']:
l3_dict['ipv6'].setdefault('nd_proxy', {})
l3_dict['ipv6']['nd_proxy']['mode'] = ip['openconfig-if-ip:ipv6']['nd-proxy']['config']['mode']
if 'nd-proxy-rules' in ip['openconfig-if-ip:ipv6']['nd-proxy']['config']:
l3_dict['ipv6']['nd_proxy']['nd_proxy_rules'] = ip['openconfig-if-ip:ipv6']['nd-proxy']['config']['nd-proxy-rules']

l3_configs.append(l3_dict)
return l3_configs
Expand Down
45 changes: 45 additions & 0 deletions plugins/modules/sonic_l3_interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,20 @@
- List of IPv4 addresses to be set for anycast.
type: list
elements: str
proxy_arp:
description:
- Configurations parameters for ipv4 proxy ARP
type: dict
suboptions:
mode:
description:
- Modes for proxy_arp
version_added: 3.1.0
type: str
choices:
- DISABLE
- REMOTE_ONLY
- ALL
ipv6:
description:
- ipv6 configurations to be set for the Layer 3 interface mentioned in name option.
Expand Down Expand Up @@ -120,6 +134,26 @@
- ENABLE
- DISABLE
- DISABLE_IPV6_ON_FAILURE
nd_proxy:
description:
- Configurations parameters for ipv6 ND-proxy
type: dict
suboptions:
mode:
description:
- Modes for nd_proxy
version_added: 3.1.0
type: str
choices:
- DISABLE
- REMOTE_ONLY
- ALL
nd_proxy_rules:
description:
- List of nd_proxy rules can be added.
version_added: 3.1.0
type: list
elements: str
state:
description:
- The state of the configuration after module completion.
Expand Down Expand Up @@ -152,6 +186,8 @@
# ipv6 enable
# ipv6 address autoconfig
# ipv6 nd dad enable
# ip proxy-arp enable remote-only
# ipv6 nd-proxy enable all
#!
#interface Ethernet24
# mtu 9100
Expand All @@ -175,6 +211,8 @@
config:
- name: Ethernet20
ipv4:
proxy_arp:
- mode: REMOTE_ONLY
addresses:
- address: 83.1.1.1/16
- address: 84.1.1.1/16
Expand Down Expand Up @@ -206,6 +244,7 @@
# ipv6 enable
# ipv6 address autoconfig
# ipv6 nd dad enable
# ipv6 nd-proxy enable all
#!
#interface Ethernet24
# mtu 9100
Expand Down Expand Up @@ -240,6 +279,9 @@
# ipv6 enable
# ipv6 address autoconfig
# ipv6 nd dad enable
# ip proxy-arp enable remote-only
# ipv6 nd-proxy enable all
# ipv6 nd-proxy rule prefix 5001::/24
#!
#interface Ethernet24
# mtu 9100
Expand All @@ -250,6 +292,9 @@
# ipv6 address 91::1/16
# ipv6 address 92::1/16
# ipv6 address 93::1/16
# ip proxy-arp enable all
# ipv6 nd-proxy enable remote-only
# ipv6 nd-proxy rule prefix 6001::/24
#!
#interface Vlan501
# ip anycast-address 11.12.13.14/12
Expand Down
Loading
Loading