Wednesday, May 18, 2011

7600 l2protocol forward vs ME3400 l2protocol-tunnel

ME3400

ME3400 is able to tunnel l2 protocols with the command "l2protocol-tunnel xxx"

Tunneled STP BPDUs have 01-00-0C-CD-CD-D0 as a destination mac-address

7600

On 7600 when using service instances on ES cards there is only one option, l2protocol forward.
As the name implies, the router does not alter the BPDUs. It just forwards them on the bridge domain bypassing the SP.

Tunneled STP BPDUs have 01-00-0C-CC-CC-CD as a destination mac-address

Following these different approaches, they can't interoperate in any easy way..

Wednesday, May 11, 2011

Creating a Private Key and Public Certificate

Use the following OpenSSL command to create your private key. The command creates a 1,024-bit RSA private key stored in the file private-key.pem.

openssl genrsa –out private-key.pem 1024

Use the following OpenSSL command to create your public certificate. Run the command from the same directory that you ran the previous command to generate your private key. You will be prompted to enter some basic information for inclusion in the certificate, such as your name. The command generates a public certificate stored in the file public-cert.pem.

openssl req –new –key private-key.pem –x509 –days 365 –out public-cert.pem

That's all

Source: http://goo.gl/Cd24F

Thursday, January 20, 2011

Enable the console of the standby supervisor on Cisco routers

By default, the console of the standby supervisor on Cisco routers is disabled.

If for any reason you need to enable it, do the following:


router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
router(config)#redundancy
router(config-red)#main-cpu
router(config-r-mc)#standby console enable

Tuesday, January 11, 2011

Batch replace a string in several files

At your command prompt type the following

perl -p -i -e 's/oldstring/newstring/g' `grep -il oldstring *`

'oldstring' will be replaced by 'newstring' in all folder files

You can add change the grep command to "grep -ilr oldstring *" in order to make searching recursive

Thursday, November 25, 2010

Configure SSH to connect to a server without username/password

If you are bored having to enter your username and password everytime you connect to a server you can do the following

In your pc run "ssh-keygen"

This will generate public/private rsa key pair.

Then run "ssh-copy-id username@servername"

This will copy the appropriate files to the remote server

Now you can connect to the server and you will not be asked for your credentials.

You can also add the following lines to your ~/.ssh/config file

Host servername
 User username
 Port 2222


This will always connect you to the servername using username at port 2222

Thursday, October 14, 2010

Connect to a port of a remote server through SSH (local port forwarding)

This is the scenario

You want to connect to a remote server's webserver (port 80), but you only have permission to SSH to that server. Do the following:

ssh -L 8080:localhost:80 remote_server

Now you can point your browser to hhtp://localhost:8080 and view remote server's port 80

localhost is relevant to the remote_server

Also, you can do

ssh -L 8080:remote_server_2:80 remote_server_1

Now if you point your browser to http://localhost:8080 you will connect remote_server_2 port 80. The connection will go through remote_server_1 and remote_server_2 will identify remote_server_1 as the source of the request.

This way you can view a web server of a system even though you cannot connect to it directly. Of course remote_server_1 must be able to connect to remote_server_2 at port 80.

You can also use Putty to enable port forwarding. Go to Connection-->SSh-->Tunnels and set the required options.

Display remote X applications to your desktop

The easiest thing you can do is to SSH to the remote server activating the X11 forwarding.

ssh -X remote_server

From now on anything you execute on the remote server appears on your desktop