Junos Automation (Scripting)
Highlighted
Junos Automation (Scripting)

Changing mutually exclusive fields

‎12-31-2019 04:41 AM

I suppose this applies just as much to the CLI, but I'm working on an edit-config statement where I submit some config options via netconf in XML. When trying to commit I'm getting the error: <nc:error-message>mgd: Family ethernet-switching and rest of the families are mutually exclusive</nc:error-message>.

 

I know how to fix this, but I'm wondering what the general approach for these types of things is. If the family is being changed from ethernet-switching to inet is it really ne cessary to remove the ethernet-switching family before committing? It seems like if they're mutually exclusive then there's no reason to not have it just simply change it from one value to another. 

4 REPLIES 4
Highlighted
Junos Automation (Scripting)

Re: Changing mutually exclusive fields

[ Edited ]
‎12-31-2019 04:53 AM

Hello,

 


ian.barrere@datavail.com wrote:

 

I know how to fix this, but I'm wondering what the general approach for these types of things is. If the family is being changed from ethernet-switching to inet is it really ne cessary to remove the ethernet-switching family before committing? 


 

The general approach is:

1/ L2 and L3 address families cannot coexist under a given interface unit. L2 families include  "family bridge", "family vpls" , "family ethernet-switching", "family ccc|tcc". L3 families include "family inet|inet6", "family mpls", "family iso" 

HOWEVER - JUNOS does check if configured address families are mutually exclusive but it does NOT displace existing family with newly added one, it only gives You a warning You already familiar with. 

2/ only 1 (single) L2 family can be configured under a given interface unit.

3/ multiple L3 families can coexist under a given interface unit.  

This is from my own experience.

HTH

Thx

Alex

 

 

 

_____________________________________________________________________

Please ask Your Juniper account team about Juniper Professional Services offerings.
Juniper PS can design, test & build the network/part of the network as per Your requirements

+++++++++++++++++++++++++++++++++++++++++++++

Accept as Solution = cool !
Accept as Solution+Kudo = You are a Star !
Highlighted
Junos Automation (Scripting)

Re: Changing mutually exclusive fields

‎12-31-2019 05:37 AM

Thanks for the response. I see what you're saying. So, there is no way to have junos displace an existing family with a given family? If that's the case I guess I will need to remove an existing L2 family first if I'd like to change it to an L3 family and vice versa.

Highlighted
Junos Automation (Scripting)

Re: Changing mutually exclusive fields

‎12-31-2019 05:42 AM

Hello,

 


ian.barrere@datavail.com wrote:

Thanks for the response. I see what you're saying. So, there is no way to have junos displace an existing family with a given family?


 

No, JUNOS does not support displacing families. But since Your question is related to automation, then it would be fairly easy to discover what families exist on a given interface unit and then build a config which deletes existing L2 family before adding an L3 family.

HTH

Thx

Alex

 

_____________________________________________________________________

Please ask Your Juniper account team about Juniper Professional Services offerings.
Juniper PS can design, test & build the network/part of the network as per Your requirements

+++++++++++++++++++++++++++++++++++++++++++++

Accept as Solution = cool !
Accept as Solution+Kudo = You are a Star !
Highlighted
Junos Automation (Scripting)

Re: Changing mutually exclusive fields

[ Edited ]
‎01-04-2020 02:33 PM

ian.barrere@datavail.com wrote:

Thanks for the response. I see what you're saying. So, there is no way to have junos displace an existing family with a given family? If that's the case I guess I will need to remove an existing L2 family first if I'd like to change it to an L3 family and vice versa.

 

If you can replace the configuration of the whole IFL, then you could do it like this:

<rpc>
  <edit-config>
    <target>
      <candidate/>
    </target>
    <config>
      <configuration>
        <interfaces>
          <interface>
            <name>xe-0/0/0</name>
            <unit operation="replace">
              <name>0</name>
              <family>
                <inet>
                  <dhcp>
                    <vendor-id>Juniper-qfx10002-72q</vendor-id>
                  </dhcp>
                </inet>
              </family>
            </unit>
          </interface>
        </interfaces>
      </configuration>
    </config>
  </edit-config>
</rpc>

 "replace" operation deletes the configuration hierarchy from that point on before merging the new configuration data into the configuration.

Feedback