-
Notifications
You must be signed in to change notification settings - Fork 56
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
ncm-network: nmstate default gateway issue #1655
Comments
@wdpypere So what this part of code currently supports if default_gateway is defined and tries match the same with the interface gw settings so it can pick the next-hope-interface. |
@aka7 yes, we are on the same page. 😄 none of our interfaces have a gw defined. we define gateways on routes and a default gateway. My preference is of course backwards compatibility on the profiles, but if that is not possible then yes, it would be good if it would fail to compile. a system should have at least a fuctional default gateway. |
i will have a look at this. default gateway should be something we can set/configure. |
@aka7 the schema already has following code
i guess we would need something similar in perl or in our profiles to add a i looked into nmstate and networkmanager a bit, and it's not that clear how to set it (eg https://askubuntu.com/questions/1073692/network-manager-no-default-route). looks like you need to set the "gateway" value in the networkmanger config file instead of only adding a route. not sure how to do that with nmstate. @wdpypere i guess the easiest way for now is to add some "run-last" template that based on code above adds a route with prefix 0 to the interface that it can reach. i do think that this is better done in perl though, but given on the test above, it's not that hard in pan. |
@stdweird I already had chat with Redhat about this, if we can add default route (or any route) without having to add next-hop-interface in nmstate and answer was no. However if we think its valid requirement perhaps I can push them to create a RFE for it. Thinking about this a bit more, we can perhaps change the perl code to add the next-hop-interface to default DGW entry if DGW falls within the subnet boundary of that interface? instead of what it does currently. alternatively, we may need to add the support for command option in nmstate too. |
nmstate requires next-hop-interface for every route to be added. Create default route entry only on the interface if default_gateway falls within subnet boundary. fixes quattor#1655
nmstate requires next-hop-interface for every route to be added. Create default route entry only on the interface if default_gateway falls within subnet boundary. fixes quattor#1655
nmstate requires next-hop-interface for every route to be added. Create default route entry only on the interface if default_gateway falls within subnet boundary. fixes quattor#1655
@wdpypere made a change to pick the right interface without looking at gateway on the interface. I think should fix the issue. Other commits of this is in my other PR which is yet to be merged but are needed here. |
As I commented in the PR, it does fix this issue. |
nmstate requires next-hop-interface for every route to be added. Create default route entry only on the interface if default_gateway falls within subnet boundary. fixes quattor#1655
nmstate requires next-hop-interface for every route to be added. Create default route entry only on the interface if default_gateway falls within subnet boundary. fixes quattor#1655
nmstate requires next-hop-interface for every route to be added. Create default route entry only on the interface if default_gateway falls within subnet boundary. fixes quattor#1655
nmstate requires next-hop-interface for every route to be added. Create default route entry only on the interface if default_gateway falls within subnet boundary. fixes quattor#1655
nmstate requires next-hop-interface for every route to be added. Create default route entry only on the interface if default_gateway falls within subnet boundary. fixes quattor#1655
@aka7 I found another discrepancy with nmstate, with gateways. on our site we only set
/system/network/default_gateway
. something like:but in the code I see:
the
defined($iface->{gateway})
always fails, so no default gateway is set. My perl is quite poor but it seems the code makes the assumption that a gateway is set on interface level. while network.pm does not. Unless I'm mistaken.I would expect a route like the following to show up:
The text was updated successfully, but these errors were encountered: