Skip to main content

TFTP server


Tips: 複数インターフェースがあるLinuxでTFTPを利用した場合に意図しないインターフェースが送信元として、通信していてルーティングが失敗していることが分かった。/var/log/messageで以下のログが表示される。

参照リンク
https://chriscowley.me.uk/blog/2013/03/25/writeable-tftp-server-on-centos/
http://blog.tsunokawa.net/entry/2014/07/18/164213
https://genchan.net/server/5363
http://www.petenetlive.com/KB/Article/0000998.htm
環境
step1. yumでtftp client とtftp-serverをインストール
yum install tftp tftp-server 

step2. /etc/xinetd.d/tftp に以下を設定

オプションの意味
-cで他ホストからのアップロードを許可します。


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

step3.  xinetd を onにして、tftpを起動させる

自動起動の場合はchkconfig xinetd onを入力
# chkconfig xinetd on

# chkconfig --list xinetd
xinetd          0:off   1:off   2:on    3:on    4:on    5:on

自動起動をしない場合は以下のみ
# service xinetd start

設定変更の場合は以下で再起動
# /etc/init.d/xinetd restart

step4. 以下でローカルでのTFTPで確認
echo "stuff" > test    <----------- testというファイルに"stuffという内容をwrite
tftp localhost -c put test


b

Comments