Saturday, February 25, 2012

kron and backup

Today, I have looked my auto archive to see if they work properly. Surprise, all was ok except for the 3560 switch. When someone execute a 'write memory' all work fine but the schedule backup creates an empty file. There are just these four rows:

!
!
!
end


After some investigations on Internet I have discovered that I was not the first to occur this issue with these equipement. So I have decided to use another solution. It's the kron which is the equivalent of the cron on an unix machine. The configuration looks like this example:


archive
path ftp://10.10.10.10/PATH/MY-SWITCH/$h-
write-memory
no time-period 10080

kron occurrence backup at 22:00 25 recurring
policy-list backup
!
kron policy-list backup
cli archive config

I have kept all the configuration of the archive except the 'time-period'. I have just added policy backup which is schedule by a kron. The policy executes the command 'archive config' and the kron starts one time par month every 25th at 10pm. Also, it's very important to have NTP server if you don't want encountered problem to execute a kron.

Sunday, February 19, 2012

Add a mount point for an ASA


I have found a nice feature on the Cisco ASA. You can create a mount point to a server FTP.
Below you can find a sample of the configuration to  apply:

mount Backup-ASA type ftp
 server 10.10.10.10
 path /root/Backup
 username  userFTP
 password passwordFT
 mode passive
 status enable

To check all the configuration available on this particular folder you can use the command 'dir':

ASA# dir Backup-ASA:
Directory of Backup-ASA:/
       -rwx  71147       19:37:00 Jul 14 2011  ASA-14jul11.txt
       -rwx  79337       16:41:00 Jan 31 2012  ASA-09-02-2012.txt
0 bytes total (2146293760 bytes free)

This trick can be useful to backup easily the running configuration on remote folder:

ASA#copy running-config Backup-ASA

Thursday, February 9, 2012

Archive configuration on a Cisco Switch

In a previously post I have written a script (python) to automatically backup cisco config.
There is another method to backup this configuration. Used the archive command. By this way, it's possible to backup the configuration on a remote FTP server. Below, you will find an example:


ip ftp username user1
ip ftp password password1
!
archive
 path ftp://10.10.10.10/folder/My-switch.cfg
 write-memory
 time-period 1440

The write memory command trigger an automatic backup on the ftp server.
1440 means one backup generate every day.

If you make a mistake and you decide to come back on an old version, it's possible to restore the configuration. The better way is  using this command:


configure replace path ftp://10.10.10.10/folder/My-switch.cfg--9-09-00-23-0

To see the state of the archive you can use the 'show archive' command:


SWITCH#show archive
The maximum archive configurations allowed is 14.
The next archive file will be named ftp://10.10.10.10/folder/My-switch.cfg-%3Ctimestamp%3E-2
 Archive #  Name
   1        ftp://10.10.10.10/folder/My-switch.cfgFeb--9-09-00-23-0
   2        ftp:// 10.10.10.10/folder/My-switch.cfgFeb--9-09-00-37-1 <- Most Recent
   3
   4


Wednesday, February 8, 2012

Multi Instances with PuttyCM

By default you can just start one puttyCM instance. For example if several users want to use a puttyCM on  server via RDP it's impossible by default. To open several session you need to modify a key register on windows. Below this key:


HKEY_CURRENT_USER\Software\ACS\PuTTY Connection Manager\
AllowMultipleInstances REG_DWORD 1

Saturday, January 21, 2012

Used IPv6 stateful Autoconfiguration

I would like add some details to my post vista and DHCPv6 (in french). I would like detailed which mechanisms is used to choose between stateless and stateful configuration. The DHCPv6 client used 2 bits in the RA  (Routers Advertisements send by the router) in order to know if DHCPv6 server is available:

  • O bit: with this bit, a IPv6 host can use DHCPv6 to collect some parameters like DNS server address. However DHCPv6 server doesn't provide the client's IP address. Host use stateless configuration.
  • M bit: with this bit, a IPv6 host can use DHCPv6 to collect a IPv6 address and others parameters from the server.
  • Without these bits set, the IPv6 host will use stateless autoconfiguration.
The command managed-config-flag  which is used in the router doesn't force hosts to use DHCPv6. It's just a suggestion.

Tuesday, December 20, 2011

Protect against unwanted Router Advertisements (RA)

RA is used by auto-configuration. What is it auto-configuration ? It's a solution who allows devices to choose their own address.
How it works ?

Autoconfiguration is a two-step process:

- Host has to obtain prefix information to configure its address. To do this, it sends a Router Solicitation (RS). It's a multicast frame (ICMPv6 RS) for each router.
- Router advertisement (RA) is sent back by the router. These RAs are also sent periodically by the router. In our case, it's an instantaneous response.

It's a helpful solution for administrator but it's also a good way for hacker to shunt data flows. A hacker can send a wrong RA to a device. In this case, there are 2 issues, denial of service or man in the middle attack. If the hacker sends his own address (gateway information in the RA) all the flows can pass through him. Another error can occur with a misconfigured device, the host should obtain a wrong prefix. To protect against this kind of attack you can use this simple configuration (Port ACL) to stop untrusted RA. The access-list stop RA on all the untrusted interface. Just keep free interface where the router is plugged:

ipv6 access-list filter_RA
 remark Block Rogue RA
 deny icmp any any router-advertisement
 permit any any
!
interface gigabitethernet 1/0/10
 ipv6 traffic-filter filter_RA in
 
On the Catalyst 6500 and 4500 it's possible to use a macro to configure this kind of PACL:

interface gigabitethernet 1/0/10
 ipv6 nd raguard 

It's also possible to filter DHCPv6 with a PACL and just authorize the interface of the server to send response:
ipv6 access-list filter_DHCP
 remark Block traffic from DHCP to client
 deny udp any eq 547 any eq 546
 permit any any
!
interface gigabitethernet 1/0/10
 ipv6 traffic-filter filter_DHCP in

Monday, December 12, 2011

Provide TFTP address by DHCP

A simple memo (in english!) to explain the configuration of DHCP option 150:

Cisco phone use TFTP to download their configuration. To determine the address of the TFTP server, the phone (when the phone starts) sends a DHCP request with option 150 (DHCP 150 provide address of the TFTP server). Below, you will find a simple way to configure this option on a Cisco switch:


 ip dhcp pool DHCPPool
   network 192.162.1.0 255.255.255.0
   option 150 ip 192.168.1.200
   default-router 192.168.1.1