Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Execute Tcl Online

proc Config_Creation {} {
set list {SGI-2-VLAN404_VLAN414 SGI-3-VLAN405_VLAN415 SGI-4-VLAN406_VLAN416 SGI-5-VLAN407_VLAN417 SGI-6-VLAN408_VLAN418 SGI-7-VLAN409_VLAN419 SGI-8-VLAN410_VLAN420 SGI-9-VLAN411_VLAN421}

set file [open "APN-Configuration-bulk.txt" w]
foreach context_index $list {
incr $context_index
if {$context_index == "SGI-7-VLAN409_VLAN419"} {
set str "\tpdp-type ipv4\n\tbearer-control-mode mixed\n\tselection-mode subscribed sent-by-ms chosen-by-sgsn\n\taccounting-mode none\n\tgtpp group CGF-1 accounting-context SUPPORTZONE\n\tgtpp group CGF-2 accounting-context SUPPORTZONE\n\tgtpp group CGF-3 accounting-context SUPPORTZONE\n\tgtpp group CGF-4 accounting-context SUPPORTZONE\n\tidle-timeout-activity ignore-downlink\n\ttimeout bearer-inactivity gbr 300 volume-threshold uplink 29\n\ttimeout bearer-inactivity non-gbr 900 volume-threshold uplink 29\n\ttimeout bearer-inactivity exclude-default-bearer\n\tassociate qci-qos-mapping QCI_DSCP_APN_MAP\n\tpco-options link-mtu 1430\n\tapn-ambr rate-limit direction downlink burst-size auto-readjust duration  1 violate-action drop\n\tapn-ambr rate-limit direction uplink burst-size auto-readjust duration  1 violate-action drop\n\tims-auth-service Gx\n\taaa group RADIUS-to-MSP\n\tdns primary 198.224.124.247\n\tppp mtu 2000\n\ttimeout idle 14400\n\tip access-group ECS_ACL_in in\n\tip access-group ECS_ACL_out out\n\tip source-violation check drop-limit 0\n\tmediation-device\n\tip context-name $context_index\n\tip address pool name pool_broadband\n\tcc-profile any credit-control-group Gy\n\tcredit-control-client override session-mode per-subscriber\n\tactive-charging rulebase POSTPAID\n\tdata-tunnel mtu 2000\n\texit"


puts $file "context $context_index"
for {set VRF 7001} {$VRF <=7300} {incr VRF} {
        puts $file "  ip vrf VRF_$VRF\n  #exit"
}
puts $file "  ip vrf VRF_7999\n  #exit"
puts $file "  mpls bgp forwarding"
for {set VRF 7001} {$VRF <=7300} {incr VRF} {
    puts $file "   ip pool pool_common_$VRF 10.107.0.0 255.255.254.0 private 0 srp-activate group-name pool_common_group_$VRF vrf VRF_$VRF"
}
puts $file "   bfd-protocol\n   #exit"
set a 0
for {set VRF 7001} {$VRF <=7300} {incr VRF} {
        incr a
        puts $file "   ip vrf VRF_$VRF\n    route-distinguisher 409 $a\n    route-target both 409 $a\n   #exit"
        puts $file "   address-family ipv4 vrf VRF_$VRF\n    maximum-paths ebgp 2\n    redistribute connected\n    #exit"
}
        puts $file "   ip vrf VRF_7999\n    route-distinguisher 409 999\n    route-target both 409 999\n   #exit"
        puts $file "   address-family ipv4 vrf VRF_7999\n    maximum-paths ebgp 2\n    redistribute connected\n    #exit"

puts $file "   interface Test_UE-01 loopback\n    ip vrf forwarding VRF_7001\n    ip address 10.107.0.1 255.255.255.255 srp-activate\n   #exit"
set vrf 7000
for {set i 101} {$i <=400} {incr i} {
    incr vrf
    set apn_name common-$i-fn2
set str "\tpdp-type ipv4\n\tbearer-control-mode mixed\n\tselection-mode subscribed sent-by-ms chosen-by-sgsn\n\taccounting-mode none\n\tgtpp group CGF-1 accounting-context SUPPORTZONE\n\tgtpp group CGF-2 accounting-context SUPPORTZONE\n\tgtpp group CGF-3 accounting-context SUPPORTZONE\n\tgtpp group CGF-4 accounting-context SUPPORTZONE\n\tidle-timeout-activity ignore-downlink\n\ttimeout bearer-inactivity gbr 300 volume-threshold uplink 29\n\ttimeout bearer-inactivity non-gbr 900 volume-threshold uplink 29\n\ttimeout bearer-inactivity exclude-default-bearer\n\tassociate qci-qos-mapping QCI_DSCP_APN_MAP\n\tpco-options link-mtu 1430\n\tapn-ambr rate-limit direction downlink burst-size auto-readjust duration  1 violate-action drop\n\tapn-ambr rate-limit direction uplink burst-size auto-readjust duration  1 violate-action drop\n\tims-auth-service Gx\n\taaa group RADIUS-to-MSP\n\tdns primary 198.224.124.247\n\tppp mtu 2000\n\ttimeout idle 14400\n\tip access-group ECS_ACL_in in\n\tip access-group ECS_ACL_out out\n\tip source-violation check drop-limit 0\n\tmediation-device\n\tip context-name $context_index\n\tip address pool name pool_common_$vrf\n\tcc-profile any credit-control-group Gy\n\tcredit-control-client override session-mode per-subscriber\n\tactive-charging rulebase POSTPAID\n\tdata-tunnel mtu 2000\n\texit"

  puts $file "   apn $apn_name\n$str"
}
} elseif {$context_index == "SGI-8-VLAN410_VLAN420"} {

puts $file "context $context_index"
for {set VRF 8001} {$VRF <=8300} {incr VRF} {
        puts $file "  ip vrf VRF_$VRF\n  #exit"
}
puts $file "  ip vrf VRF_8999\n  #exit"

puts $file "  mpls bgp forwarding"
for {set VRF 8001} {$VRF <=8300} {incr VRF} {
    puts $file "   ip pool pool_common_$VRF 10.107.0.0 255.255.254.0 private 0 srp-activate group-name pool_common_group_$VRF vrf VRF_$VRF"
}
puts $file "   bfd-protocol\n   #exit"
set b 0
for {set VRF 8001} {$VRF <=8300} {incr VRF} {
        incr b
        puts $file "   ip vrf VRF_$VRF\n    route-distinguisher 410 $b\n    route-target both 410 $b\n   #exit"
        puts $file "   address-family ipv4 vrf VRF_$VRF\n    maximum-paths ebgp 2\n    redistribute connected\n    #exit"
}
        puts $file "   ip vrf VRF_8999\n    route-distinguisher 410 999\n    route-target both 410 999\n   #exit"
        puts $file "   address-family ipv4 vrf VRF_8999\n    maximum-paths ebgp 2\n    redistribute connected\n    #exit"

puts $file "   interface Test_UE-01 loopback\n    ip vrf forwarding VRF_8001\n    ip address 10.107.0.1 255.255.255.255 srp-activate\n   #exit"
set vrf 8000
for {set i 401} {$i <=700} {incr i} {
    set apn_name common-$i-fn2
    incr vrf
set str "\tpdp-type ipv4\n\tbearer-control-mode mixed\n\tselection-mode subscribed sent-by-ms chosen-by-sgsn\n\taccounting-mode none\n\tgtpp group CGF-1 accounting-context SUPPORTZONE\n\tgtpp group CGF-2 accounting-context SUPPORTZONE\n\tgtpp group CGF-3 accounting-context SUPPORTZONE\n\tgtpp group CGF-4 accounting-context SUPPORTZONE\n\tidle-timeout-activity ignore-downlink\n\ttimeout bearer-inactivity gbr 300 volume-threshold uplink 29\n\ttimeout bearer-inactivity non-gbr 900 volume-threshold uplink 29\n\ttimeout bearer-inactivity exclude-default-bearer\n\tassociate qci-qos-mapping QCI_DSCP_APN_MAP\n\tpco-options link-mtu 1430\n\tapn-ambr rate-limit direction downlink burst-size auto-readjust duration  1 violate-action drop\n\tapn-ambr rate-limit direction uplink burst-size auto-readjust duration  1 violate-action drop\n\tims-auth-service Gx\n\taaa group RADIUS-to-MSP\n\tdns primary 198.224.124.247\n\tppp mtu 2000\n\ttimeout idle 14400\n\tip access-group ECS_ACL_in in\n\tip access-group ECS_ACL_out out\n\tip source-violation check drop-limit 0\n\tmediation-device\n\tip context-name $context_index\n\tip address pool name pool_common_$vrf\n\tcc-profile any credit-control-group Gy\n\tcredit-control-client override session-mode per-subscriber\n\tactive-charging rulebase POSTPAID\n\tdata-tunnel mtu 2000\n\texit"
  puts $file "   apn $apn_name\n$str"
}
} elseif {$context_index == "SGI-9-VLAN411_VLAN421"} {

puts $file "context $context_index"
for {set VRF 9001} {$VRF <=9300} {incr VRF} {
        puts $file "  ip vrf VRF_$VRF\n  #exit"
}
puts $file "  ip vrf VRF_9999\n  #exit"

puts $file "  mpls bgp forwarding"
for {set VRF 9001} {$VRF <=9300} {incr VRF} {
    puts $file "   ip pool pool_common_$VRF 10.107.0.0 255.255.254.0 private 0 srp-activate group-name pool_common_group_$VRF vrf VRF_$VRF"
}
puts $file "   bfd-protocol\n   #exit"
set c 0
for {set VRF 9001} {$VRF <=9300} {incr VRF} {
        incr c
        puts $file "   ip vrf VRF_$VRF\n    route-distinguisher 411 $c\n    route-target both 411 $c\n   #exit"
        puts $file "   address-family ipv4 vrf VRF_$VRF\n    maximum-paths ebgp 2\n    redistribute connected\n    #exit"
}
        puts $file "   ip vrf VRF_9999\n    route-distinguisher 411 999\n    route-target both 411 999\n   #exit"
        puts $file "   address-family ipv4 vrf VRF_9999\n    maximum-paths ebgp 2\n    redistribute connected\n    #exit"

puts $file "   interface Test_UE-01 loopback\n    ip vrf forwarding VRF_9001\n    ip address 10.107.0.1 255.255.255.255 srp-activate\n   #exit"
set vrf 9000
for {set i 701} {$i <=1000} {incr i} {
    incr vrf
    set apn_name common-$i-fn2
set str "\tpdp-type ipv4\n\tbearer-control-mode mixed\n\tselection-mode subscribed sent-by-ms chosen-by-sgsn\n\taccounting-mode none\n\tgtpp group CGF-1 accounting-context SUPPORTZONE\n\tgtpp group CGF-2 accounting-context SUPPORTZONE\n\tgtpp group CGF-3 accounting-context SUPPORTZONE\n\tgtpp group CGF-4 accounting-context SUPPORTZONE\n\tidle-timeout-activity ignore-downlink\n\ttimeout bearer-inactivity gbr 300 volume-threshold uplink 29\n\ttimeout bearer-inactivity non-gbr 900 volume-threshold uplink 29\n\ttimeout bearer-inactivity exclude-default-bearer\n\tassociate qci-qos-mapping QCI_DSCP_APN_MAP\n\tpco-options link-mtu 1430\n\tapn-ambr rate-limit direction downlink burst-size auto-readjust duration  1 violate-action drop\n\tapn-ambr rate-limit direction uplink burst-size auto-readjust duration  1 violate-action drop\n\tims-auth-service Gx\n\taaa group RADIUS-to-MSP\n\tdns primary 198.224.124.247\n\tppp mtu 2000\n\ttimeout idle 14400\n\tip access-group ECS_ACL_in in\n\tip access-group ECS_ACL_out out\n\tip source-violation check drop-limit 0\n\tmediation-device\n\tip context-name $context_index\n\tip address pool name pool_common_$vrf\n\tcc-profile any credit-control-group Gy\n\tcredit-control-client override session-mode per-subscriber\n\tactive-charging rulebase POSTPAID\n\tdata-tunnel mtu 2000\n\texit"

    puts $file "   apn $apn_name\n$str"
}
}
}
close $file
}
Config_Creation 


Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.