├── apicdhcp2r.pcap ├── README.md ├── 92160-EAST-running-configv2.txt ├── 92160-WEST-running-configv2.txt ├── mpod-base.py └── mpod-phys.py /apicdhcp2r.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joezersk/aci-multipod/HEAD/apicdhcp2r.pcap -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # aci-multipod 2 |
3 | There are four files here in two logical groups. The two text files are the running configs of my IPN Nexus 9200 series standlone switches. Use these as example to build up your own IPN devices. Key areas to look at are setting up PIM, DHCP-Relay, MTU of 9150, and OSPF. 4 |
5 | UPDATE OCT 2017 6 |
7 | The response to my multipod videos and this repo has grown beyond my intial expectations and I am truly flattered. That is good news for ACI but it brings a problem too. The configs you see here are examples only. What is germaine to my own lab and config style might not exactly match your environment. My only sincere request is not to take what you find here verbatim, but use it, and review the configs in the context of your own setup and make appropiate decisons to adapt it for what works for you. Ask questions! Does this config make sense for me? Should I use a different mask, etc etc. 8 |
9 | I also uploaded a PCAP file that captures the DHCP exchange when discovering the first spine in a remote pod. 10 | 11 |
12 |
14 | UPDATE DEC 2016 15 |
16 | I have updated my IPN config to use an optional (but recommended) vrf just for the multipod stuff. Please review the running config files in version 2 in this repo. Also note some PIM commands now moved to the dedicated vrf context. 17 |
18 |
20 | The two python scripts are those used in my own lab to setup the OSPF adjacency to IPN (mpod-base.py) and the other to setup the physical front-panel ports (i.e complete the MP-BGP control plane) on the ACI fabric used by the spines towards the IPN (mpod-phys.py). Please note that the scripts use values that are specific to my own setup. You will need to edit them to match the ports, ip addresses and settings in your own environment. 21 |
22 | Also, you must have already installed the ACI COBRA SDK on the system where you will run this. 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /92160-EAST-running-configv2.txt: -------------------------------------------------------------------------------- 1 | # Show run of IPN EAST running config with all unrelated items edited out for clarity # 2 | 3 | 92160-IPN-EAST# 4 | 5 | !Command: show running-config 6 | !Running configuration last done at: Mon Nov 30 18:09:17 2020 7 | !Time: Fri Dec 18 10:04:35 2020 8 | 9 | version 9.3(2) Bios:version 07.66 10 | power redundancy-mode combined force 11 | hardware profile multicast max-limit lpm-entries 0 12 | 13 | hostname 92160-IPN-EAST 14 | policy-map type network-qos jumbo 15 | class type network-qos class-default 16 | mtu 9216 17 | 18 | feature telnet 19 | feature nxapi 20 | feature bash-shell 21 | feature scp-server 22 | feature sftp-server 23 | feature ospf 24 | feature pim 25 | feature interface-vlan 26 | feature dhcp 27 | feature lldp 28 | feature bfd 29 | clock timezone CET 1 0 30 | clock summer-time CEST 2 Sun Mar 02:00 1 Sun Nov 02:00 60 31 | 32 | banner motd ^ 33 | ############################ 34 | This is IPN-EAST 35 | ############################ 36 | ^ 37 | 38 | system qos 39 | service-policy type network-qos jumbo 40 | 41 | service dhcp 42 | ip dhcp relay 43 | vrf context tn-infra 44 | ip pim rp-address 12.1.1.1 group-list 225.0.0.0/8 bidir 45 | ip pim rp-address 12.1.1.1 group-list 239.255.255.240/28 bidir 46 | ip pim ssm range 232.0.0.0/8 47 | 48 | interface Ethernet1/49 49 | description 40G link from SPINE-2 to IPN 50 | no switchport 51 | mtu 9150 52 | vrf member tn-infra 53 | no shutdown 54 | 55 | interface Ethernet1/49.4 56 | description 40G link from SPINE-2 to IPN 57 | mtu 9150 58 | encapsulation dot1q 4 59 | vrf member tn-infra 60 | ip address 203.1.1.2/30 61 | ip ospf network point-to-point 62 | ip ospf mtu-ignore 63 | ip router ospf a1 area 0.0.0.0 64 | ip ospf bfd 65 | ip pim sparse-mode 66 | ip dhcp relay address 10.0.0.1 67 | no shutdown 68 | 69 | interface Ethernet1/49.5 70 | description Sub-Int for ACI Remote Leaf 71 | mtu 9150 72 | encapsulation dot1q 5 73 | vrf member rleaf 74 | ip address 10.50.238.30/30 75 | ip ospf network point-to-point 76 | ip ospf mtu-ignore 77 | ip router ospf rleaf area 0.0.0.0 78 | ip ospf bfd 79 | no shutdown 80 | 81 | interface loopback99 82 | vrf member tn-infra 83 | ip address 12.1.1.2/29 84 | ip ospf network point-to-point 85 | ip router ospf a1 area 0.0.0.0 86 | ip pim sparse-mode 87 | 88 | router ospf a1 89 | bfd 90 | router-id 222.1.1.2 91 | log-adjacency-changes detail 92 | vrf tn-infra 93 | 94 | 92160-IPN-EAST# 95 | -------------------------------------------------------------------------------- /92160-WEST-running-configv2.txt: -------------------------------------------------------------------------------- 1 | !Command: show running-config 2 | !Time: Fri Dec 2 10:56:54 2016 3 | 4 | version 7.0(3)I4(3) 5 | switchname 92160-WEST 6 | policy-map type network-qos jumbo 7 | class type network-qos class-default 8 | mtu 9150 9 | 10 | feature telnet 11 | feature nxapi 12 | feature bash-shell 13 | feature ospf 14 | feature pim 15 | feature interface-vlan 16 | feature dhcp 17 | feature lldp 18 | 19 | username admin password 5 $5$CMEGJP$.lMXvOdJLCugtGKSR6ThvBKDtT7LDizQpgz7B69R2L5 role network-admin 20 | no ip domain-lookup 21 | ip name-server 173.38.200.100 22 | system default switchport 23 | 24 | system qos 25 | service-policy type network-qos jumbo 26 | copp profile strict 27 | rmon event 1 log trap public description FATAL(1) owner PMON@FATAL 28 | rmon event 2 log trap public description CRITICAL(2) owner PMON@CRITICAL 29 | rmon event 3 log trap public description ERROR(3) owner PMON@ERROR 30 | rmon event 4 log trap public description WARNING(4) owner PMON@WARNING 31 | rmon event 5 log trap public description INFORMATION(5) owner PMON@INFO 32 | snmp-server community insbu group network-admin 33 | ntp server 173.38.201.115 34 | 35 | ip pim ssm range 232.0.0.0/8 36 | vlan 1-5,10 37 | vlan 2 38 | name 100G-ROUTED-NEW 39 | vlan 3 40 | name CISCO-LAB-GATEWAY 41 | vlan 4 42 | name 40G-IPN-NEW 43 | vlan 5 44 | name Link-to-N5K 45 | vlan 10 46 | name 10.50.129.x 47 | 48 | service dhcp 49 | ip dhcp relay 50 | no ipv6 dhcp relay 51 | vrf context management 52 | ip route 0.0.0.0/0 10.50.129.254 53 | vrf context tn-infra 54 | ip pim rp-address 12.1.1.1 group-list 225.0.0.0/8 bidir 55 | ip pim rp-address 12.1.1.1 group-list 239.255.255.240/28 bidir 56 | ip pim ssm range 232.0.0.0/8 57 | 58 | hardware profile portmode 48x25G+2x100G+4x40G 59 | 60 | hardware profile multicast max-limit lpm-entries 0 61 | vlan configuration 3 62 | 63 | 64 | interface Vlan1 65 | 66 | interface Vlan3 67 | description /30 link to AMS-LAB-GW1 (10.61.2.5) 68 | no shutdown 69 | ip address 10.61.2.6/30 70 | ip pim sparse-mode 71 | 72 | interface Vlan5 73 | description Inter-router VLAN to N5K 74 | no shutdown 75 | mtu 9150 76 | ip address 9.9.9.1/24 77 | ip ospf mtu-ignore 78 | ip router ospf 1 area 0.0.0.1 79 | 80 | interface Ethernet1/1 81 | description /30 link to AMS-LAB-GW1 (10.61.2.5) 82 | switchport access vlan 3 83 | spanning-tree port type edge 84 | speed 1000 85 | 86 | interface Ethernet1/2 87 | description link to N5500-LAB 88 | switchport mode trunk 89 | spanning-tree port type network 90 | 91 | interface Ethernet1/3 92 | 93 | interface Ethernet1/4 94 | 95 | #snip unused interfaces for brevity# 96 | 97 | interface Ethernet1/48 98 | 99 | interface Ethernet1/49 100 | description 40G link from SPINE-1 to IPN 101 | no switchport 102 | mtu 9150 103 | vrf member tn-infra 104 | no shutdown 105 | 106 | interface Ethernet1/49.4 107 | description 40G link from SPINE-2 to IPN 108 | mtu 9150 109 | encapsulation dot1q 4 110 | vrf member tn-infra 111 | ip address 202.1.1.2/30 112 | ip ospf network point-to-point 113 | ip ospf mtu-ignore 114 | ip router ospf a1 area 0.0.0.0 115 | ip pim sparse-mode 116 | ip dhcp relay address 10.0.0.1 117 | no shutdown 118 | 119 | interface Ethernet1/50 120 | 121 | interface Ethernet1/51 122 | 123 | interface Ethernet1/52 124 | description 100G interlink to 92160-EAST 125 | no switchport 126 | speed 100000 127 | duplex full 128 | mtu 9150 129 | no negotiate auto 130 | vrf member tn-infra 131 | ip address 92.92.92.1/30 132 | ip ospf network point-to-point 133 | ip router ospf a1 area 0.0.0.0 134 | ip pim sparse-mode 135 | no shutdown 136 | 137 | interface Ethernet1/53 138 | 139 | interface Ethernet1/54 140 | 141 | interface mgmt0 142 | vrf member management 143 | ip address 10.50.129.45/24 144 | 145 | interface loopback99 146 | vrf member tn-infra 147 | ip address 12.1.1.1/32 148 | ip router ospf a1 area 0.0.0.0 149 | ip pim sparse-mode 150 | clock timezone CET 1 0 151 | clock summer-time CEST 2 Sun Mar 02:00 1 Sun Nov 02:00 60 152 | cli alias name wr copy run start 153 | line console 154 | line vty 155 | exec-timeout 300 156 | boot nxos bootflash:/nxos.7.0.3.I4.3.bin 157 | ip route 0.0.0.0/0 10.61.2.5 158 | ip route 10.50.128.0/23 9.9.9.2 159 | router ospf 1 160 | router-id 93.93.93.1 161 | area 0.0.0.1 nssa no-summary 162 | area 0.0.0.1 range 0.0.0.0/0 163 | router ospf a1 164 | router-id 93.93.93.2 165 | log-adjacency-changes detail 166 | vrf tn-infra 167 | no system default switchport shutdown 168 | logging monitor 7 169 | no logging console 170 | 171 | -------------------------------------------------------------------------------- /mpod-base.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # list of packages that should be imported for this code to work 4 | import cobra.mit.access 5 | import cobra.mit.request 6 | import cobra.mit.session 7 | import cobra.model.bgp 8 | import cobra.model.ctrlr 9 | import cobra.model.dbg 10 | import cobra.model.fabric 11 | import cobra.model.fv 12 | import cobra.model.l3ext 13 | import cobra.model.ospf 14 | import cobra.model.pol 15 | from cobra.internal.codec.xmlcodec import toXMLStr 16 | 17 | # log into an APIC and create a directory object 18 | ls = cobra.mit.session.LoginSession('https://1.1.1.1', 'admin', 'cisco123') 19 | md = cobra.mit.access.MoDirectory(ls) 20 | md.login() 21 | 22 | # the top level object on which operations will be made 23 | topMo = cobra.model.pol.Uni('') 24 | 25 | # build the request using cobra syntax 26 | fabricInst = cobra.model.fabric.Inst(topMo) 27 | dbgOngoingAcMode = cobra.model.dbg.OngoingAcMode(fabricInst, mode='path', name='default') 28 | 29 | c = cobra.mit.request.ConfigRequest() 30 | c.addMo(fabricInst) 31 | md.commit(c) 32 | 33 | fvTenant = cobra.model.fv.Tenant(topMo, name='infra') 34 | fvFabricExtConnP = cobra.model.fv.FabricExtConnP(fvTenant, rt='extended:as2-nn4:11:22', id='1', name='fabricExtConnPolName_9a92763eadbe259d') 35 | fvPodConnP = cobra.model.fv.PodConnP(fvFabricExtConnP, id='2') 36 | fvIp = cobra.model.fv.Ip(fvPodConnP, addr='200.1.1.1/32') 37 | fvPodConnP2 = cobra.model.fv.PodConnP(fvFabricExtConnP, id='1') 38 | fvIp2 = cobra.model.fv.Ip(fvPodConnP2, addr='100.1.1.1/32') 39 | l3extFabricExtRoutingP = cobra.model.l3ext.FabricExtRoutingP(fvFabricExtConnP, name='MPOD_EXT_ROUTE_PROFILE') 40 | l3extSubnet = cobra.model.l3ext.Subnet(l3extFabricExtRoutingP, ip='202.1.0.0/16') 41 | l3extSubnet2 = cobra.model.l3ext.Subnet(l3extFabricExtRoutingP, ip='203.1.0.0/16') 42 | fvPeeringP = cobra.model.fv.PeeringP(fvFabricExtConnP, type='automatic_with_full_mesh') 43 | ospfIfPol = cobra.model.ospf.IfPol(fvTenant, nwT='p2p', pfxSuppress='inherit', name='MPOD_OSPF_P2P', prio='1', ctrl='advert-subnet,mtu-ignore', helloIntvl='10', rexmitIntvl='5', xmitDelay='1', cost='unspecified', deadIntvl='40') 44 | l3extOut = cobra.model.l3ext.Out(fvTenant, name='MPOD_OSPF_OUT', enforceRtctrl='export', targetDscp='unspecified') 45 | l3extRsEctx = cobra.model.l3ext.RsEctx(l3extOut, tnFvCtxName='overlay-1') 46 | l3extLNodeP = cobra.model.l3ext.LNodeP(l3extOut, tag='yellow-green', name='MPOD_OSPF_NODES', targetDscp='unspecified') 47 | l3extRsNodeL3OutAtt = cobra.model.l3ext.RsNodeL3OutAtt(l3extLNodeP, tDn='topology/pod-2/node-202', rtrId='222.222.222.222', rtrIdLoopBack='yes') 48 | l3extInfraNodeP = cobra.model.l3ext.InfraNodeP(l3extRsNodeL3OutAtt, fabricExtCtrlPeering='yes') 49 | l3extLoopBackIfP = cobra.model.l3ext.LoopBackIfP(l3extRsNodeL3OutAtt, addr='222.222.222.222') 50 | l3extRsNodeL3OutAtt2 = cobra.model.l3ext.RsNodeL3OutAtt(l3extLNodeP, tDn='topology/pod-1/node-201', rtrId='111.111.111.111', rtrIdLoopBack='yes') 51 | l3extInfraNodeP2 = cobra.model.l3ext.InfraNodeP(l3extRsNodeL3OutAtt2, fabricExtCtrlPeering='yes') 52 | l3extLoopBackIfP2 = cobra.model.l3ext.LoopBackIfP(l3extRsNodeL3OutAtt2, addr='111.111.111.111') 53 | l3extLIfP = cobra.model.l3ext.LIfP(l3extLNodeP, tag='yellow-green', name='MPOD_OSPF_INTS') 54 | ospfIfP = cobra.model.ospf.IfP(l3extLIfP, authKeyId='1', authType='none') 55 | ospfRsIfPol = cobra.model.ospf.RsIfPol(ospfIfP, tnOspfIfPolName='MPOD_OSPF_P2P') 56 | l3extRsNdIfPol = cobra.model.l3ext.RsNdIfPol(l3extLIfP) 57 | l3extRsIngressQosDppPol = cobra.model.l3ext.RsIngressQosDppPol(l3extLIfP) 58 | l3extRsEgressQosDppPol = cobra.model.l3ext.RsEgressQosDppPol(l3extLIfP) 59 | l3extRsPathL3OutAtt = cobra.model.l3ext.RsPathL3OutAtt(l3extLIfP, tDn='topology/pod-2/paths-202/pathep-[eth1/20]', targetDscp='unspecified', encapScope='local', llAddr='::', mac='00:22:BD:F8:19:FF', mode='regular', encap='vlan-4', ifInstT='sub-interface', mtu='inherit', addr='203.1.1.1/30') 60 | l3extRsPathL3OutAtt2 = cobra.model.l3ext.RsPathL3OutAtt(l3extLIfP, tDn='topology/pod-1/paths-201/pathep-[eth1/20]', targetDscp='unspecified', encapScope='local', llAddr='::', mac='00:22:BD:F8:19:FF', mode='regular', encap='vlan-4', ifInstT='sub-interface', mtu='inherit', addr='202.1.1.1/30') 61 | l3extInstP = cobra.model.l3ext.InstP(l3extOut, matchT='AtleastOne', name='l3extInstPNamee75ff0551285bf11', prio='unspecified', targetDscp='unspecified') 62 | fvRsCustQosPol = cobra.model.fv.RsCustQosPol(l3extInstP) 63 | bgpExtP = cobra.model.bgp.ExtP(l3extOut) 64 | ospfExtP = cobra.model.ospf.ExtP(l3extOut, areaCtrl='redistribute,summary', areaType='regular', areaCost='1', areaId='backbone') 65 | 66 | c = cobra.mit.request.ConfigRequest() 67 | c.addMo(fvTenant) 68 | md.commit(c) 69 | 70 | 71 | ctrlrInst = cobra.model.ctrlr.Inst(topMo) 72 | fabricSetupPol = cobra.model.fabric.SetupPol(ctrlrInst, name='default') 73 | fabricSetupP = cobra.model.fabric.SetupP(fabricSetupPol, tepPool='10.1.0.0/16', podId='2') 74 | 75 | 76 | # commit the generated code to APIC 77 | #print toXMLStr(topMo) 78 | c = cobra.mit.request.ConfigRequest() 79 | c.addMo(ctrlrInst) 80 | md.commit(c) 81 | 82 | -------------------------------------------------------------------------------- /mpod-phys.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # list of packages that should be imported for this code to work 4 | import cobra.mit.access 5 | import cobra.mit.request 6 | import cobra.mit.session 7 | import cobra.model.bgp 8 | import cobra.model.dhcp 9 | import cobra.model.fabric 10 | import cobra.model.fv 11 | import cobra.model.fvns 12 | import cobra.model.infra 13 | import cobra.model.l3ext 14 | import cobra.model.pol 15 | from cobra.internal.codec.xmlcodec import toXMLStr 16 | 17 | # log into an APIC and create a directory object 18 | ls = cobra.mit.session.LoginSession('https://1.1.1.1', 'admin', 'cisco123') 19 | md = cobra.mit.access.MoDirectory(ls) 20 | md.login() 21 | 22 | # the top level object on which operations will be made 23 | topMo = cobra.model.pol.Uni('') 24 | 25 | # build the request using cobra syntax 26 | infraInfra = cobra.model.infra.Infra(topMo) 27 | infraFuncP = cobra.model.infra.FuncP(infraInfra, name='default') 28 | infraSpAccPortGrp = cobra.model.infra.SpAccPortGrp(infraFuncP, name='MPOD-SPINE2-PG') 29 | infraRsCdpIfPol = cobra.model.infra.RsCdpIfPol(infraSpAccPortGrp) 30 | infraRsAttEntP = cobra.model.infra.RsAttEntP(infraSpAccPortGrp, tDn='uni/infra/attentp-MPOD_AAEP') 31 | infraRsHIfPol = cobra.model.infra.RsHIfPol(infraSpAccPortGrp) 32 | infraSpAccPortGrp2 = cobra.model.infra.SpAccPortGrp(infraFuncP, name='MPOD-SPINE1-PG') 33 | infraRsCdpIfPol2 = cobra.model.infra.RsCdpIfPol(infraSpAccPortGrp2) 34 | infraRsAttEntP2 = cobra.model.infra.RsAttEntP(infraSpAccPortGrp2, tDn='uni/infra/attentp-MPOD_AAEP') 35 | infraRsHIfPol2 = cobra.model.infra.RsHIfPol(infraSpAccPortGrp2) 36 | fvnsVlanInstP = cobra.model.fvns.VlanInstP(infraInfra, name='MPOD_VLANS', allocMode='static') 37 | fvnsEncapBlk = cobra.model.fvns.EncapBlk(fvnsVlanInstP, to='vlan-4', from_='vlan-4', allocMode='inherit') 38 | infraAttEntityP = cobra.model.infra.AttEntityP(infraInfra, name='MPOD_AAEP') 39 | infraProvAcc = cobra.model.infra.ProvAcc(infraAttEntityP, name='provacc') 40 | dhcpInfraProvP = cobra.model.dhcp.InfraProvP(infraProvAcc, mode='controller') 41 | infraRsFuncToEpg = cobra.model.infra.RsFuncToEpg(infraProvAcc, mode='regular', tDn='uni/tn-infra/ap-access/epg-default', encap='vlan-3456', primaryEncap='unknown') 42 | infraRsDomP = cobra.model.infra.RsDomP(infraAttEntityP, tDn='uni/l3dom-MPOD_L3_DOMAIN') 43 | infraSpineP = cobra.model.infra.SpineP(infraInfra, name='MPOD-S2-SWITCH') 44 | infraSpineS = cobra.model.infra.SpineS(infraSpineP, type='range', name='SPINE2') 45 | infraNodeBlk = cobra.model.infra.NodeBlk(infraSpineS, from_='202', name='05183e5184f05c0e', to_='202') 46 | infraRsSpAccPortP = cobra.model.infra.RsSpAccPortP(infraSpineP, tDn='uni/infra/spaccportprof-MPOD-S2-ETH20') 47 | infraSpineP2 = cobra.model.infra.SpineP(infraInfra, name='MPOD-S1-SWITCH') 48 | infraSpineS2 = cobra.model.infra.SpineS(infraSpineP2, type='range', name='SPINE1') 49 | infraNodeBlk2 = cobra.model.infra.NodeBlk(infraSpineS2, from_='201', name='7eb0b8ef28c813b6', to_='201') 50 | infraRsSpAccPortP2 = cobra.model.infra.RsSpAccPortP(infraSpineP2, tDn='uni/infra/spaccportprof-MPOD-S1-ETH20') 51 | infraSpAccPortP = cobra.model.infra.SpAccPortP(infraInfra, name='MPOD-S2-ETH20') 52 | infraSHPortS = cobra.model.infra.SHPortS(infraSpAccPortP, type='range', name='ETH1-20') 53 | infraPortBlk = cobra.model.infra.PortBlk(infraSHPortS, name='block2', fromPort='20', fromCard='1', toPort='20', toCard='1') 54 | infraRsSpAccGrp = cobra.model.infra.RsSpAccGrp(infraSHPortS, tDn='uni/infra/funcprof/spaccportgrp-MPOD-SPINE2-PG') 55 | infraSpAccPortP2 = cobra.model.infra.SpAccPortP(infraInfra, name='MPOD-S1-ETH20') 56 | infraSHPortS2 = cobra.model.infra.SHPortS(infraSpAccPortP2, type='range', name='ETH1_20') 57 | infraPortBlk2 = cobra.model.infra.PortBlk(infraSHPortS2, name='block2', fromPort='20', fromCard='1', toPort='20', toCard='1') 58 | infraRsSpAccGrp2 = cobra.model.infra.RsSpAccGrp(infraSHPortS2, tDn='uni/infra/funcprof/spaccportgrp-MPOD-SPINE1-PG') 59 | 60 | 61 | c = cobra.mit.request.ConfigRequest() 62 | c.addMo(infraInfra) 63 | md.commit(c) 64 | 65 | fvTenant = cobra.model.fv.Tenant(topMo, name='infra') 66 | l3extOut = cobra.model.l3ext.Out(fvTenant, name='MPOD_OSPF_OUT', enforceRtctrl='export', targetDscp='unspecified') 67 | l3extRsL3DomAtt = cobra.model.l3ext.RsL3DomAtt(l3extOut, tDn='uni/l3dom-MPOD_L3_DOMAIN') 68 | 69 | c = cobra.mit.request.ConfigRequest() 70 | c.addMo(fvTenant) 71 | md.commit(c) 72 | 73 | fabricInst = cobra.model.fabric.Inst(topMo) 74 | fabricFuncP = cobra.model.fabric.FuncP(fabricInst) 75 | fabricPodPGrp = cobra.model.fabric.PodPGrp(fabricFuncP, name='HOUSEKEEPING_GROUP') 76 | fabricRsPodPGrpIsisDomP = cobra.model.fabric.RsPodPGrpIsisDomP(fabricPodPGrp) 77 | fabricRsPodPGrpBGPRRP = cobra.model.fabric.RsPodPGrpBGPRRP(fabricPodPGrp, tnBgpInstPolName='default') 78 | fabricRsTimePol = cobra.model.fabric.RsTimePol(fabricPodPGrp) 79 | fabricRsCommPol = cobra.model.fabric.RsCommPol(fabricPodPGrp) 80 | fabricRsPodPGrpCoopP = cobra.model.fabric.RsPodPGrpCoopP(fabricPodPGrp) 81 | fabricRsSnmpPol = cobra.model.fabric.RsSnmpPol(fabricPodPGrp) 82 | bgpInstPol = cobra.model.bgp.InstPol(fabricInst, name='default') 83 | bgpRRP = cobra.model.bgp.RRP(bgpInstPol) 84 | bgpRRNodePEp = cobra.model.bgp.RRNodePEp(bgpRRP, id='202', podId='1') 85 | bgpRRNodePEp2 = cobra.model.bgp.RRNodePEp(bgpRRP, id='201', podId='1') 86 | bgpAsP = cobra.model.bgp.AsP(bgpInstPol, asn='65001') 87 | fabricPodP = cobra.model.fabric.PodP(fabricInst, name='default') 88 | fabricPodS = cobra.model.fabric.PodS(fabricPodP, type='ALL', name='default') 89 | fabricRsPodPGrp = cobra.model.fabric.RsPodPGrp(fabricPodS, tDn='uni/fabric/funcprof/podpgrp-HOUSEKEEPING_GROUP') 90 | 91 | c = cobra.mit.request.ConfigRequest() 92 | c.addMo(fabricInst) 93 | md.commit(c) 94 | 95 | l3extDomP = cobra.model.l3ext.DomP(topMo, name='MPOD_L3_DOMAIN') 96 | infraRsVlanNs = cobra.model.infra.RsVlanNs(l3extDomP, tDn='uni/infra/vlanns-[MPOD_VLANS]-static') 97 | 98 | 99 | # commit the generated code to APIC 100 | #print toXMLStr(topMo) 101 | c = cobra.mit.request.ConfigRequest() 102 | c.addMo(l3extDomP) 103 | md.commit(c) 104 | 105 | --------------------------------------------------------------------------------