tftpとは
TFTP(Trivial File Transfer Protocol)とは、コンピュータ間のファイルを転送するプロトコルになります。ftpとは異なり、パスワード認証などもなく、信頼度の高いTCPではなくUDP(69)で実行します。ルータやスイッチのファイルのやり取りなどに利用されています。
インストール環境
- CentOS Linux release 7.4
- tftp-server-5.2-13.
前提条件
- selinux 無効
- ファイアウォール停止
tftpサーバのインストール
1 |
yum -y install tftp-server xinetd |
xinetd.d環境ファイルの修正
変更前
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
[root@lab-server etc]# 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 /var/lib/tftpboot disable = yes per_source = 11 cps = 100 2 flags = IPv4 } |
変更後
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
[root@lab-server etc]# 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 = -c -u root -s /var/lib/tftpboot disable = no per_source = 11 cps = 100 2 flags = IPv4 } |
- -c 新規ファイルを作成を許可
- -u root root権限でファイルの送受信
xinet.d 起動
1 |
systemctl start xinetd |
switchのIOSをtftpサーバへコピー
1 2 3 4 5 6 |
labmng-switch#copy flash:c2960-lanbase-mz.122-25.SEE2/c2960-lanbase-mz.122-25.SEE2.bin tftp: Address or name of remote host []? X.X.X.X Destination filename [c2960-lanbase-mz.122-25.SEE2.bin]? !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!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