smarisetty
Posts: 36
Joined: 11.Jun.2001
From: Santa Clara, CA, USA
Status: offline
|
HI,
Having done some experiments, have the following VBScript working for me. The attached script makes all the necessary settings. I have only opened up UDP 10000 and 11600 only from the 10-20K range. I snooped the network traffic with NetMon and saw that only these two UDP's were used for audio. The other ports 5060-5063, 69 and 123 were enabled as well.
To run the script, copy the following into a file with notepad.exe and name it something like vt1000vadd.vbs. From the Windows:Start run this file and it will setup the ports as needed. If you want to undo the changes, copy the second script into a file named vt1000vdel.vbs. Run this from windows and it will undo. Hope this solves problems for many people.
----------- copy from here into vt1000vadd.vbs-------- Sub vt1000vadd
'Enabling UDP ports for Vonage vt1000v ATA ' UDP In: {69,123,5060,5061,5062,5063,10000,11600} ' UDP Out: {69,123,5060,5061,5062,5063,10000,11600}
Const prxInbound = 0 Const prxOutbound = 1 Const prxSpecifiedProtocol = 1 Const prxFwSrvSvc = 0 Const prxAllServices = 2 Const prxTCP = 0 Const prxUDP = 1
'Initialize the Internal/External IP Const IntIp="192.168.16.54" Const ExtIp="63.198.196.228" Const UdpRangeCnt=7
Dim objFPC, objArray, objSPR, ObjPD, ojbPR, MyProtDef, MyProt, myCnt Dim UdpIn(7), UdpOut(7)
'Ports for RTP media streams-audio: Primary UdpIn(0)=10000 UdpOut(0)=10000
UdpIn(1)=11600 UdpOut(1)=11600
' Ports for Handshaking - ring control UdpIn(2)=5060 UdpOut(2)=5060
UdpIn(3)=5061 UdpOut(3)=5061
UdpIn(4)=5062 UdpOut(4)=5062
UdpIn(5)=5063 UdpOut(5)=5063
' Ports time UdpIn(6)=123 UdpOut(6)=123
' Ports for tftp UdpIn(7)=69 UdpOut(7)=69
'Create the root object Set objFPC = CreateObject ("FPC.Root")
'Make sure it's current data objFPC.Refresh
'Find where we live Set objArray = objFPC.Arrays.GetContainingArray
'Create a new protocol rule now to cover all UDP outbound protocol defs Set objPR=objArray.ArrayPolicy.ProtocolRules.Add("zVoipUdpEnable") objPR.Description = "Enable UDP for vt1000v VOIP" objPR.Enabled=True objPR.Action=fpcActionAllow objPR.ProtocolSelectionMethod = prxSpecifiedProtocol objPR.SetAppliesAlways
'Create a protocol definitions, Server Publishing Rule For myCnt=0 to UdpRangeCnt Step 1 'Inbound UDP Set objPD = objArray.PolicyElements.ProtocolDefinitions.AddUdp("zUdpIn"&UdpIn(myCnt), prxInbound, UdpIn(myCnt)) objPD.Description = "UDP"&UdpIn(myCnt)&" forwarding to vt1000v" 'Save the changes objPD.Save
'Outbound UDP Set objPD = objArray.PolicyElements.ProtocolDefinitions.AddUdp("zzUdpOut"&UdpOut(myCnt), prxOutbound, UdpOut(myCnt)) objPD.Description = "Outbound UDP "&UdpOut(myCnt)&" enabling for vt1000v" 'Save the changes ObjPD.Save
'Publishing Rule to forward the Inbound UDP port Set objSPR = objArray.Publishing.ServerPublishingRules.Add("zUdpFwd"&UdpIn(myCnt)) 'Configure Server Publishing rule objSPR.Description = "UDP"&UdpIn(myCnt) &" forwarding to vt1000v" objSPR.InternalIp = IntIp objSPR.ExternalIp = ExtIp objSPR.SetProtocol("zUdpIn"&UdpIn(myCnt)) objSPR.Save
' add all UdpOut's to the Procotol Policy rule objPR.SpecifiedProtocols.Add("zzUdpOut"&UdpOut(myCnt)) objPR.Save NEXT
objSPR.Refresh objPD.Refresh objPR.Refresh objFPC.Refresh objArray.SendRestartNotification(prxFwSrvSvc)
' Finally done doing it all MsgBox ("done add - restarting server")
' release the objects Set objFPC = Nothing Set objPD=Nothing Set objSPR=Nothing Set objArray=Nothing Set objPR=Nothing
End Sub vt1000vadd ----------- copy til here ----------------------------------
------------ copy from here into vt1000vdel.vbs-------- Sub vt1000vdel
'Deleting UDP ports for Vonage vt1000v ATA ' UDP In: {69,123,5060,5061,5062,5063,10000,11600} ' UDP Out: {69,123,5060,5061,5062,5063,10000,11600}
Const prxInbound = 0 Const prxOutbound = 1 Const prxSpecifiedProtocol = 1 Const prxFwSrvSvc = 0 Const prxAllServices = 2 Const prxTCP = 0 Const prxUDP = 1
'Initialize the Internal/External IP Const IntIp="192.168.16.54" Const ExtIp="63.198.196.228" Const UdpRangeCnt=7
Dim objFPC, objArray, objSPR, ObjPD, ojbPR, MyProtDef, MyProt, myCnt Dim UdpIn(7), UdpOut(7)
'Ports for RTP media streams-audio: Primary UdpIn(0)=10000 UdpOut(0)=10000
UdpIn(1)=11600 UdpOut(1)=11600
' Ports for Handshaking - ring control UdpIn(2)=5060 UdpOut(2)=5060
UdpIn(3)=5061 UdpOut(3)=5061
UdpIn(4)=5062 UdpOut(4)=5062
UdpIn(5)=5063 UdpOut(5)=5063
' Ports time UdpIn(6)=123 UdpOut(6)=123
' Ports for tftp UdpIn(7)=69 UdpOut(7)=69
'Create the root object Set objFPC = CreateObject ("FPC.Root")
'Make sure it's current data objFPC.Refresh
'Find where we live Set objArray = objFPC.Arrays.GetContainingArray Set objPD = objArray.PolicyElements.ProtocolDefinitions Set objSPR = objArray.Publishing.ServerPublishingRules Set objPR=objArray.ArrayPolicy.ProtocolRules
'Delete Access Policy for Vt1000v objArray.ArrayPolicy.ProtocolRules.Remove("zVoipUdpEnable") objPR.Save ' **** done delete of only one protocol rule
For myCnt=0 to UdpRangeCnt Step 1
'Delete Server Publishing Rules objArray.Publishing.ServerPublishingRules.Remove("zUdpFwd"&UdpIn(myCnt)) objSPR.Save '**** done delete publishing rules
'Delete a protocol definitions for Inbound objArray.PolicyElements.ProtocolDefinitions.Remove("zUdpIn"&UdpIn(myCnt)) objPD.Save
'Delete a protocol definitions for Outbound objArray.PolicyElements.ProtocolDefinitions.Remove("zzUdpOut"&UdpOut(myCnt)) ObjPD.Save ' **** done delete protocol definitions NEXT
MsgBox ("done delete - restarting firewall service") objFPC.Refresh objArray.SendRestartNotification(prxFwSrvSvc) Set objFPC = Nothing Set objPD=Nothing Set objSPR=Nothing Set objArray=Nothing Set objPR=Nothing
End Sub vt1000vdel
------------- copy til here ---------------------------------
|