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

[config] Add portchannel support for static route #1857

Merged
merged 6 commits into from
Dec 7, 2021

Conversation

d-dashkov
Copy link
Contributor

@d-dashkov d-dashkov commented Oct 6, 2021

What I did

Added portchannels support for static routes.
fix sonic-net/sonic-buildimage#8907

How I did it

Added check if nexthop is a portchannel and added check if this portchannel exists in config db.

How to verify it

config portchannel add PortChannel0001
sudo config route add prefix 20.0.0.1/32 nexthop PortChannel0001

Also

sudo config route add prefix 20.0.0.1/32 nexthop PortChannel0003
Error: portchannel does not exist.

Signed-off-by: d-dashkov <[email protected]>
Signed-off-by: d-dashkov <[email protected]>
Signed-off-by: d-dashkov <[email protected]>
Signed-off-by: d-dashkov <[email protected]>
prsunny
prsunny previously approved these changes Oct 6, 2021
@prsunny prsunny requested a review from shi-su October 6, 2021 23:22
@prsunny
Copy link
Contributor

prsunny commented Oct 6, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

shi-su
shi-su previously approved these changes Oct 7, 2021
@d-dashkov d-dashkov dismissed stale reviews from shi-su and prsunny via 96079bf October 7, 2021 07:41
@DavidZagury
Copy link
Contributor

I tried to cherry pick these changes, the command did passed without error, but looking for the routes in “show ip route” we are still not getting the result we expects:

root@r-leopard-56:/home/admin# config portchannel add PortChannel0001
root@r-leopard-56:/home/admin# sudo config route add prefix 20.0.0.1/32 nexthop PortChannel0001
root@r-leopard-56:/home/admin# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup

S>* 0.0.0.0/0 [200/0] via 10.210.24.1, eth0, weight 1, 00:01:33
C>* 10.210.24.0/22 is directly connected, eth0, 00:01:34

Results from 201911 for compression:

root@r-lionfish-07:/home/admin# config portchannel add PortChannel0001
root@r-lionfish-07:/home/admin# sudo config route add prefix 20.0.0.1/32 nexthop PortChannel0001
root@r-lionfish-07:/home/admin# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued route, r - rejected route

S>* 0.0.0.0/0 [200/0] via 10.210.24.1, eth0, 00:02:03
C>* 10.210.24.0/22 is directly connected, eth0, 00:02:03
S   20.0.0.1/32 [1/0] is directly connected, PortChannel0001 inactive, 00:00:12

@d-dashkov
Copy link
Contributor Author

d-dashkov commented Oct 7, 2021

@DavidZagury, I have already prepared a fix for bgpcfd: sonic-net/sonic-buildimage#8911 Currently these changes throw an error if you try to add a portchannel as a nexthop:

Oct  6 14:46:56.866738 sonic DEBUG bgp#bgpcfgd: Received message : '('20.0.0.1/32', 'SET', (('distance', '0,0,0,0,0'), ('nexthop', '10.0.0.1,PortChannel0001,PortChannel0001,PortChannel0002,PortChannel0001'), ('blackhole', 'false,false,false,false,false'), ('nexthop-vrf', ',,,,'), ('ifname', ',,,,')))'
Oct  6 14:46:56.867237 sonic CRIT bgp#bgpcfgd: Got an exception illegal IP address string passed to inet_pton: Traceback: Traceback (most recent call last):#012  File "/usr/local/lib/python3.7/dist-packages/bgpcfgd/managers_static_rt.py", line 43, in set_handler#012    ip_nh_set = IpNextHopSet(is_ipv6, bkh_list, nh_list, intf_list, dist_list, nh_vrf_list)#012  File "/usr/local/lib/python3.7/dist-packages/bgpcfgd/managers_static_rt.py", line 219, in __init__#012    item(dist_list, idx), item(vrf_list, idx), ))#012  File "/usr/local/lib/python3.7/dist-packages/bgpcfgd/managers_static_rt.py", line 172, in __init__#012    if self.blackhole != 'true' and self.is_zero_ip() and len(self.interface.strip()) == 0:#012  File "/usr/local/lib/python3.7/dist-packages/bgpcfgd/managers_static_rt.py", line 186, in is_zero_ip#012    return sum([x for x in socket.inet_pton(self.af, self.ip)]) == 0#012OSError: illegal IP address string passed to inet_pton
Oct  6 14:46:56.867404 sonic DEBUG bgp#bgpcfgd: 'SET' handler returned NOT_READY for the Manager: <class 'bgpcfgd.managers_static_rt.StaticRouteMgr'>

#8911 should prevent this and both PRs should allow the user to add portchannels as the nexthop

prsunny
prsunny previously approved these changes Oct 15, 2021
@d-dashkov
Copy link
Contributor Author

@shi-su pls review this PR

shi-su
shi-su previously approved these changes Oct 20, 2021
@shi-su
Copy link
Contributor

shi-su commented Oct 20, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: d-dashkov <[email protected]>
@d-dashkov
Copy link
Contributor Author

I believe that there was some problem in Azure pipeline with collecting logs, but I don`t have permission to restart it

cp: cannot stat '../sonic-swss/tests/log': No such file or directory
##[error]Bash exited with code '1'.

@liat-grozovik
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@d-dashkov d-dashkov requested a review from prsunny November 3, 2021 18:04
@d-dashkov d-dashkov requested a review from shi-su November 3, 2021 18:04
@pshulik
Copy link

pshulik commented Nov 8, 2021

@prsunny Could you please review these changes?

@prsunny prsunny merged commit 7c34b79 into sonic-net:master Dec 7, 2021
judyjoseph pushed a commit that referenced this pull request Jan 9, 2022
* Added portchannels support for static routes.
* Added check if nexthop is a portchannel and verify if this portchannel exists in config db.

Signed-off-by: d-dashkov <[email protected]>
arlakshm pushed a commit that referenced this pull request Mar 1, 2022
* Added portchannels support for static routes.
* Added check if nexthop is a portchannel and verify if this portchannel exists in config db.

Signed-off-by: d-dashkov <[email protected]>
stepanblyschak pushed a commit to stepanblyschak/sonic-utilities that referenced this pull request Apr 18, 2022
[buffer orch] Bugfix: Don't query counter SAI_BUFFER_POOL_STAT_XOFF_ROOM_WATERMARK_BYTES on a pool where it is not supported (sonic-net#1857) (#2106)

Signed-off-by: Volodymyr Samotiy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't add route with a nexthop of a PortChannel
9 participants