[Contents] [Prev] [Next] [Index] [Report an Error]

Configuring ATM Interfaces

This sample macro configures ATM interfaces based on the inputs you provide when prompted by the macro.

<# atmIf #>
<# slotPort:=env.getline("slot/port?") #>
<# while (vcType != 1 && vcType != 2);
vcTypeStr :=env.getline("VC type (1 = AAL5MUX IP, 2 = AAL5SNAP)?");
vcType := env.atoi(vcTypeStr);
endwhile #>
<# if vcType = 1; vcTypeStr := "aal5mux ip"; else; vcTypeStr := "aal5snap"; endif
#>
<# encapRouted:=1; encapBridged:=2; encapPPP:=3 #>
<# while (encapType < encapRouted || encapType > encapPPP );
encapTypeStr :=env.getline("encapsulation (1 = routed, 2 = bridged, 3 =
ppp)?");
encapType := env.atoi(encapTypeStr);
endwhile #>
<# if encapType = encapPPP #>
<# authNone:=1; authPap:=2; authChap:=3; authPapChap:=4; authChapPap:=5 #>
<# while (authType < authNone || authType > authChapPap );
authTypeStr :=env.getline("authentication (1 = None, 2 = PAP, 3 = CHAP, 4 =
PAP/CHAP; 5 = CHAP/PAP)?");
authType := env.atoi(authTypeStr);
endwhile #>
<# endif #>
<# vpStartStr := env.getline("Starting VP number?");
vpStart:=env.atoi(vpStartStr)#>
<# vpEndStr := env.getline("Ending VP number?"); vpEnd
:=env.atoi(vpEndStr)#>
<# vcStartStr := env.getline("Starting VC number?");
vcStart:=env.atoi(vcStartStr)#>
<# vcEndStr := env.getline("Ending VC number?"); vcEnd
:=env.atoi(vcEndStr)#>
<# loopbackStr := env.getline("Loopback interface number or <cr>?") #>
<# vp := vpStart; while vp <= vpEnd, ++vp #>
<# vc := vcStart; while vc <= vcEnd, ++vc #>
interface atm <#slotPort $ '.' $ ++i;'\n'#>
atm pvc <# i; ' '; vp; ' '; vc; ' '; vcTypeStr;'\n'#>
<# if encapType = encapPpp #>
encap ppp
<# if authType = authPap#>
ppp authentication pap
<# elseif authType = authPapChap#>
ppp authentication pap chap
<# elseif authType = authChapPap#>
ppp authentication chap pap
<# elseif authType = authChap#>
ppp authentication chap
<# endif #>
<# elseif encapType = encapBridged #>
encap bridged1483
<# endif #>
<# if loopbackStr != "" #>
ip unnumbered loopback <# loopbackStr;"\n" #>
<# endif #>
!
<# endwhile #>
!
<# endwhile #>
<# if encapType = encapPPP #>
<# authNone:=1; authPap:=2; authChap:=3; authPapChap:=4; authChapPap:=5 #>
<# while (authType < authNone || authType > authChapPap );
authTypeStr :=env.getline(“ authentication (1 = None, 2 = PAP, 3 = CHAP, 4 =
PAP/CHAP; 5 = CHAP/PAP)?” );
authType := env.atoi(authTypeStr);
endwhile #>
<# endif #>
<# vpStartStr := env.getline(“ Starting VP number?” );
vpStart:=env.atoi(vpStartStr)#>
<# vpEndStr := env.getline(“ Ending VP number?” ); vpEnd
:=env.atoi(vpEndStr)#>
<# vcStartStr := env.getline(“ Starting VC number?” );
vcStart:=env.atoi(vcStartStr)#>
<# vcEndStr := env.getline(“ Ending VC number?” ); vcEnd
:=env.atoi(vcEndStr)#>
<# loopbackStr := env.getline(“ Loopback interface number or <cr>?” ) #>
<# vp := vpStart; while vp <= vpEnd, ++vp #>
<# vc := vcStart; while vc <= vcEnd, ++vc #>
interface atm <#slotPort $ '.' $ ++i;'\n'#>
atm pvc <# i; ' '; vp; ' '; vc; ' '; vcTypeStr;'\n'#>
<# if encapType = encapPpp #>
encap ppp
<# if authType = authPap#>
ppp authentication pap
<# elseif authType = authPapChap#>
ppp authentication pap chap
<# elseif authType = authChapPap#>
ppp authentication chap pap
<# elseif authType = authChap#>
ppp authentication chap
<# endif #>
<# elseif encapType = encapBridged #>
encap bridged1483
<# endif #>
<# if loopbackStr != “ ”  #>
ip unnumbered loopback <# loopbackStr;” \n”  #>
<# endif #>
!
<# endwhile #>
!
<# endwhile #>
<# endtmpl #>

[Contents] [Prev] [Next] [Index] [Report an Error]