Tftp

I have setup the freepbx server and when the phones boot up they get an ip address from the dhcp server, windows 2008, but they are not getting their config from the freepbx server. I can ping the phones and the freepbx server and log into both via a web browser.

Did you configure the TFTP server to send the boot parameters?

i just installed freepx and made no changes. Is this not setup by default?

My bad. I meant setup the DHCP server on your Windows box to send the boot parameters?

Nope, you have to setup DHCP for your option 66/150 and turn on the tftp server.

tftp server:

/etc/xinet/d/tftp - Modify as below:

[root@maieast xinetd.d]# cat tftp
# default: off
# description: The tftp server serves files using the trivial file transfer \
#       protocol.  The tftp protocol is often used to boot diskless \
#       workstations, download configuration files to network-aware printers, \
#       and to start the installation process for some operating systems.
service tftp
{
        socket_type             = dgram
        protocol                = udp
        wait                    = yes
        user                    = root
        server                  = /usr/sbin/in.tftpd
        server_args             =  -v -s /tftpboot
        disable                 = no
        per_source              = 11
        cps                     = 100 2
        flags                   = IPv4
}
[root@maieast xinetd.d]#

Run the command ‘service xinetd restart’

You can tail the messages file to see the tftp requests tail -f /var/log/messages

Under dhcp server options i have option 066 setup with \192.168.231.70\tftpboot. The ip address is the address of my freepbx server and the tftpboot directory is where it is showing the boot files are located. However when i boot a phone it is getting ip address and time for the windows server but it is not getting it’s configuration file from the freepbx server. I did try to browse to that folder over the network and it isnt able to open that directory. Do i need to change the file permissions on that folder? I am new to Linux so if i do how do i do that?

I told you how to turn on the tftp process two messages ago. Did you read that?

With all due respect, we are not here to teach Linux. In the time it took you to type that you could have googled “centos set file permissions”.

That’s not the issue thought.

Also your option 66 is wrong. Where did you get that format from?

Yes i did read that part and i did restart the service and it gave an OK status. Where i got the file path is from logging ito the freepbx and going to the end point configuration manager and there is a box labeled Global Final Config and Firmware Directory and in the box next to that label is /tftpboot/
The server ip address is 192.168.231.70 so in the 066 option i put 192.168.231.70\tftpboot\

In addition to making sure your tftp is not disabled in xinetd like SkyKing says above, I believe your mistake is having the the \tftpboot on the end in your dhcp server configuration. Although this is the path where the tftp files reside from the server perspective, from the perspective of the tftp client connecting in, the files are just located at the IP.

I’m not sure about a windows DHCP server as the last windows server I setup this option was quite a few years ago. But with a linux DHCP server it is a simple line like this in the dhcpd configuration file:

option tftp 10.0.1.3

(Where 10.0.1.3 is the ip of your TFTP server…notice there is no path or slashes).

Another thing I have noticed is the FreePBX distro’s are sometimes not configured to allow the tftp ports through the built in firewall. As a temporary work around to provision your phones you can do this at the linux console.

service iptables stop

This will unload all of your firewall rules built into the server so just remember you are totally exposing the server at that point. As a long term solution you should look at adding TFTP port to the iptables configuration.

  1. I ran service iptables stop and got a status of OK.
  2. I changed the path in option 066 to just the server ip address (192.168.231.70)
  3. I rebooted a phone and still no change.
  4. I went through the menus on the phone and it shows the ip address is getting from the dhcp server so it is communicating with that server. I am able to login to the phone with a web browser.
  5. It shows 192.168.231.70 as the tftp server so it is getting that from the dhcp server.

it just doesnt appear to getting the config from the freepbx server.
If install a tftp client should e able to connect to the freepx server assuming that the service is running?

Thanks wrender -

Yes several key points were missed. Did you tail the messages log file and see if the tftp service is started by xinet.d?

Also, the malformed option 66 is what I was getting to. I asked where you got the info because it was very wrong. I should have stated that only. Option 66 expects an IP address, some phones like raw data others like ascii encoding. You may have to try twice.

You can check the phone via the status screen on the phone after it boots to make sure it has valid tftp info.

Can you do a “cat /etc/xinetd.d/tftp” and paste the output of your tftp xinetd configuration for tftp?

Also, I am not sure but you may have to restart xinetd after changing tftp to “disbled = no”. You can do this by typing:

service xinetd restart

And remember, if you reboot your server your iptables will start up again in turn blocking the tftp traffic. To disable it on start up you can type:

chkconfig iptables off

Below is the output you requested:

root@aac-freepbx ~]# cat /etc/xinetd.d/tftp

default: off

description: The tftp server serves files using the trivial file transfer \

protocol. The tftp protocol is often used to boot diskless \

workstations, download configuration files to network-aware printers, \

and to start the installation process for some operating systems.

service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot
disable = no
per_source = 11
cps = 100 2
flags = IPv4

You are missing a close “}” bracket after the xinetd options. Maybe you forgot to cut and paste it to me, or maybe you accidentally deleted it when editing your xinetd which would cause tftp to not work. It should look like this:

# default: off
# description: The tftp server serves files using the trivial file transfer \
#       protocol.  The tftp protocol is often used to boot diskless \
#       workstations, download configuration files to network-aware printers, \
#       and to start the installation process for some operating systems.
service tftp
{
        socket_type             = dgram
        protocol                = udp
        wait                    = yes
        user                    = root
        server                  = /usr/sbin/in.tftpd
        server_args             = -s /tftpboot
        disable                 = no
        per_source              = 11
        cps                     = 100 2
        flags                   = IPv4
}

default: off

description: The tftp server serves files using the trivial file transfer \

protocol. The tftp protocol is often used to boot diskless \

workstations, download configuration files to network-aware printers, \

and to start the installation process for some operating systems.

service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}

Looks fine to me. Did you try doing a “service xinetd restart”?

Also, maybe make sure tftp packages are actually installed on your server. To check you can do:

rpm -qa | grep -i tftp

If it does not respond listing the tftp-server package, then make sure to install it by doing:

yum install tftp-server

Other than that I am pretty much out of ideas. Private message me if you need further help over phone.

server_args = -s /tftpboot

should be

server_args = -vv -s /tftpboot

if you want messages in /var/log/messages

if you use Polycoms or other hrdware that uploads directories and other stuff then you need

server_args = -vv -c -s /tftpboot

-v(V’s) is verbosity -c allows “creation”

service xinetd restart

then

tailf /var/log/message|grep tftp

will show any attempts at tftpd in real time. IMHO though, relying on anything from Microsoft to work properly is a big mistake :wink:

1 Like

haha, i love the fact that you came back to edit your post regarding microsoft’s dhcp.

look in tftpboot and see if the config files are actually there. if not, and you are using the endpoint manager, make sure that you have installed the appropriate package and enabled the firmware. then in the device list, check the boxes for all the phones and click on rebuild. then check tftpboot again and verify the configs are there