Thursday, February 13, 2014

2 handy bash tricks

I just came across two handy bash tricks

1 - If you need to run a different command on a file you just executed a command on, without retyping the filename.

ex:
- ls file1234.txt
- more file1234.txt

An easy way is

- ls file1234.txt
- more !^

2 - Switching back and forth between the last two directories.


cd -
check man pushd for multiple directories.

Sunday, August 26, 2012

MIPv6 ready kernel

If you are interested in installing mip6d daemon and testing IPv6 Network Mobility.

The following deb modified kernel (64 bit) file has been generated using the instructions as posted on umip.org.

You can install the following deb Download file on your debian machine, this is Kernel 2.6.32, tested on the most current debian distribution 6.0.5 squeeze.


you have to follow the rest of the guide on umip.org which is essentially 5 lines to install the userland daemon after.

Wednesday, July 11, 2012

Migrating SMTP server ... no problem

In the process of migrating the SMTP server to the cloud or another server, it can be painful to go around change smtp server in all printers, scripts, SNMP servers .... assuming some of them take only IPs and not hostnames.

I found this amazing tool to use in the interim phase until officially moving to the new server.

RINETD is very handy to redirect a connection to a certain port to a different machine and port.

http://www.boutell.com/rinetd/

At the final migration you can use a router or firewall to translate the IP of the old machine to  the new server.


Tuesday, July 10, 2012

ASA syslog ID 419002

Duplicate TCP SYN from inside:source-ip/source-port to inside:dest-ip/dest-port with different initial sequence number

After spending an hour looking at this and capturing traffic, turns out to be a routing problem.

Just thought I put this out there, might help someone.


Thursday, June 21, 2012

Mobility Support in IPv6 - RFCs 3775 and 6275

Mobility Support in IPv6 is defined in RFC 6275, yet most current implementations are based on RFC 3775.

I wanted to highlight the main differences between the two RFCs in this article.

There is no dramatic change in the header format or size that would render previous implementations obsolete.


Aside from replacing plenty of "Which"s by "That"s and references to updated RFCs (ex Neighbor Discovery RFC 4861).

Below is a table of the main points :

 
RFC 3775
RFC 6275
Home and CoA must be Site-Local Addresses
Home and CoA must be Unique-Local Addresses
IKE
IKEv2

Handling Interruptions to Return Routability

Defines a new status code in the binding update acknowledgement message (174 - Invalid CoA)
Specifies processing of the binding update according to the lifetime and CoA value
Specifies processing of the binding update according to the lifetime only

Primary CoA de-registration is redefined to prevent a race condition.

Two new Protocol Constants defined
MAX_DELETE_BCE_TIMEOUT
MAX_RO_FAILURE



Thursday, April 26, 2012

Automate backing up your Cisco routers/switches config to FTP server

After many years of working with Cisco IOS, I just discovered Kron, the *nix cron reincarnated.

Handy to automate configuration backup to an FTP server.

Bad news :

  1.  it does not deal with interactive style commands (expected)
  2. It does not work on PIX/ASA



 conf t  
 kron policy-list BCKP  
 cli sh running-config | redirect ftp://username:password@ftp_server_ip/hostname.cfg  
 exit  
 kron occurrence MONTHLY in 30:00:00 recurring  
 policy-list BCKP  
 end  
 wr mem  

Thursday, February 9, 2012

Manipulating BGP attributes for route selection

Weight Affect local router (O/G traffic) Encourages local traffic to use a specific AS exit point to reach a remote subnet or AS.
Ex: For a router to prefer a neighbour over another (IBGP or EBGP) for specific o/g traffic.
Local Preference Affects local AS IBGP peers (O/G traffic) Encourages local traffic to use a specific AS exit point to reach a remote subnet or AS.
Ex:  For the AS to use one ISP link as main and one to a different ISP as backup.
AS_PATH Affects remote AS and other upstream ASes (I/C traffic) Discourages remote traffic from using a specific AS entry point to reach a local subnet.
Ex:  For the AS to prefer Web server traffic to enter through a specific link.
MED Affects directly remote AS only
(When there are two links)(I/C traffic)
Discourages remote traffic from using a specific AS entry point to reach a local subnet.
Ex:  For the neighbour AS to use one link as main and another as Backup.
Community Affects remote AS and other upstream ASes Mark traffic with a community so that neighbor can perform a specific action on it.
Ex:  For the BGP peer to apply a specific policy on the traffic.

Followers