使用Linux的tftp功能配置ciscorouter

字號:

在局域網(wǎng)環(huán)境中,如果有Cisco 路由器和Linux服務(wù)器。也許你需要利用Linux的
    TFTP服務(wù)去下載Cisco router配置文件 startup-config,在服務(wù)器上編輯后再上載
    到路由器,在實現(xiàn)中有一些特別注意的地方。
    所用軟硬件:Redhat Linux 5.2 ,Cisco 2501 路由器
    1. 開啟 Redhat Linux 服務(wù)器上的tftp服務(wù),考試,大提示并指明下載目錄/tmp。
    [jephe@sh89 /etc]$ more inetd.conf | grep tftp
    tftp dgram udp wait root /usr/sbin/tcpd in.tftpd /tmp
    然后用命令killall -HUP inetd啟動它。
    2. 設(shè)定/tmp權(quán)限,讓其他人有寫權(quán)限(chmod 777 /tmp)。
    [jephe@sh89 /]$ ls -l | grep tmp
    drwxrwxrwx 5 root root 2048 Jun 16 07:44 tmp
    3。 在/tmp目錄建立一個空文件(如isdn),并設(shè)定權(quán)限(chmod 777 /tmp/isdn)
    [root@shopu /tmp]# touch isdn
    [root@shopu /tmp]# chmod 777 isdn
    [root@shopu /tmp]# ls -l isdn
    -rwxrwxrwx 1 root root 0 Jun 16 11:24 isdn
    4. 進(jìn)入路由器,下載配置文件。
    Shanghai-ISDN#copy run tftp
    Remote host [192.168.13.2]?
    Name of configuration file to write [shanghai-isdn-confg]? isdn
    Write file isdn on host 192.168.13.2? [confirm]
    Building configuration...
    Writing isdn !! [OK]
    注釋:你必須正確地設(shè)置權(quán)限,而且必須在下載前創(chuàng)建一個空文件,否則會提示出錯