Friday, April 27, 2012

TFTP Server Installation & Configurations





TFTP server is modified form of FTP. It is used to transfer file without performing authentication. TFTP has only home directory, in which subdirectories are not allowed. Directory browsing is not allowed in the home directory.


TFTP is the udp-based protocol, which works on port no 69. TFTP has following features in comparison to the FTP.
  1. Only get file and put file service is available
  2. Authentication is not supported.
  3. Home directory may not have sub-directories 
  4. Directory browsing is not allowed

          Installation and Configuration of TFTP server 

In windows system, we have to execute following steps to use the pc as TFTP server. 
  1. Download TFTP server software from internet.
  2. Install the TFTP server software on pc.
  3. If software is not installed as the service then software should be running on screen . Configure home directory of server or used default.

Functions to be perform with the help of TFTP server

  1. To boot router from TFTP server
  2. Backup IOS and configuration
  3. Restore IOS and configuration
  4. Upgarde IOS
(1) To boot from TFTP server
i) Run the tftp server s/w on pc. And copy IOS image file in the Home directory of tftp  server.
 ii) Test connectivity between router and tftp server.
iii) On router use following commands:-
        Router#conf ter
        Router(config)#boot system tftp c1700-1s-mz.122.3.bin 10.0.0.18
        Router(config)#exit
        Router#copy runn start
Reload the device. Make sure that configuration register set as 0x2102.

2) To backup IOS
    i) Test connectivity and make sure TFTP server is running.
   ii) Type command: -
       Router#show flash (note the IOS filename)
       Router#copy flash TFTP
                        Source filename = ?
                        Destination filename=?
                        IP of TFTP server=?

To backup Configuration
 i) Test connectivity and make sure TFTP server is running.
  ii) Type commands: -
        Router#copy running-config tftp
                        Or
        Router#copy startup-config tftp

     Remote IP: ________
            Destination Filename: ______________

3) To restore Configuration
    i) Test connectivity and make sure TFTP server is running.
   ii) Make sure configuration file is present in home directory and note the filename.
  iii) Type commands: -
        Router#copy tftp running-config
                             Remote IP: __________
                   Source Filename: _______________
Destination Filename[running-config]: _______________

4) Restore/Upgrade IOS
There are four different conditions in which we can restore/upgrade ios


Case 1: old ios is present and flash is in read/write mode.
            i) Copy ios image in tftp server’s home directory.
           ii) Test connectivity and make sure tftp server is running.
          iii) On router use commands: -
               Router# copy tftp flash
                             Source file: -
                      Destination file: -
                                IP address: -
                    Erase Flash [y/n]:

Case2: old ios is present but flash is in read only.
          i) In this case, we have to set config-register to 0x2101 to boot the router from incomplete ios.
         ii) After booting the flash will be read/write mode. Now use same command as in condition case 1.
       iii) When ios loading is complete reset config-register to 0x2102.

Case3: old ios is not present but incomplete ios is present in bios.
             The router will automatically boot from incomplete ios. And we have to execute same commands as in case1 and case2.

Case4: complete ios and incomplete ios is not present in router.
             There are two methods to load ios with the help of Rom Monitor mode.

Method1: loading ios using xmodem
             In this case we have to use xmodem command and the ios will be loaded with the  help of console cable. Tftp is not required in this case.
i) Enter to the Rom Monitor and type following command.
            Rom Mon 1>xmodem <filename>
ii) When router display a message “ Ready to receive file” then click on HyperTerminal then Transfer>> Send file>> use browse to select file>> select protocol xmodem>> send.

Method2: in this case we have to use tftp server in Rom Monitor.
         i) Connect the pc tftp server make sure tftp is running and ios image present in the home directory.
ii) Enter to the Rom Monitor mode and type following command.
            Rom Mon>IP_ADDRESS=10.0.0.2
                               TFTP_SERVER=10.0.0.1
                               TFTP_FILE=<filename>
                               DEFAULT_GATEWAY=10.0.0.1
                               IP_SUBNET_MASK=255.0.0.0
                           >tftpdnld
==> When ios transfer is completed then type command.
        Rom Mon>boot
        Router#show version
To view from where ios boot.
Router#show flash

Resolving Host Name

In router, we can communicate with the help of IP address as well as host name and domain name. There are two methods to resolve hostname into IP address.
1) Using local hostname database
     We can use local hostname database by using IP host command. We can use this command with following syntax: -
Router#config terminal
Router(config)#IP host <name> <IP address>
Router(config)#IP host abc 202.144.55.6
Router(config)#exit
Router#show hosts
Router#ping abc

2) Using a DNS server
     We can configure router to send DNS queries to DNS server. The DNS server will resolve hostname and then pc or router will try to communicate with destination. We can create maximum 6 IP.
Router#config terminal
Router(config)#IP name-server <IP> [<IP2>]
Router(config)#IP name-server 202.56.230.6
Router(config)#exit

Managing Telnet connection
Our router is able to telnet other devices as well as other devices can also perform telnet to our router.

To allow Telnet access to router --> For this purpose we have to configure IP address, vty password and enable secret password. IP must exist between client and router. When router will be able to perform telnet access. On telnet client we have to use following command :--

Router#Telnet <IP of router> 

To display connected users --> Router#show users


To disconnect a user

Router#clear line <no>(to view no use show users & show line commands
  
To telnet a device from router
Router#telnet <IP>
Or
Router>telnet <IP>


Or
Router>telnet <IP>       
To exit from telnet session
Router#exit

To exit from a hanged telnet session
Ctrl+shft+6
X
Router#disconnect

To display connected session
Router#show sessions
This command shows those sessions, which are created or connected by us.

If we want anyone can telnet our router without password then on the line vty type command “No Login”. 

Twitter Delicious Facebook Digg Stumbleupon Favorites More