目的
Juniper SSG5のファームウェアアップデートに使用するTFTPサーバを構築する。
環境
- AWS
- Amazon Linux AMI release 2015.03
- Installed:tftp-server.x86_64 0:0.49-7.7.amzn1
- Dependency Installed:xinetd.x86_64 2:2.3.14-39.9.amzn1
設定
公開DIR作成
$ sudo mkdir /tftpboot
$ sudo chmod -R 777 /tftpboot
$ sudo chown -R nobody:nobody /tftpboot
設定ファイル
- disableは=noに変更し、有効化
- server_argsに作成した公開DIRを-cを付けて定義
/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 = -c -s /tftpboot
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}
FW
- inbound
Type | Protocol | Port Range | Source |
---|---|---|---|
All UDP | UDP | 0 - 65535 | IPアドレス/プレフィックス |
- aws使用していない場合
/etc/hosts.allow
# juniper - for maintenance
in.tftpd: ***.***.***.***
サービス起動
$ sudo service xinetd restart
動作確認
クライアントからTFTPでファイルをUPLOADする
c:\Users\****>tftp -i ***.***.***.*** put c:\Users\****\juniper\firmware\ssg5ssg20.6.3.0r19.0
転送を正常に完了しました: 118 秒間に 13384482 バイト、113427 バイト/秒
UPLOADされたファイルを確認する
$ ls /tftpboot
ssg5ssg20.6.3.0r19.0
後処理
1.インストール直後からONになっているので、OFFにする。
$ chkconfig --list
xinetd 0:off 1:off 2:off 3:on 4:on 5:on 6:off
xinetd based services:
rsync: off
tftp: on
$ sudo chkconfig xinetd off
$ chkconfig --list
xinetd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
2.サービス停止
$ sudo service xinetd stop
3.FWも閉じ、hosts.allowで定義したものもコメントアウトする。