tftp

26 posts / 0 new
Last post
koncreat
koncreat's picture
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.

alan_mousty
alan_mousty's picture
Did you configure the TFTP

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

koncreat
koncreat's picture
not sure

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

Koncreat

SkykingOH
SkykingOH's picture
Nope, you have to setup DHCP

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

alan_mousty
alan_mousty's picture
My bad. I meant setup the

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

koncreat
koncreat's picture
update

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?

Koncreat

SkykingOH
SkykingOH's picture
I told you how to turn on

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?

koncreat
koncreat's picture
ok..........

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\

Koncreat

wrender
wrender's picture
Option 66

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.

SkykingOH
SkykingOH's picture
Thanks wrender - Yes several

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.

koncreat
koncreat's picture
status

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?

Koncreat

wrender
wrender's picture
Output of tftp

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

wrender
wrender's picture
Iptables

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

koncreat
koncreat's picture
more info

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

Koncreat

wrender
wrender's picture
Missing close bracket

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
}

koncreat
koncreat's picture
didnt see it the first time

# 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
}

Koncreat

wrender
wrender's picture
Looks fine to me

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.

dicko
dicko's picture
server_args = -s

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

wrender
wrender's picture
haha

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

bksales
bksales's picture
here is a dumb question - did you actually build the phone confi

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

tm1000
tm1000's picture
Your tftp option on windows

Your tftp option on windows should just be "192.168.231.70" NOT "192.168.231.70\tftpboot\"

Senior Developer
Schmoozecom, INC

dicko
dicko's picture
netstat -aun |grep -e

netstat -aun |grep -e ":69\s*0""

will also show if tftpd is running on your server.

if

netstat -aun |grep -e ":67\s*0"

shows anything

that means you have a dhcp server running on the box also, so make sure it is not, unless you knopw what you are doing only one dhcpd should be on each network.

koncreat
koncreat's picture
Thanks

Ok so after some digging it appears I have some corruption so I am going to reinstalll. I want to thank all of you for your help. This is my first attempt with setting up freepbx so it is nice to know there is a great support community to help.

Koncreat

butlerkevind
butlerkevind's picture
Koncreat,

Koncreat,

Were you ever successful in getting your AsteriskNow implementation with a Microsoft DHCP server operational? I am attempting the same at home and running into the same problems. I know most out there despise Microsoft, but it would be a major PITA to retool my entire home network to a *nix based infrastructure. Thanks in advance for any replies.

Kevin

SkykingOH
SkykingOH's picture
DHCP is DHCP, it's an IETF

DHCP is DHCP, it's an IETF standard so it doesn't matter if it is MS, Apple, *NIX, runs in the router or you use that stupid DHCP in the could service (actually not so stupid if somebody pays $10/mo for it) only one device can have the DHCP role for each "collision domain" or network, or subnet.

DHCP utilizes broadcast messages so it can't be routed with designating a forwarder. I would not suggest trying to do that for a home network.

Why can't you get MS DHCP to work? It can do options 66 and 150 that are commonly used by IP telephones.

butlerkevind
butlerkevind's picture
Trust me Skyking, I have been

Trust me Skyking, I have been banging my head on the proverbial wall trying to figure this out. And I hate to say it, but it is probably something VERY simple I am overlooking. I have at home a Microsoft network, AD, DNS, DHCP, the works. My internal DNS is comprised of three virtualized DNS servers, all of which perform lookups without any issues, both internally and externally. Additonally, I have the DHCP scope configured to hand out ip requests for both DHCP and BOOTP requests.

My current setup is with my DHCP server on Server 2008 R2. I have my AsteriskNow v2.x.x server on ip 192.168.1.85. My DHCP scope has options 66 configured for pbx.ad.domainname.us (resolving to 192.168.1.85), and DHCP scope option 150 is pointing to 192.168.1.85. The weird behavior I have is my 7940 will receive the configuration for the extension I have created in Asterisk, I can get dialtone on the phone, but it never shows as being registered in the End Point Manager. The other phone I have is a 7941, and regardless of what I do, it never provisions itself with the extension I have configured for it. Both phones show they are pulling ip addresses, and notate the correct ip address for the tftp server running on my Asterisk box. I would appreciate any constructive thoughts on my situation, and I will gladly provide my configuration data as needed for troubleshooting.

Lastly, should I continue posting in this specific thread, or start a new one? Thanks for any assistance.