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

inconsistency between system setting and sysrepo-plugin-interfaces output #31

Open
alireza11048 opened this issue Aug 22, 2022 · 4 comments

Comments

@alireza11048
Copy link

Hi,
I've successfully installed the netopeer2/sysrepo/ietf-interface(devel branch) set-up. while I've been testing it, in the below scenario the sysrepo-plugin-interfaces plugin output is inconsistent with the system setting:

  1. in the netopeer2-cli run "get --filter-xpath /ietf-interfaces:*" -> prints the current interfaces status correctly
  2. in the Linux command line run "ip addr add 172.16.221.131/24 dev ens33" -> add an IP to the ens33 interface
  3. in the netopeer2-cli run "get --filter-xpath /ietf-interfaces:*" -> prints the step1 output, while I've had assigned address to the ens33 interface in the step2.

Is this an expected behavior? if we change the network interface setting through another interface(like Linux command line), it shouldn't be updated in the netconf interface?

@feelqah
Copy link
Collaborator

feelqah commented Aug 23, 2022

Hi,
yes, that is expected behavior. It is expected that you use the plugin (netconf) to configure the system.
If you configure something without the plugin (e.g.: with ip cmd), while the plugin is running, it will not be shown in the datastore.
But if you restart the plugin it will pick up the changes that you have made without the plugin.

So in your case, after you have added an ip addr manually, you would need to restart the plugin, then it would show the manually added ip addr.

@alireza11048
Copy link
Author

Thanks for your response. i've tested that. but even after resetting the plugin (terminating it and running it again) i can't see the new ip addr in the netopeer-cli. this is the the "ip a" output for "ens40" interface in the linux terminal:

root@s1:~# ip a
...
5: ens40: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:0c:29:f4:da:46 brd ff:ff:ff:ff:ff:ff
    inet 172.16.221.134/24 scope global ens40
       valid_lft forever preferred_lft forever
    inet 172.16.221.136/24 scope global secondary ens40
       valid_lft forever preferred_lft forever

and this is the ""get --filter-xpath /ietf-interfaces:*" output for the "ens40" interface:

<interface>                                                                                                                                [2/221]
      <name>ens40</name>                                                                                                                              
      <description/>                                                                                                                                  
      <type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>                                                    
      <enabled>true</enabled>                                              
      <oper-status>up</oper-status>
      <last-change>2022-08-24T09:31:48+00:00</last-change>                 
      <if-index>5</if-index>                                               
      <phys-address>00:0c:29:f4:da:46</phys-address>                       
      <speed>0</speed>                                                     
      <statistics>
        <discontinuity-time>2022-08-24T09:31:48+00:00</discontinuity-time> 
        <in-octets>60</in-octets>                                          
        <in-unicast-pkts>1</in-unicast-pkts>                               
        <in-broadcast-pkts>0</in-broadcast-pkts>                           
        <in-multicast-pkts>0</in-multicast-pkts>                           
        <in-discards>0</in-discards>
        <in-errors>0</in-errors>
        <in-unknown-protos>0</in-unknown-protos>
        <out-octets>60</out-octets>
        <out-unicast-pkts>1</out-unicast-pkts>
        <out-broadcast-pkts>0</out-broadcast-pkts>
        <out-multicast-pkts>0</out-multicast-pkts>
        <out-discards>0</out-discards>
        <out-errors>0</out-errors>
      </statistics>
      <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
        <enabled>true</enabled>
        <forwarding>false</forwarding>
        <address>
          <ip>172.16.221.134</ip>
          <prefix-length>24</prefix-length>
        </address>
      </ipv4>
    </interface>

as you can see "172.16.221.136/24" address doesn't exist in the netconf output.
is there exits any log or information which may help to find the root cause of the problem?

thanks in advance

@alireza11048
Copy link
Author

in the following previous post, it seems that the sysrpeo-interface plugin only updates the sysrepo datastore with the system interface setting when the sysrepo datastore is empty. in the below link you can see the related code part.
https://github.com/telekom/sysrepo-plugin-interfaces/blob/devel/src/interfaces/interfaces.c#L155

tnx

@feelqah
Copy link
Collaborator

feelqah commented Sep 13, 2022

Hi,
Sorry for the late reply!

We're currently doing a major refactor of the whole plugin, and this functionality will be added.
It's currently on the refactor branch, but will be merged soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants