guides:user:l3vpn:l3vpn
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
guides:user:l3vpn:l3vpn [2022/04/29 07:42] – [Command Job] yspeerte | guides:user:l3vpn:l3vpn [2024/07/03 12:31] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== L3 VPN Example ====== | ||
+ | |||
+ | This is a very detailed example on how to build a L3 VPN, but could be anything, from scratch. This includes service types, templates, relations, scenarios, jobs, etc... | ||
+ | |||
+ | ===== L3 VPN Create ===== | ||
+ | |||
+ | |||
+ | The use case for which we are going to develop an end to end workflow is of provisioning a L3VPN. The Topology is as shown below. | ||
+ | |||
+ | {{guides: | ||
+ | |||
+ | * SW1, R1, R2, R3 and R4 are P Routers in a CSP named CSP | ||
+ | * PE1 and PE2 are PE routers | ||
+ | * The CE routers CEA1 for CustA and CEB1 for CustB are connected to PE1 | ||
+ | * Similarly, the CE routers CEA2 for CustA and CEB2 for CustB are connected to PE2 | ||
+ | |||
+ | CustA want a L3VPN from CEA1 to CEA2 and CustB want a L3VPN from CEB1 to CEB2. | ||
+ | |||
+ | To go about delivering L3VPNs in CSP network, we have to perform following steps. | ||
+ | - Create [[menu: | ||
+ | - Create [[menu: | ||
+ | - Create [[menu: | ||
+ | - Create [[menu: | ||
+ | - (optional) Create Form. | ||
+ | |||
+ | Some populating the database steps are necessary before we start with Service Type. They are: | ||
+ | - Create [[menu: | ||
+ | - Create [[menu: | ||
+ | - Add [[menu: | ||
+ | - Add [[menu: | ||
+ | - Add [[menu: | ||
+ | |||
+ | ==== Step 1 ==== | ||
+ | * Create Client Type | ||
+ | * Provide details below : | ||
+ | * Client Type : CSP | ||
+ | * Description : Communications Service Provider | ||
+ | |||
+ | ==== Step 2 ==== | ||
+ | * Create Site Type | ||
+ | * Create three Site Types. | ||
+ | - for CE (with Static Routing and No Redundancy) | ||
+ | - for PE | ||
+ | - for CE (generic) | ||
+ | |||
+ | === Static_No_Redundancy === | ||
+ | * Site Type: Static_No_Redundancy | ||
+ | * Caption: Static_No_Redundancy | ||
+ | === PE === | ||
+ | * Site Type: PE | ||
+ | * Caption: PE | ||
+ | === CE === | ||
+ | * Site Type: CE | ||
+ | * Caption: CE | ||
+ | |||
+ | ==== Step 3 ==== | ||
+ | * Create Service Class | ||
+ | * Now edit the Site Type " | ||
+ | * And add the two Site Types PE and CE recently created to Service Class by clicking the button " | ||
+ | ==== Step 4 ==== | ||
+ | Create Node Class and Node Types | ||
+ | We need to create two Node class and node types for PE and CE respectively as below: \\ | ||
+ | === PE_C7600 === | ||
+ | * Client Type : CSP | ||
+ | * Service Class : PE | ||
+ | * Node Class: PE_C7600 | ||
+ | |||
+ | === CE_ISR3800 === | ||
+ | * Client Type : CSP | ||
+ | * Service Class : CE | ||
+ | * Node Class: CE_ISR3800 | ||
+ | |||
+ | ==== Step 5 ==== | ||
+ | Create Node Types | ||
+ | === C7600 === | ||
+ | * Client Type: CSP | ||
+ | * Node Class: PE_C7600 | ||
+ | * Node Type: C7600 | ||
+ | |||
+ | === ISR3800 === | ||
+ | * Client Type: CSP | ||
+ | * Node Class: CE_ISR3800 | ||
+ | * Node Type: ISR3800 | ||
+ | |||
+ | Now, for both the Node Types, Pls edit/update the following details \\ | ||
+ | == For Node Type: C7600 == | ||
+ | * Parameter: Template | ||
+ | * Function: literal | ||
+ | * Value1: C7600 | ||
+ | |||
+ | * Parameter: Node_Position | ||
+ | * Function: literal | ||
+ | * Value1: NA | ||
+ | |||
+ | * Parameter: Domain | ||
+ | * Function: literal | ||
+ | * Value1: BOM | ||
+ | |||
+ | * Parameter: Enable_secret | ||
+ | * Function: literal | ||
+ | * Value1: netyce01 (must match what is on the real device' | ||
+ | |||
+ | == For Node Type: ISR3800 == | ||
+ | * Parameter: Template | ||
+ | * Function: literal | ||
+ | * Value1: isr3800 | ||
+ | |||
+ | * Parameter: Node_Position | ||
+ | * Function: literal | ||
+ | * Value1: ZA | ||
+ | |||
+ | * Parameter: Domain | ||
+ | * Function: literal | ||
+ | * Value1: BOM | ||
+ | |||
+ | * Parameter: Enable_secret | ||
+ | * Function: literal | ||
+ | * Value1: netyce01 (must match what is on the real device' | ||
+ | |||
+ | ==== Step 6 ==== | ||
+ | Create IPv4 Plans \\ | ||
+ | Click New and provide following details: \\ | ||
+ | === Loopbacks === | ||
+ | === PE_Loopback === | ||
+ | * First IP Plan is for Loopbacks (for P, CE and PE routers) | ||
+ | * Plan Size: 24 | ||
+ | * Description: | ||
+ | |||
+ | == Subnets == | ||
+ | Under Subnets section, create following subnets \\ | ||
+ | * Subnet Name: P_Loopbacks | ||
+ | * Subnet size: 32 | ||
+ | * Start IP: 0.0.0.1 | ||
+ | * End IP: 0.0.0.5 | ||
+ | == Subnet Plans == | ||
+ | Under Subnet Plans section, create a new " | ||
+ | |||
+ | === CE_Loopback === | ||
+ | * Subnet Name: CE_Loopback | ||
+ | * Subnet size: 32 | ||
+ | * Start IP: 0.0.0.6 | ||
+ | * End IP: 0.0.0.10 | ||
+ | Under Subnet Plans section, create a new " | ||
+ | |||
+ | === PE_Loopback === | ||
+ | * Subnet Name: PE_Loopbacks | ||
+ | * Subnet size: 32 | ||
+ | * Start IP: 0.0.0.11 | ||
+ | * End IP: 0.0.0.255 | ||
+ | Under Subnet Plans section, create a new " | ||
+ | |||
+ | === PE_CE === | ||
+ | 2nd IPV4 plan is for PE_CE links \\ | ||
+ | * Plan Size: 24 | ||
+ | * Description: | ||
+ | == Subnets == | ||
+ | Under Subnets section, create following subnets \\ | ||
+ | * Subnet Name: PE_CE | ||
+ | * Subnet size: 30 | ||
+ | * Start IP: 0.0.0.0 | ||
+ | * End IP: 0.0.0.255 | ||
+ | == Subnet Plans == | ||
+ | Under Subnet Plans section, create a new " | ||
+ | |||
+ | ====== Template ====== | ||
+ | |||
+ | We need to create several templates \\ | ||
+ | 1) vrf template \\ | ||
+ | 2) port templates \\ | ||
+ | 3) sub templates \\ | ||
+ | 4) Main templates | ||
+ | |||
+ | ===== vrf template ===== | ||
+ | |||
+ | <WRAP indent> | ||
+ | ^template^template type^vendor type^model name^ | ||
+ | |vrf_template|port|Cisco_IOS|vrf| | ||
+ | |||
+ | Template text: | ||
+ | < | ||
+ | ip vrf < | ||
+ | rd < | ||
+ | route-target both < | ||
+ | </ | ||
+ | |||
+ | > Note: As with all templates, do not forget to set your new template to the ' | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | ===== port templates ===== | ||
+ | |||
+ | <WRAP indent> | ||
+ | ^template^template type^vendor type^model name^ | ||
+ | |AddVrf|port|Cisco_ios|Ethernet| | ||
+ | |||
+ | Template text: | ||
+ | < | ||
+ | #reload PE_CE_nets | ||
+ | interface < | ||
+ | ip vrf forwarding < | ||
+ | ip address < | ||
+ | no shut | ||
+ | </ | ||
+ | </ | ||
+ | ===== Sub templates ===== | ||
+ | |||
+ | <WRAP indent> | ||
+ | ^template^type^vendor^ | ||
+ | |addMPbgp|automation|Cisco_IOS| | ||
+ | |||
+ | Template text: | ||
+ | < | ||
+ | router bgp < | ||
+ | address-family ipv4 vrf < | ||
+ | redistribute static | ||
+ | redistribute connected | ||
+ | ! | ||
+ | ! | ||
+ | ! | ||
+ | </ | ||
+ | </ | ||
+ | ====== Service Type ====== | ||
+ | |||
+ | Following Service Types need to be created \\ | ||
+ | AddCE: To Add a CE with its loopback address \\ | ||
+ | AddPE: To Add a PE with its loopback address \\ | ||
+ | Create: To Create a L3VPN on a PE to PE basis | ||
+ | |||
+ | ** AddCE ** | ||
+ | <WRAP indent> | ||
+ | |||
+ | Client Type: CSP \\ | ||
+ | Service Class: CE \\ | ||
+ | Service Type: api \\ | ||
+ | Service Task: AddCE | ||
+ | |||
+ | ^Seq ^Exec ^Class ^Scope ^Match ^Value ^Alias ^Comments ^ | ||
+ | |1 |LOCATE |CLIENT |CURRENT |CLIENT_CODE |(client) |< | ||
+ | |2 |ADD |SITE |< | ||
+ | |3 |ADD |SERVICE |< | ||
+ | |4 |ADD |NODE |< | ||
+ | |5 |ASSIGN |NODE |< | ||
+ | |6 |ASSIGN |NODE |< | ||
+ | |7 |ADD |PORT |< | ||
+ | |8 |ADD |SUBNET |< | ||
+ | |9 |LOCATE |ADDRESS |< | ||
+ | |10 |ASSIGN |ADDRESS |< | ||
+ | </ | ||
+ | |||
+ | ** AddPE ** | ||
+ | <WRAP indent> | ||
+ | |||
+ | Client Type: CSP \\ | ||
+ | Service Class: PE \\ | ||
+ | Service Type: api \\ | ||
+ | Service Task: AddPE \\ | ||
+ | |||
+ | ^Seq ^Exec ^Class ^Scope ^Match ^Value ^Alias ^Comments ^ | ||
+ | |1 |LOCATE |CLIENT |CURRENT |CLIENT_CODE |(client) |< | ||
+ | |2 |ADD |SITE |< | ||
+ | |3 |ADD |SERVICE |< | ||
+ | |4 |ASSIGN |SERVICE |< | ||
+ | |4 |ADD |NODE |< | ||
+ | |5 |ASSIGN |NODE |< | ||
+ | |6 |ASSIGN |NODE |< | ||
+ | |7 |ADD |PORT |< | ||
+ | |8 |ADD |SUBNET |< | ||
+ | |9 |LOCATE |ADDRESS |< | ||
+ | |10 |ASSIGN |ADDRESS |< | ||
+ | |11 |LOCATE |PORT |< | ||
+ | |12 |ADD |SUBNET |< | ||
+ | |13 |LOCATE |NODE |GLOBAL |NODE_NAME |(ce.node) |< | ||
+ | |14 |LOCATE |PORT |< | ||
+ | |15 |ADD |LINK |< | ||
+ | |16 |ASSIGN |SUBNET |< | ||
+ | |17 |ADD |VRF |< | ||
+ | |18 |ADD |VRF |< | ||
+ | |19 |ASSIGN |SUBNET |< | ||
+ | |20 |ASSIGN |SUBNET |< | ||
+ | </ | ||
+ | |||
+ | ** Create ** | ||
+ | <WRAP indent> | ||
+ | |||
+ | Client Type: CSP \\ | ||
+ | Service Class: PE \\ | ||
+ | Service Type: api \\ | ||
+ | Service Task: Create | ||
+ | |||
+ | ^Seq ^Exec ^Class ^Scope ^Match ^Value ^Alias ^Comments | ||
+ | |1 |LOCATE |CLIENT |CURRENT |CLIENT_CODE |(client) |< | ||
+ | |2 |ADD |SITE |< | ||
+ | |3 |LOCATE |SERVICE |GLOBAL |NODE |(pe.node) |< | ||
+ | |4 |LOCATE |NODE |GLOBAL |NODE_NAME |(pe.node) |< | ||
+ | |5 |LOCATE |PORT |< | ||
+ | |6 |ADD |SUBNET |< | ||
+ | |7 |LOCATE |NODE |GLOBAL |NODE_NAME |(ce.node) |< | ||
+ | |8 |LOCATE |PORT |< | ||
+ | |9 |ADD |LINK |< | ||
+ | |10 |ASSIGN |NODE |< | ||
+ | |11 |ASSIGN |NODE |< | ||
+ | |12 |ADD |VRF |< | ||
+ | |13 |ADD |VRF |< | ||
+ | |14 |ASSIGN |VRF |< | ||
+ | |15 |ASSIGN |VRF |< | ||
+ | |||
+ | </ | ||
+ | ====== Relations ====== | ||
+ | |||
+ | Relations are required to fetch information out of the database. Here this use case assumes we have PE, CE and VRF information with us beforehand | ||
+ | |||
+ | Thus with the variables at hand, how can we retrieve other parameters which the Job will need. For e.g, we shall need the PE Interface Name as an input, this will be retrieved using relations | ||
+ | |||
+ | Name: | ||
+ | Description: | ||
+ | SQL: \\ | ||
+ | <code sql> | ||
+ | SELECT DISTINCT Port_map.Port_type, | ||
+ | Port_map_1.Hostname AS Rem_hostname, | ||
+ | Ip_subnet.Net_name, | ||
+ | Ip_subnet.Net_mask, | ||
+ | Ip_subnet.Net_ip_ZA, | ||
+ | Ip_subnet.If_ip_Z, | ||
+ | Node_vrf.Vrf_name | ||
+ | FROM (((((Port_map | ||
+ | INNER JOIN Topo_map ON Port_map.Interface_id = Topo_map.Interface_id) | ||
+ | INNER JOIN Topo_map AS Topo_map_1 ON Topo_map.Topo_id = Topo_map_1.Topo_id) | ||
+ | INNER JOIN Port_map AS Port_map_1 ON Topo_map_1.Interface_id = Port_map_1.Interface_id) | ||
+ | INNER JOIN SiteRouter ON Port_map_1.Hostname = SiteRouter.Hostname) | ||
+ | INNER JOIN Port_map AS Port_map_2 ON SiteRouter.Hostname = Port_map_2.Hostname) | ||
+ | INNER JOIN (Ip_map | ||
+ | INNER JOIN Ip_subnet ON Ip_map.Subnet_id = Ip_subnet.Subnet_id) ON Port_map_2.Interface_id = Ip_map.Interface_id | ||
+ | LEFT JOIN Node_vrf ON Ip_subnet.Vrf_id = Node_vrf.Vrf_id | ||
+ | WHERE Port_map.Hostname = '< | ||
+ | AND Port_map_1.Interface_id != Port_map.Interface_id | ||
+ | AND Ip_subnet.Net_name = ' | ||
+ | ORDER BY Port_map_1.Hostname | ||
+ | </ | ||
+ | |||
+ | The output (for e.g is below) :\\ | ||
+ | {{guides: | ||
+ | |||
+ | And if we scroll to right to see the remaining columns \\ | ||
+ | We can spot the IP addresses assigned and the VRF name too. \\ | ||
+ | {{guides: | ||
+ | |||
+ | ====== Command Job ====== | ||
+ | {{guides: | ||
+ | |||
+ | As shown in the snapshot, The Command Job has two sections \\ | ||
+ | 1) Commands: \\ | ||
+ | 2) Scenario \\ | ||
+ | |||
+ | The Commands section has below: | ||
+ | < | ||
+ | {< | ||
+ | ! | ||
+ | {< | ||
+ | ! | ||
+ | {addMPbgp} | ||
+ | </ | ||
+ | |||
+ | The {< | ||
+ | Whilst Node_vrf returns a lot of columns, we are interested in Vrf_template and Node_vrf variable' | ||
+ | In other words \\ | ||
+ | < | ||
+ | |||
+ | For e.g, this is the output we expect from the above line: | ||
+ | < | ||
+ | ip vrf CustA | ||
+ | rd 172.31.0.11: | ||
+ | route-target both 65001:1 | ||
+ | ! | ||
+ | </ | ||
+ | |||
+ | Here in the {< | ||
+ | We also then expand the lines in the Port_template and start substituting parameters in PE_CE_nets PROVIDED Rem_hostname = value_of_CE_hostname_specified_in_Scenario \\ | ||
+ | |||
+ | For e.g, this is the output we expect from the above line: | ||
+ | < | ||
+ | interface Ethernet1/ | ||
+ | ip vrf forwarding CustA | ||
+ | ip address | ||
+ | no shut | ||
+ | </ | ||
+ | |||
+ | In the {addMPbgp} line, we are calling addMPbgp template. All the values in the variables within addMPbgp template are substituted by either explicit input provided in the Scenario. \\ | ||
+ | For e.g, this is the output we expect from the above line: | ||
+ | < | ||
+ | router bgp 65001 | ||
+ | address-family ipv4 vrf CustA | ||
+ | redistribute static | ||
+ | redistribute connected | ||
+ | ! | ||
+ | </ | ||
+ | |||
+ | Thus we have shown how to deploy L3 VPN on a PE for a set of parameters... | ||
+ | |||
+ | ====== Scheduling the Job ====== | ||
+ | |||
+ | This is the last part of the howto where the rubber meets the road. Here, the jobs are scheduled as per the time of the day, day of the week OR \\ | ||
+ | NoW \\ | ||
+ | And the device gets configured as per schedule. \\ | ||
+ | |||
+ | We can see the session transaction log in Operate => Job Logs: | ||
+ | < | ||
+ | PE1#show privilege | ||
+ | Current privilege level is 15 | ||
+ | PE1#show privilege | ||
+ | Current privilege level is 15 | ||
+ | PE1# | ||
+ | Enter configuration commands, one per line. End with CNTL/Z. | ||
+ | PE1(config)# | ||
+ | PE1(config-vrf)# | ||
+ | PE1(config-vrf)# | ||
+ | PE1(config-vrf)# | ||
+ | PE1(config-vrf)# | ||
+ | PE1(config-if)# | ||
+ | PE1(config-if)# | ||
+ | PE1(config-if)# | ||
+ | PE1(config-if)# | ||
+ | PE1(config-if)# | ||
+ | PE1(config-router)# | ||
+ | PE1(config-router-af)# | ||
+ | PE1(config-router-af)# | ||
+ | PE1(config-router-af)# | ||
+ | PE1(config-router-af)# | ||
+ | PE1(config-router-af)# | ||
+ | PE1(config-router-af)# | ||
+ | PE1# | ||
+ | </ | ||
+ | |||
+ | |||
+ | ====== Modify and delete ====== | ||
+ | Here are two more articles that explain the [[guides: | ||
+ | |||