-
Notifications
You must be signed in to change notification settings - Fork 710
DHCP Relay support for Physical and PO L3 interfaces #1311
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
DHCP Relay support for Physical and PO L3 interfaces #1311
Conversation
This pull request introduces 1 alert when merging b0c5cb7cd2117b3bd24dbfb408364838ce3d5f9d into 394b202 - view on LGTM.com new alerts:
|
can you add test? |
Retest please |
@@ -547,7 +547,7 @@ | |||
"NULL": "NULL" | |||
}, | |||
"INTERFACE|Ethernet0": { | |||
"NULL": "NULL" | |||
"dhcp_servers@": "12.0.0.1,12.0.0.2,12.0.0.3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not according to the existing schema. INTERFACE tables does not have dhcp_servers
as attribute . Are you proposing a schema change? Currently for vlans, it is part of VLAN table and not VLAN_INTERFACE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, "dhcp_servers" is an L3 attribute, so added it to INTERFACE and PORTCHANNEL_INTERFACE tables.
For Vlan case, still using VLAN table only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be inconsistent with VLAN_INTERFACE. Fine with me if @tahmed-dev, @jleveque and @lguohan sign off.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @prsunny. Lumping dhcp_servers with the interface is inconsistent with the current. I think since PR:6221 attempts to have DHCP relay preside on almost ever interface, it would be better to have separate table for DHCP_RELAY configuration. @lguohan, @jleveque what are your thoughts on that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is debatable. Previously we considered the list of DHCP server IPs to be an attribute of a VLAN table entry. This approach is consistent with the current approach, extending it to INTERFACE and PORTCHANNEL_INTERFACE tables. We could take your approach, but this would require refactoring to create a DHCP_RELAY table and I guess have the attributes be the interface names? Basically inverting this approach?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is indeed. I am thinking of having just one binary to serve as DHCP relay down the road and so having those entries consolidated under DHCP_RELAY table would be self contained and eliminate the need to search multiple tables.
Yes, the attributes would be interface name serving as a key and a downlink at the same time and the map/table would contain uplink interfaces and DHCP helper IPs (helper IPs could be per DHCP feature.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a conclusion here please guys?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we add new table like "DHCP_RELAY" table, then we need to change the supervisord.conf.j2 file also accordingly right, it be leads more changes for now.
Can we move the dhcp_servers from VLAN table to VLAN_INTERFACE table to be more consistent ??
config/main.py
Outdated
# Use this method to validate unicast IPv4 address | ||
# | ||
def is_ip4_addr_valid(addr, display): | ||
v4_invalid_list = [ipaddress.IPv4Address(unicode('0.0.0.0')), ipaddress.IPv4Address(unicode('255.255.255.255'))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conversion to unicode()
should not be necessary, now that sonic-utilities is Python 3-only. This may also be causing the PR test failures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Removed unicode function.
config/main.py
Outdated
def is_ip4_addr_valid(addr, display): | ||
v4_invalid_list = [ipaddress.IPv4Address(unicode('0.0.0.0')), ipaddress.IPv4Address(unicode('255.255.255.255'))] | ||
try: | ||
ip = ipaddress.ip_address(unicode(addr)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conversion to unicode()
should not be necessary, now that sonic-utilities is Python 3-only. This may also be causing the PR test failures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Removed unicode function.
Retest this please. |
4 similar comments
Retest this please. |
Retest this please. |
Retest this please. |
Retest this please. |
…erface and Link-select support Signed-off-by: Akhilesh Samineni <[email protected]>
Signed-off-by: Akhilesh Samineni <[email protected]>
Signed-off-by: Akhilesh Samineni <[email protected]>
Signed-off-by: Akhilesh Samineni <[email protected]>
Signed-off-by: Akhilesh Samineni <[email protected]>
Signed-off-by: Akhilesh Samineni <[email protected]>
8f445c9
to
25f6d41
Compare
Currently DHCP Relay support is for Vlan interfaces only.
This PR, extending the DHCP Relay support to Physical and Port channels L3 interfaces.
Config Commands :
Show Command :
Signed-off-by: Akhilesh Samineni [email protected]