This commit is contained in:
2024-10-14 00:08:40 +02:00
parent dbfba56f66
commit 1462d52e13
4572 changed files with 2658864 additions and 0 deletions

View File

@@ -0,0 +1,152 @@
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!switch-vwd-1,switch-vwd-2
conf t
vlan 8xx
name template
end
wr mem
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!switch-vwd-sp1, switch-vwd-sp2
conf t
vrf definition template
rd 65000:1009
address-family ipv4
exit-address-family
vlan 8xx
name template
ip access-list standard routes2template
permit 192.168.112.0 0.0.0.255
permit 192.168.220.0 0.0.0.255
permit 172.20.20.0 0.0.0.255
permit 172.20.21.0 0.0.0.255
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!switch-vwd-sp1
conf t
vlan Vlan10x
name template
interface vlan8xx
description template
vrf forwarding template
ip address 10.120.1.98 255.255.255.248
int Gi1/0/10
description Cust: VWD-Transit (template)
no switchport
# vrf forwarding template
# ip address 192.168.239.26 255.255.255.254
# switchport mode trunk|access
# switchport access vlan ...
# switchport trunk allowed vlan ...
# channel-group X mode on|active
int Vlan10x
description Cust: VWD-Transit (template)
vrf forwarding template
ip address 192.168.239.26 255.255.255.254
router bgp 65148
address-family ipv4 vrf template
bgp router-id auto-assign
redistribute static
neighbor 10.120.1.97 remote-as 65148
neighbor 10.120.1.99 remote-as 65160
neighbor 10.120.1.99 local-as 65160
neighbor 192.168.239.27 remote-as 6520x
neighbor 192.168.239.27 local-as 65160
distribute-list routes2template
exit-address-family
ip route vrf template 172.20.20.0 255.255.255.0 10.120.2.1
ip route vrf template 172.20.21.0 255.255.255.0 10.120.2.1
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!switch-vwd-sp2
conf t
vlan Vlan10y
name template
vlan 8xx
name template
interface vlan8xx
description template
vrf forwarding template
ip address 10.120.1.99 255.255.255.248
int Gi1/0/10
description Cust: VWD-Transit (template)
no switchport
# vrf forwarding template
# ip address 192.168.239.154 255.255.255.254
# switchport mode trunk|access
# switchport access vlan ...
# switchport trunk allowed vlan ...
# channel-group X mode on|active
int Vlan10y
description Cust: VWD-Transit (template)
vrf forwarding template
ip address 192.168.239.154 255.255.255.254
router bgp 65148
address-family ipv4 vrf template
bgp router-id auto-assign
redistribute static
neighbor 10.120.1.97 remote-as 65148
neighbor 10.120.1.98 remote-as 65160
neighbor 10.120.1.98 local-as 65160
neighbor 192.168.239.155 remote-as 6520x
neighbor 192.168.239.155 local-as 65160
distribute-list routes2template
exit-address-family
ip route vrf template 172.20.20.0 255.255.255.0 10.120.2.1
ip route vrf template 172.20.21.0 255.255.255.0 10.120.2.1
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!asa-vwd-1
conf t
interface Port-channel2.8xx
vlan 8xx
nameif template
security-level 100
ip address 10.120.1.97 255.255.255.248
access-list template_access_in extended permit icmp any any
access-list template_access_in extended deny ip any any
no monitor-interface template
access-group template_access_in in interface template
router bgp 65148
bgp log-neighbor-changes
address-family ipv4 unicast
neighbor 10.120.1.98 remote-as 65148
neighbor 10.120.1.98 description template primary weight 200
neighbor 10.120.1.98 activate
neighbor 10.120.1.98 next-hop-self
neighbor 10.120.1.98 weight 200
neighbor 10.120.1.99 remote-as 65148
neighbor 10.120.1.99 description template secondary weight 100
neighbor 10.120.1.99 activate
neighbor 10.120.1.99 next-hop-self
neighbor 10.120.1.99 weight 100

View File

@@ -0,0 +1,16 @@
#!/bin/perl
open V, "<var.txt";
while (<V>) {
($k,$v) = /^! (__.*__) (.*)\n*$/;
next if ($k eq "" or $v eq "");
$h{$k}=$v;
}
close V;
open T, "<temp.txt"; open R, ">res.txt";
while (<T>) {
for ($i=0; $i<=5; $i++) { foreach $k (keys %h) { s/$k/$h{$k}/g; } }
printf R unless (/__.*__/);
}
close T; close R;

View File

@@ -0,0 +1,7 @@
cp temp.txt res.txt
cat var.txt | egrep "! " | awk '{print "sed -i \"s#"$2"#"$3" "$4" "$5" "$6" "$7" "$8" "$9" "$10" "$11"#g\" res.txt"}'
#sed -i "s/__VRFXFERIPSW2__/XyZ/g" res.txt

View File

@@ -0,0 +1,159 @@
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!switch-vwd-1,switch-vwd-2
conf t
vlan __VRFXFERVLAN__
name __VRFNAME__
end
wr mem
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!switch-vwd-sp1, switch-vwd-sp2
conf t
vrf definition __VRFNAME__
rd 65000:__VRFID__
address-family ipv4
exit-address-family
vlan __VRFXFERVLAN__
name __VRFNAME__
ip access-list standard routes2__VRFNAME__
permit __RACLa__
permit __RACLb__
permit __RACLc__
permit __RACLd__
permit __RACLe__
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!switch-vwd-sp1
conf t
vlan __CUSTINT1__
name __VRFNAME__
interface vlan__VRFXFERVLAN__
description __VRFNAME__
vrf forwarding __VRFNAME__
ip address __VRFXFERIPSW1__ __VRFXFERIPMASK__
int __CUSTINTP1__
description Cust: VWD-Transit (__VRFNAME__)
no switchport
# vrf forwarding __VRFNAME__
# ip address __VRFCUSTIP1__ __VRFCUSTIP1M__
# switchport mode trunk|access
# switchport access vlan ...
# switchport trunk allowed vlan ...
# channel-group X mode on|active
int __CUSTINT1__
description Cust: VWD-Transit (__VRFNAME__)
vrf forwarding __VRFNAME__
ip address __VRFCUSTIP1__ __VRFCUSTIP1M__
router bgp 65148
address-family ipv4 vrf __VRFNAME__
bgp router-id auto-assign
redistribute static
neighbor __VRFXFERIPASA__ remote-as 65148
neighbor __VRFXFERIPSW2__ remote-as __VRFXFERAS__
neighbor __VRFXFERIPSW2__ local-as __VRFXFERAS__
neighbor __VRFCUSTIP1R__ remote-as __VRFCUSTAS__
neighbor __VRFCUSTIP1R__ local-as __VRFXFERAS__
distribute-list routes2__VRFNAME__
exit-address-family
ip route vrf __VRFNAME__ __SR1a__
ip route vrf __VRFNAME__ __SR1b__
ip route vrf __VRFNAME__ __SR1c__
ip route vrf __VRFNAME__ __SR1d__
ip route vrf __VRFNAME__ __SR1e__
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!switch-vwd-sp2
conf t
vlan __CUSTINT2__
name __VRFNAME__
vlan __VRFXFERVLAN__
name __VRFNAME__
interface vlan__VRFXFERVLAN__
description __VRFNAME__
vrf forwarding __VRFNAME__
ip address __VRFXFERIPSW2__ __VRFXFERIPMASK__
int __CUSTINTP2__
description Cust: VWD-Transit (__VRFNAME__)
no switchport
# vrf forwarding __VRFNAME__
# ip address __VRFCUSTIP2__ __VRFCUSTIP2M__
# switchport mode trunk|access
# switchport access vlan ...
# switchport trunk allowed vlan ...
# channel-group X mode on|active
int __CUSTINT2__
description Cust: VWD-Transit (__VRFNAME__)
vrf forwarding __VRFNAME__
ip address __VRFCUSTIP2__ __VRFCUSTIP2M__
router bgp 65148
address-family ipv4 vrf __VRFNAME__
bgp router-id auto-assign
redistribute static
neighbor __VRFXFERIPASA__ remote-as 65148
neighbor __VRFXFERIPSW1__ remote-as __VRFXFERAS__
neighbor __VRFXFERIPSW1__ local-as __VRFXFERAS__
neighbor __VRFCUSTIP2R__ remote-as __VRFCUSTAS__
neighbor __VRFCUSTIP2R__ local-as __VRFXFERAS__
distribute-list routes2__VRFNAME__
exit-address-family
ip route vrf __VRFNAME__ __SR1a__
ip route vrf __VRFNAME__ __SR1b__
ip route vrf __VRFNAME__ __SR1c__
ip route vrf __VRFNAME__ __SR1d__
ip route vrf __VRFNAME__ __SR1e__
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!asa-vwd-1
conf t
interface Port-channel2.__VRFXFERVLAN__
vlan __VRFXFERVLAN__
nameif __VRFNAME__
security-level 100
ip address __VRFXFERIPASA__ __VRFXFERIPMASK__
access-list __VRFNAME___access_in extended permit icmp any any
access-list __VRFNAME___access_in extended deny ip any any
no monitor-interface __VRFNAME__
access-group __VRFNAME___access_in in interface __VRFNAME__
router bgp 65148
bgp log-neighbor-changes
address-family ipv4 unicast
neighbor __VRFXFERIPSW1__ remote-as 65148
neighbor __VRFXFERIPSW1__ description __VRFNAME__ primary weight 200
neighbor __VRFXFERIPSW1__ activate
neighbor __VRFXFERIPSW1__ next-hop-self
neighbor __VRFXFERIPSW1__ weight 200
neighbor __VRFXFERIPSW2__ remote-as 65148
neighbor __VRFXFERIPSW2__ description __VRFNAME__ secondary weight 100
neighbor __VRFXFERIPSW2__ activate
neighbor __VRFXFERIPSW2__ next-hop-self
neighbor __VRFXFERIPSW2__ weight 100

View File

@@ -0,0 +1,47 @@
! __VRFXFERVLAN__ 8xx
! __VRFNAME__ template
! __VRFID__ 1009
! __VRFXFERIPASA__ 10.120.1.97
! __VRFXFERIPSW1__ 10.120.1.98
! __VRFXFERIPSW2__ 10.120.1.99
! __VRFXFERIPMASK__ 255.255.255.248
! __VRFXFERAS__ 65160
! __VRFCUSTAS__ 6520x
! __CUSTINTP1__ Gi1/0/10
! __CUSTINT1__ Vlan10x
! __CUSTINTP2__ Gi1/0/10
! __CUSTINT2__ Vlan10y
! __VRFCUSTIP1__ 192.168.239.26
! __VRFCUSTIP1R__ 192.168.239.27
! __VRFCUSTIP1M__ 255.255.255.254
! __VRFCUSTIP2__ 192.168.239.154
! __VRFCUSTIP2R__ 192.168.239.155
! __VRFCUSTIP2M__ 255.255.255.254
# static routes 1
# 172.20.20.0 255.255.255.0 10.120.2.1
! __SR1a__ 172.20.20.0 255.255.255.0 10.120.2.1
! __SR1b__ 172.20.21.0 255.255.255.0 10.120.2.1
! __SR1c__
! __SR1d__
! __SR1e__
# static routes 2
# 172.20.20.0 255.255.255.0 10.120.2.1
! __SR2a__ 172.20.20.0 255.255.255.0 10.120.2.1
! __SR2b__ 172.20.21.0 255.255.255.0 10.120.2.1 metric 100 track 1 name kkk
! __SR2c__
! __SR2d__
! __SR2e__
# routes acl
# 172.20.20.0 0.0.0.255
! __RACLa__ 192.168.112.0 0.0.0.255
! __RACLb__ 192.168.220.0 0.0.0.255
! __RACLc__ 172.20.20.0 0.0.0.255
! __RACLd__ 172.20.21.0 0.0.0.255
! __RACLe__