Yealink Forums
Change vlan setting to more than one phone at once - Printable Version

+- Yealink Forums (http://forum.yealink.com/forum)
+-- Forum: IP Phone Series (/forumdisplay.php?fid=4)
+--- Forum: Configuration (/forumdisplay.php?fid=24)
+--- Thread: Change vlan setting to more than one phone at once (/showthread.php?tid=2781)



Change vlan setting to more than one phone at once - xrpapak - 11-17-2014 12:06 AM

I have about 90 phones and I need to enable vlan for both PC and WAN ports. I have configure my HP switch ports for access and voice vlan needed and now I have to setup the phones.

However, about 90 phones are too many to change them manually. As a result, I should find a way to make the change I would say "automatically". Firstly, I thought of a script which would export the configuration file of each phone, make the changes for vlan settings, import the file and reboot it. The only method I thought if this could be done is via http post but I have difficulty in implementing export and import of the file.

Could someone give me a hint with this? Or maybe is there another way to implement the scenario I mentioned?

Thanks in advance.


RE: Change vlan setting to more than one phone at once - cptjack - 11-17-2014 05:31 AM

Hi xrpapak, what type of phone and firmware are you currently using?
Also do you have some kind of provisioning server implemented at the moment?


RE: Change vlan setting to more than one phone at once - xrpapak - 11-17-2014 05:40 AM

(11-17-2014 05:31 AM)cptjack Wrote:  Hi xrpapak, what type of phone and firmware are you currently using?
Also do you have some kind of provisioning server implemented at the moment?

Hello cptjack,

Thank you for your answer,
Phones are T20P, T22P and T26P.
Firmware is 72.0....(I don't remember the rest)

I don't have any provisioning server implemented. Phones use DHCP for IP configuration and SIP server(asterisk) for extensions etc.. No provisioning servers implemented. That's why I am thinking of a solution like that I mentioned above but I am sure if this can happen.


RE: Change vlan setting to more than one phone at once - Yealink_Jim - 11-17-2014 02:27 PM

Hi,
I suggest that you can enable vlan for both PC and WAN ports via Auto Provisioning. Given below is the configuration parameters:

-------------------------------------------------------------------
#!version:1.0.0.1
#Enable or disable the VLAN of WAN prot; 0-Disabled (default), 1-Enabled;
#Require reboot;
network.vlan.internet_port_enable =

#Configure the VLAN ID, it ranges from 0 to 4094, the default value is 0.
#Require reboot;
network.vlan.internet_port_vid =

#Configure the VLAN priority, it ranges from 0 (default) to 7.
#Require reboot;
network.vlan.internet_port_priority =

#Enable or disable the VLAN of PC port; 0-Disabled (default), 1-Enabled;
#Require reboot;
network.vlan.pc_port_enable =

#Configure the VLAN ID, it ranges from 0 to 4094, the default value is 1.
#Require reboot;
network.vlan.pc_port_vid =

#Configure the VLAN priority, it ranges from 0 (default) to 7.
#Require reboot;
network.vlan.pc_port_priority =
-------------------------------------------------------------------------------------------

Yealink IP phones support FTP, TFTP, HTTP, and HTTPS protocols for auto
provisioning and are configured by default to use theTFTP protocol.
Briefly, the procedure is to prepare a TFTP server, put the configuration CFG file to the TFTP server, then enable the phone to update the firmware via the TFTP server.

[Image: attachment.php?aid=1161]

You can refer to below Auto Provisioning guide for more information:

http://www.yealink.com/Upload/T2X/2014.3.4/Yealink_SIP-T2_Series_IP_Phones_Auto_Provisioning_Guide_V72_30.pdf

Hope this helps!


RE: Change vlan setting to more than one phone at once - xrpapak - 11-17-2014 04:17 PM

(11-17-2014 02:27 PM)Yealink_Jim Wrote:  Hi,
I suggest that you can enable vlan for both PC and WAN ports via Auto Provisioning. Given below is the configuration parameters:

-------------------------------------------------------------------
#!version:1.0.0.1
#Enable or disable the VLAN of WAN prot; 0-Disabled (default), 1-Enabled;
#Require reboot;
network.vlan.internet_port_enable =

#Configure the VLAN ID, it ranges from 0 to 4094, the default value is 0.
#Require reboot;
network.vlan.internet_port_vid =

#Configure the VLAN priority, it ranges from 0 (default) to 7.
#Require reboot;
network.vlan.internet_port_priority =

#Enable or disable the VLAN of PC port; 0-Disabled (default), 1-Enabled;
#Require reboot;
network.vlan.pc_port_enable =

#Configure the VLAN ID, it ranges from 0 to 4094, the default value is 1.
#Require reboot;
network.vlan.pc_port_vid =

#Configure the VLAN priority, it ranges from 0 (default) to 7.
#Require reboot;
network.vlan.pc_port_priority =
-------------------------------------------------------------------------------------------

Yealink IP phones support FTP, TFTP, HTTP, and HTTPS protocols for auto
provisioning and are configured by default to use theTFTP protocol.
Briefly, the procedure is to prepare a TFTP server, put the configuration CFG file to the TFTP server, then enable the phone to update the firmware via the TFTP server.

[Image: attachment.php?aid=1161]

You can refer to below Auto Provisioning guide for more information:

http://www.yealink.com/Upload/T2X/2014.3.4/Yealink_SIP-T2_Series_IP_Phones_Auto_Provisioning_Guide_V72_30.pdf

Hope this helps!

Hello Yealink_Jim,

Thanks for your answer,

I would like to avoid auto provisioning ip phones via tftp server. That's because this means I should configure each phone separately to know tftp server, then take each phone's MAC address and configure its MAC.cfg file, setup <y000000.cfg> file and reboot for all phones. As a result, doing the above process I realize infrastructure changes and I haven't planned the impact.

I imagine something like the following http://<phone_ip_address>/cgi-bin/ConfigManApp.com?key=Reboot which is used for rebooting a phone remotely. Something like that for exporting the configuration file, make the changes regarding vlan settings, importing again and rebooting the phones.

Is it possible something like this happens?


RE: Change vlan setting to more than one phone at once - Yealink_Jim - 11-17-2014 04:57 PM

Hi,
Yes, I got you. You can use DHCP Server deployment way to configure both PC and WAN ports. You can refer to below Auto Provisioning guide page 69-76:

http://www.yealink.com/Upload/T2X/2014.3.4/Yealink_SIP-T2_Series_IP_Phones_Auto_Provisioning_Guide_V72_30.pdf

Hope this helps!


RE: Change vlan setting to more than one phone at once - xrpapak - 11-17-2014 05:20 PM

(11-17-2014 04:57 PM)Yealink_Jim Wrote:  Hi,
Yes, I got you. You can use DHCP Server deployment way to configure both PC and WAN ports. You can refer to below Auto Provisioning guide page 69-76:

http://www.yealink.com/Upload/T2X/2014.3.4/Yealink_SIP-T2_Series_IP_Phones_Auto_Provisioning_Guide_V72_30.pdf

Hope this helps!

According to this, I should also configure a tftp server on my network as putting option 66 it asks me to define the provisioning server.

And here, supposing I have configured a tftp server, what file should I put inside tftp server? A general configuration file from which all phones will take configuration changes I have made?


RE: Change vlan setting to more than one phone at once - cptjack - 11-18-2014 06:53 AM

You might be able to do it via SIP Notify or Push XML, but I'm not sure if the T2x supports VLAN configuration via Push XML... I think v72 can do it, but I have only tested the scripts below on a T48G with v73, so please test carefully!

As a starting point, an example of a Push XML is in this thread. Push XML can be delivered by a trusted server (ip) or in a SIP header from the PBX.

A PHP test script to change one parameter on one phone would go like this. It requires however that the server IP is configured in Features -> "Remote Control" -> "Push XML Server IP Address".[/php]
PHP Code:
<?php
$phoneip 
"192.168.0.100";
$serverip "192.168.0.1";

function 
push2phone($server,$phone,$data)
{
$xml "xml=".$data;
$post "POST / HTTP/1.1\r\n";
$post .= "Host: $phone\r\n";
$post .= "Referer: $server\r\n";
$post .= "Connection: Keep-Alive\r\n";
$post .= "Content-Type: text/xml\r\n";
$post .= "Content-Length: ".strlen($xml)."\r\n\r\n";
$fp = @fsockopen $phone80$errno$errstr5);
if(
$fp)
{
fputs($fp$post.$xml);
flush();
fclose($fp);
} else {
    echo 
"error $errno $errstr";
    }
}
##############################

$xml "<YealinkIPPhoneConfiguration Beep='yes'>\n".
     
"<Item>network.vlan.pc_port_vid = 10</Item>\n".
     
"</YealinkIPPhoneConfiguration>\n";
     
push2phone($serverip,$phoneip,$xml);
?>


If you already have asterisk, you can accomplish the same by adding a SIP Notify message in sip_notify.conf:
Code:
[yealink-changevpn]
Event=>yealink-xml
Content-type=>application/xml
Content=><YealinkIPPhoneConfiguration Beep="yes">
Content=><Item>network.vlan.pc_port_vid = 20</Item>
Content=></YealinkIPPhoneConfiguration>

Then from the asterisk console run:
Code:
sip notify yealink-changevpn tel1 tel2 tel3 etc...

The example above will only change the PC VLAN ID, but you can add additional configuration items if needed. Please note that the phone will reboot immediately as the change in VLAN requires reboot.

I hope this helps you on the right track.


RE: Change vlan setting to more than one phone at once - xrpapak - 11-18-2014 10:28 PM

Lately, I tried with DHCP option 132. I read after from firmware 9.71... and lately phones have feature VLAN discovery, with option 132, enabled by default. So, I configured switch port with voice vlan and data vlan and then on DHCP server, I added dhcp option 132 for scope of voice vlan. In addition, I checked that LLDP is enabled on both switch port and phone.

Unfortunately, nothing changed and this scenario didn't came true. Both phone and PC got IP address from data vlan. In order my scenario works I should enable vlan on WAN port of yealink phone.


RE: Change vlan setting to more than one phone at once - cptjack - 11-18-2014 11:48 PM

First thing is to manually configure one phone to make sure you have the correct settings for your network. Then you can apply these parameters using the example script(s) above, either PHP or SIP Notify to only change the parameters you really need.

Like:
Code:
<item>network.vlan.internet_port_enable = 1</item>
<item>network.vlan.internet_port_vid = 132</item>
<item>network.vlan.internet_port_priority = 0</item>
<item>network.vlan.pc_port_enable = 1</item>
<item>network.vlan.pc_port_vid = 1</item>
<item>network.vlan.pc_port_priority = 0</item>
or any combination thereof. This is only an example, so it should be changed to match your network configuration.

Once you have it setup on one phone, it should be possible to duplicate the settings accross multiple phones. The parameters are the same as the auto provisioning guide, but they can be included in an XML message/script to change it on the phone.

I would opt to add a command to the sip_notify.conf so you can update the phone from the Asterisk CLI. Since the phone will reboot, you can monitor the if the extensions goes offline and come back online with the new IP from within the console.