Showing posts with label Cisco. Show all posts
Showing posts with label Cisco. Show all posts

Thursday, December 29, 2011

Transfer file via tftp for Cisco, Netscaler and Linux box

Once the TFTP server installed. We have to start do some test to perform the backup..
Here I do face some error or failure when transfering..
Do some twit and tune around and here the some way to do it..
Do advise most of the information do plug from some other blog..
Appreciate for their solution and option..


Now... let's get back to business..
Do notes, my tftp server IP is 192.168.1.250
1. Backup for Cisco devices...

Cisco#write net
This command has been replaced by the command:
'copy system:/running-config '
Address or name of remote host []? 192.168.1.250
Destination filename [ cisco-config ]? cisco-config
Write file tftp://192.168.1.250/cisco-config? [confirm]y!! [OK]
Cisco#


2. Backup for Netscaler devices..
For the netscaler devices, if do not have any function for tftp, then required to login to shell mode of the devices. From there, we required to write 2 script for the backup.

i. Create a folder to store backup script.
mkdir /var/backup

ii. create Script backup.sh - backup all the configuration, license and ssl certificate


#!/bin/sh

cd /nsconfig
tar -zcf /tmp/ns-backup.tar ns.conf license/ ssl/
cd /tmp
tftp < /var/backup/tftp.cmd
rm ns-backup.tar


iii. Create Script tftp.cmd - for run the tftp command


connect 192.168.1.250
binary
put ns-backup.tar
quit

iv. If intent to perform the backup daily, can consider to add a crontab for the script run base on your preference time.


3. Backup for Linux Box..
For this option, I do face some error such as Transfer timed out or nothing transfer. Therefore if face some of the issue, might try to perform some tuning on the client machine.

i. At the client machine add the ip_conntrack_tftp
modprobe ip_conntrack_tftp

ii. Then run tftp to put the file into the server.
root@ client[~]# tftp 192.168.1.250
tftp> put my.cnf
tftp> quit

If intent to do some auto backup, do advise use the same solution as suggest on Netscaler Backup solution.



Tuesday, June 1, 2010

Configure Cisco Router

Last time in the first post, Lock had explained configuration for cisco router setting.

Now I do a simple post with step only..
Mostly the ISP will assign some information such as:

Serial IP : 123.123.123.121
Serial Netmask : 255.255.255.252
LAN IP : 58.123.111.97 until 58.123.111.126
LAN Netmask : 255.255.255.224
Default gateway (IP Route) : 202.188.129.113

Then the setup will be:

en
conf t
hostname routername
username routeruser password 0 routerpassword
line vty 0 4
login local
int fast 0/0
ip address 192.168.1.1 255.255.255.0
ip nat inside
no shutdown
exit
int se 0/1/0
ip address 123.123.123.121 255.255.255.252
ip nat outside
no shutdown
exit
ip route 0.0.0.0 0.0.0.0 123.123.123.122
ip nat pool public 58.123.111.97 58.123.111.97 prefix-length 27
ip nat inside source list private pool public overload
ip access-list standard private
permit 192.168.1.0 0.0.0.255
exit
exit
copy run start

Monday, May 31, 2010

Reset cisco router to factory default

Sometimes.. you may forget the password for cisco router..
or prefer set back to factory default setting..

Then can use this way to reset back..

1. Connect to the cisco router using hyper terminal..
2. Restart the router..
3. Once see booting, press
Ctrl + break
4. you will access to RONMON
5. In ronmon, type
ronmon 1> confreg 0x2142
6. Hit enter and
ronmon 2> reset
7. Wait the router boot, then press "n" and enter, when asked to enter dialogue wizard.
8. Then start tpe the following command
enable
conf t
config-register 0x2102
exit
write erase
press enter
reload

9. That all, you will see the router in factory default setting

Tested on Router 1841.

Monday, April 27, 2009

Network Address Translation

As I promised Poh Meng in a very boring Sunday, I will post this basic cisco commands for NAT as co-author for this blog, I appreciate Poh Meng for given me the chance to share my semi professional knowledge here, and hope you all find it useful for you.

Normally these IPs are given by ISP, and all these IP are:
WAN IP: 207.123.123.122 (Customer), 207.123.123.121 (ISP) <--- you have 207.123.123.120/30 here, normally first usable IP of this subnet - 207.123.123.121 is reside to ISP end, and second usable IP of this subnet will allocated to CPE
LAN IP: 62.14.139.132/29 <--- these IPs are given to customer by ISP as Internet IP address (registered IP)

OK, now we start the Cisco router part:
First we start with assign IP to each interface, both LAN and WAN.
=====Cisco Command=====
interface e0 or interface f0/0 (LAN interface)
ip address 192.168.0.1 255.255.255.0 <--- assign IP to interface
ip nat inside <--- define boundary of NAT
no shut

interface s0 (WAN interface)
ip address 207.123.123.122 255.255.255.252 <--- assign IP to interface
ip nat outside <--- define boundary of NAT
no shut

*Sorry for I may confuse you if you don't even know what is IP subnet or subnet mask, 255.255.255.252 behind IP address just a subnet mask for /30 subnet

ip route 0.0.0.0 0.0.0.0 207.123.123.121 <--- this is command for default route
access-list 10 permit 192.168.0.0 0.0.0.255 <---ACL to allow translation from LAN IP to WAN IP
ip nat pool WANIP 62.14.139.133 62.14.139.133 netmask 255.255.255.248 <--- IP nat pool, Start IP and End IP
ip nat inside source list 10 pool WANIP overload <--- to apply internal IP translation, overload to allow multiple LAN IPs translate to single WAN IP

DONE