Parcourir la source

FD3-471 template_docsis

Guillermo Espinoza il y a 7 ans
Parent
commit
c874bc6894

Fichier diff supprimé car celui-ci est trop grand
+ 1 - 1
app/DoctrineMigrations/Version20180124153518.yml


+ 2 - 2
composer.lock

@@ -1651,7 +1651,7 @@
             "source": {
             "source": {
                 "type": "git",
                 "type": "git",
                 "url": "ssh://git@gogs.infra.flowdat.com:222/VendorSoftwareFlowdat3/TemplateBundle.git",
                 "url": "ssh://git@gogs.infra.flowdat.com:222/VendorSoftwareFlowdat3/TemplateBundle.git",
-                "reference": "fd60276905b05e2fa3505f2654cab965261f7fa0"
+                "reference": "ddfae6a5b9f4b5560c0b47297a62700386d4ea35"
             },
             },
             "require": {
             "require": {
                 "ik/base-admin-bundle": "*"
                 "ik/base-admin-bundle": "*"
@@ -1669,7 +1669,7 @@
                 "bundle",
                 "bundle",
                 "template"
                 "template"
             ],
             ],
-            "time": "2018-01-25T16:10:26+00:00"
+            "time": "2018-02-08T13:03:04+00:00"
         },
         },
         {
         {
             "name": "ik/webservice-bundle",
             "name": "ik/webservice-bundle",

+ 8 - 1
docsis.sh

@@ -1,4 +1,11 @@
-apt-get install -yq automake libtool libsnmp-dev bison make gcc flex git libglib2.0-dev libfl-dev
+echo "deb http://http.us.debian.org/debian stable main contrib non-free" >> /etc/apt/sources.list
+
+apt-get update && apt-get install -yq automake libtool libsnmp-dev bison make gcc flex git libglib2.0-dev libfl-dev snmp-mibs-downloader
+
+echo "mibs +SNMPv2-MIB" >> /etc/snmp/snmp.conf
+download-mibs
+wget http://pastebin.com/raw/p3QyuXzZ -O /usr/share/snmp/mibs/SNMPv2-PDU
+wget https://raw.githubusercontent.com/rlaager/docsis/master/mibs/CLAB-TOPO-MIB  -O /usr/share/snmp/mibs/CLAB-TOPO-MIB
 
 
 cd /opt
 cd /opt
 
 

+ 3 - 0
src/CablemodemBundle/Command/InitDocsisTemplatesCommand.php

@@ -75,6 +75,9 @@ EOT
                 $this->em->persist($cablemodemModel);
                 $this->em->persist($cablemodemModel);
             }
             }
         }
         }
+        
+        // template docsis
+        $this->em->persist($this->getTemplate($path . "/template_docsis.tpl"));
 
 
         $this->em->flush();
         $this->em->flush();
 
 

+ 317 - 0
src/CablemodemBundle/Resources/docsis-templates/template_docsis.tpl

@@ -0,0 +1,317 @@
+Main {
+
+            NetworkAccess 1;
+            {if $object.profile.bsod_enabled and $object.bridgeGroup}
+            MaxCPE {$object.bridgeGroup.maxCpe};
+            GlobalPrivacyEnable 1;
+            {else}
+            MaxCPE {$max_cpe};
+            GlobalPrivacyEnable 0;
+            {/if}
+
+	    {if $SnmpCfgAccess1_ip && $SnmpCfgAccess1_netmask && $SnmpCfgAccess1_community}
+	    /***** SNMP CONFIGURATION ACCESS 1 - Flowdat Access *****/
+            SnmpMibObject docsDevNmAccessStatus.1 Integer 4; /* createAndGo */
+            SnmpMibObject docsDevNmAccessIp.1 IPAddress {$SnmpCfgAccess1_ip} ;
+            SnmpMibObject docsDevNmAccessIpMask.1 IPAddress {$SnmpCfgAccess1_netmask} ;
+            SnmpMibObject docsDevNmAccessControl.1 Integer 3; /* read and write */
+            SnmpMibObject docsDevNmAccessInterfaces.1 HexString 0x40; /* only cable iface */
+            SnmpMibObject docsDevNmAccessCommunity.1 String "{$SnmpCfgAccess1_community}"; /* community */
+	    {else}
+		{if $ServerProv_IP}
+		/***** SNMP CONFIGURATION ACCESS 1 - Flowdat Access *****/
+		SnmpMibObject docsDevNmAccessStatus.1 Integer 4; /* createAndGo */
+		SnmpMibObject docsDevNmAccessIp.1 IPAddress {$ServerProv_IP} ;
+		SnmpMibObject docsDevNmAccessIpMask.1 IPAddress 255.255.255.255 ;
+		SnmpMibObject docsDevNmAccessControl.1 Integer 3; /* read and write */
+		SnmpMibObject docsDevNmAccessInterfaces.1 HexString 0x40; /* only cable iface */
+		SnmpMibObject docsDevNmAccessCommunity.1 String "public"; /* community */
+		{/if}
+	    {/if}
+
+	    {if $SnmpCfgAccess2_ip && $SnmpCfgAccess2_netmask && $SnmpCfgAccess2_community}
+            /***** SNMP CONFIGURATION ACCESS 2 - CUSTOM *****/
+            SnmpMibObject docsDevNmAccessStatus.2 Integer 4; /* createAndGo */
+            SnmpMibObject docsDevNmAccessIp.2 IPAddress {$SnmpCfgAccess2_ip} ;
+            SnmpMibObject docsDevNmAccessIpMask.2 IPAddress {$SnmpCfgAccess2_netmask} ;
+            SnmpMibObject docsDevNmAccessControl.2 Integer 3; /* read and write */
+            SnmpMibObject docsDevNmAccessInterfaces.2 HexString 0x40; /* only cable iface */
+            SnmpMibObject docsDevNmAccessCommunity.2 String "{$SnmpCfgAccess2_community}"; /* community */
+	    {/if}
+
+    {if $model_template}
+       {$model_template}
+    {/if}
+
+    {if $object.profile.bsod_enabled and $object.bridgeGroup}
+    VendorSpecific{
+        VendorIdentifier 0xffffff;
+        GenericTLV TlvCode 5 TlvLength 13 TlvValue {$object.bridgeGroup.Tlv5};
+    }
+    {/if}
+
+
+    /*************************************
+    * Normal                             *
+    *************************************/
+    DsPacketClass{
+        ClassifierRef 1;
+            ServiceFlowRef 1;
+            RulePriority 1;
+            ActivationState 1;
+            IpPacketClassifier{
+            IpSrcAddr 0.0.0.0;
+            IpSrcMask 0.0.0.0;
+            IpDstAddr 0.0.0.0;
+            IpDstMask 0.0.0.0;
+            }
+    }/*ClassifierRef 2*/
+
+    DsServiceFlow{
+        DsServiceFlowRef 1;
+            QosParamSetType 7;
+            TrafficPriority 2;
+            MaxRateSustained {$downstream};
+    }/*DsServiceFlowRef 1*/
+
+    UsPacketClass{
+        ClassifierRef 2;
+            ServiceFlowRef 2;
+            RulePriority 1;
+            ActivationState 1;
+            IpPacketClassifier{
+            IpSrcAddr 0.0.0.0;
+                    IpSrcMask 0.0.0.0;
+                    IpDstAddr 0.0.0.0;
+                    IpDstMask 0.0.0.0;
+            }
+    }/*ClassifierRef 2*/
+
+    UsServiceFlow{
+        UsServiceFlowRef 2;
+            QosParamSetType 7;
+        TrafficPriority 2;
+        MaxRateSustained {$upstream};
+
+        {if $object.profile.bsod_enabled and $object.bridgeGroup}
+        GenericTLV TlvCode 43 TlvLength 14 TlvValue {$object.bridgeGroup.Tlv43};
+        {/if}
+
+    }/*UsServiceFlowRef 2*/
+
+    /*************************************
+    * HighPorts                          *
+    *************************************/
+    {if $filtro_download}
+    DsPacketClass{
+        ClassifierRef 3;
+        ServiceFlowRef 3;
+        RulePriority 3;
+        ActivationState 1;
+        IpPacketClassifier{
+            DstPortStart 0;
+            DstPortEnd 65535;
+            SrcPortStart 560;
+            SrcPortEnd 65535;
+        }
+    }/*ClassifierRef 3*/
+
+    DsServiceFlow{
+        DsServiceFlowRef 3;
+        QosParamSetType 7;
+        TrafficPriority 0;
+        MaxRateSustained {$filtro_download};
+    }/*DsServiceFlowRef 3*/
+
+    {/if}
+
+    {if $filtro_upload}
+
+    UsPacketClass{
+        ClassifierRef 4;
+        ServiceFlowRef 4;
+        RulePriority 2;
+        ActivationState 1;
+        IpPacketClassifier{
+            DstPortStart 560;
+            DstPortEnd 65535;
+            SrcPortStart 0;
+            SrcPortEnd 65535;
+        }
+    }/* ClassifierRef 4*/
+
+    UsServiceFlow{
+        UsServiceFlowRef 4;
+        QosParamSetType 7;
+        TrafficPriority 0;
+        MaxRateSustained {$filtro_upload};
+    }/*UsServiceFlowRef 4*/
+
+    {/if}
+
+    /*************************************
+    * ServerVOIP*
+    *************************************/
+    {if $ServerVoIP_IP}
+
+    DsPacketClass{
+       ClassifierRef 5;
+         ServiceFlowRef 5;
+         RulePriority 255;
+         ActivationState 1;
+         IpPacketClassifier{
+         IpSrcAddr {$ServerVoIP_IP};
+         IpSrcMask 255.255.255.255;
+    }}/*ClassifierRef 5*/
+
+    UsPacketClass{
+       ClassifierRef 6;
+         ServiceFlowRef 6;
+         RulePriority 200;
+         ActivationState 1;
+         IpPacketClassifier{
+         IpDstAddr {$ServerVoIP_IP};
+         IpDstMask 255.255.255.255;
+    }}/*ClassifierRef 6*/
+
+    {/if}
+
+    /*************************************
+    * ServerProv*
+    *************************************/
+
+    {if $ServerProv_IP}
+
+    DsPacketClass{
+      ClassifierRef 7;
+        ServiceFlowRef 5;
+        RulePriority 255;
+        ActivationState 1;
+        IpPacketClassifier{
+        IpSrcAddr {$ServerProv_IP};
+        IpSrcMask 255.255.255.255;
+    }}/*ClassifierRef 7*/
+
+    UsPacketClass{
+      ClassifierRef 8;
+        ServiceFlowRef 6;
+        RulePriority 200;
+        ActivationState 1;
+        IpPacketClassifier{
+        IpDstAddr {$ServerProv_IP};
+        IpDstMask 255.255.255.255;
+    }}/*ClassifierRef 8*/
+
+    {/if}
+
+    /*************************************
+    * IP/RED PARTICULAR #1 *
+    *************************************/
+
+    {if $Red1_a_excluir_ip  && $Red1_a_excluir_mascara}
+
+    DsPacketClass{
+      ClassifierRef 9;
+        ServiceFlowRef 5;
+        RulePriority 255;
+        ActivationState 1;
+        IpPacketClassifier{
+        IpSrcAddr {$Red1_a_excluir_ip};
+        IpSrcMask {$Red1_a_excluir_mascara};
+    }}/*ClassifierRef 9*/
+
+    UsPacketClass{
+      ClassifierRef 10;
+        ServiceFlowRef 6;
+        RulePriority 200;
+        ActivationState 1;
+        IpPacketClassifier{
+        IpDstAddr {$Red1_a_excluir_ip};
+        IpDstMask {$Red1_a_excluir_mascara};
+     }}/*ClassifierRef 10*/
+
+    {/if}
+
+    /*************************************
+    * IP/RED PARTICULAR #2 *
+    *************************************/
+
+    {if $Red2_a_excluir_ip && $Red2_a_excluir_mascara}
+
+    DsPacketClass{
+      ClassifierRef 11;
+        ServiceFlowRef 5;
+        RulePriority 255;
+        ActivationState 1;
+        IpPacketClassifier{
+        IpSrcAddr {$Red2_a_excluir_ip};
+        IpSrcMask {$Red2_a_excluir_mascara};
+    }}/*ClassifierRef 11*/
+
+    UsPacketClass{
+      ClassifierRef 12;
+        ServiceFlowRef 6;
+        RulePriority 200;
+        ActivationState 1;
+        IpPacketClassifier{
+        IpDstAddr {$Red2_a_excluir_ip};
+        IpDstMask {$Red2_a_excluir_mascara};
+    }}/*ClassifierRef 12*/
+
+    {/if}
+
+    /*************************************
+    * IP y MASCARA de RED VOIP *
+    *************************************/
+
+    {if $RedVOIP_ip  && $RedVOIP_mascara}
+
+    DsPacketClass{
+      ClassifierRef 13;
+        ServiceFlowRef 5;
+        RulePriority 255;
+        ActivationState 1;
+        IpPacketClassifier{
+        IpSrcAddr {$RedVOIP_ip};
+        IpSrcMask {$RedVOIP_mascara};
+    }}/*ClassifierRef 13*/
+
+    UsPacketClass{
+      ClassifierRef 14;
+        ServiceFlowRef 6;
+        RulePriority 200;
+        ActivationState 1;
+        IpPacketClassifier{
+        IpDstAddr {$RedVOIP_ip};
+        IpDstMask {$RedVOIP_mascara};
+    }}/*ClassifierRef 14*/
+
+    {/if}
+
+    /*************************************
+    * ESPECIAL SERVICE FLOW *
+    *************************************/
+
+     DsServiceFlow{
+         DsServiceFlowRef 5;
+         QosParamSetType 7;
+         TrafficPriority 7;
+	{if $DS_MaxRateSustained}
+             MaxRateSustained {$DS_MaxRateSustained};
+	{else}
+             MaxRateSustained 1000000;
+	{/if}
+     }/*DsServiceFlowRef 5*/
+
+     UsServiceFlow{
+       UsServiceFlowRef 6;
+         QosParamSetType 7;
+         TrafficPriority 7;
+	{if $US_MaxRateSustained}
+             MaxRateSustained {$US_MaxRateSustained};
+	{else}
+             MaxRateSustained 1000000;
+	{/if}
+     }/*UsServiceFlowRef 6*/
+
+}/*main*/